/* Elimina márgenes y espacios por defecto */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Configuración general del cuerpo de la página */
body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Contenedor principal del login */
.card {
    display: flex;
    width: 900px;
    height: auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

/* Panel izquierdo donde se encuentra el formulario */
.left-panel {
    flex: 1;
    background: #fff;
    padding: 40px 50px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Contenedor del logo */
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

/* Tamaño del logo SIVIS */
.logo svg {
    width: 36px;
    height: 36px;
}

.logo-text h2 {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    letter-spacing: 1px;
}

.logo-text p {
    font-size: 10px;
    color: #888;
    line-height: 1.3;
}

/* Área principal del formulario */
.form-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Título del login */
.form-area h1 {
    font-size: 32px;
    color: #c0392b;
    font-weight: 700;
    margin-bottom: 28px;
}

/* Contenedor de cada input */
.input-group {
    position: relative;
    margin-bottom: 16px;
}

/* Diseño de los campos de texto */
.input-group input {
    width: 100%;
    padding: 13px 16px 13px 44px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 14px;
    color: #555;
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s;
}

/* Efecto al seleccionar el input */
.input-group input:focus {
    border-color: #c0392b;
    background: #fff;
}

.input-group .icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 16px;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #aaa;
    background: none;
    border: none;
    font-size: 16px;
}

.forgot {
    text-align: right;
    margin-top: -8px;
    margin-bottom: 20px;
    font-size: 12px;
}

.forgot a {
    color: #888;
    text-decoration: none;
    font-style: italic;
}

.forgot a:hover {
    color: #c0392b;
}

/* Botón para iniciar sesión */
.btn-login {
    width: 100%;
    padding: 14px;
    background: #c0392b;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

/* Efecto hover del botón */
.btn-login:hover {
    background: #a93226;
}

/* Diseño para mensajes de error */
.error-msg {
    background: #fde8e8;
    border: 1px solid #f5c6c6;
    color: #c0392b;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 14px;
}

/* Panel derecho con imagen de fondo */
.right-panel {
    width: 380px;
    min-height: 520px;
    background-image: url('../img/fondo1.png');
    background-size: cover;
    background-position: center;
}

.logo img {
    width: 180px;
    height: auto;
}

.proyecto-amor-logo {
    width: 140px;
    height: auto;
    display: block;
    margin: 20px auto 0;
}

/* formato de la barra de navegación */
.layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 160px;
    background: #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
    gap: 20px;
    justify-content: space-between;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.sidebar-logo {
    width: 100px;
    height: auto;
}

.user-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #888;
}

.user-avatar-img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.username {
    font-size: 14px;
    color: #555;
    text-align: center;
    word-break: break-all;
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.sidebar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #555;
    font-size: 11px;
    text-align: center;
}

.sidebar-btn i {
    font-size: 28px;
    color: #888;
}

.sidebar-btn:hover i { color: #c0392b; }
.sidebar-btn:hover span { color: #c0392b; }

.sivis-logo-small {
    width: 140px;
    height: auto;
}

/* contenido página principal */
.main-content {
    flex: 1;
    padding: 40px 50px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-title {
    font-size: 40px;
    color: #c0392b;
    font-weight: 700;
    margin-bottom: 40px;
    text-align: center;
}

/* botones de menu */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.menu-btn {
    display: block;
    padding: 16px 24px;
    border: 2px solid #ccc;
    border-radius: 8px;
    text-decoration: none;
    color: #888;
    font-size: 18px;
    text-align: center;
    transition: border-color 0.2s, color 0.2s;
}

.menu-btn:hover {
    border-color: #c0392b;
    color: #c0392b;
}

.inicio-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
    max-width: 400px;
}

/* ========================
   FORM CARD (crear jornada, crear perfil, etc)
======================== */
.form-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 40px 0;
}

.field-group {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.field-group label {
    font-size: 15px;
    color: #555;
    min-width: 180px;
    text-align: right;
}

.field-group input,
.field-group select {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 50px;
    background: #e8e8e8;
    font-size: 14px;
    color: #555;
    outline: none;
    transition: background 0.2s;
}

.field-group input:focus,
.field-group select:focus {
    background: #ddd;
}

/* botón de generar contraseña */
.btn-generar {
    padding: 10px 20px;
    background: #c0392b;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-generar:hover {
    background: #a93226;
}

/* Tablas para las páginas */
.table-page {
    width: 100%;
    padding: 40px 50px;
}

.search-bar {
    display: flex;
    align-items: center;
    border: 2px solid #333;
    border-radius: 50px;
    padding: 10px 20px;
    margin-bottom: 24px;
    gap: 10px;
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    background: transparent;
    color: #333;
}

.search-icon {
    font-size: 18px;
    color: #888;
}

.clear-search {
    font-size: 18px;
    color: #888;
    cursor: pointer;
}

.clear-search:hover {
    color: #c0392b;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead tr {
    background: #c0392b;
    color: white;
}

.data-table th {
    padding: 14px 20px;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
}

.data-table td {
    padding: 14px 20px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    color: #555;
}

.data-table tbody tr:hover {
    background: #fafafa;
}

.btn-eliminar {
    background: #ddd;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-eliminar:hover {
    background: #c0392b;
}

/* search bar */
.search-form {
    --timing: 0.3s;
    --height-of-input: 45px;
    --border-height: 2px;
    --border-color: #c0392b;
    --border-radius: 30px;
    position: relative;
    width: 100%;
    height: var(--height-of-input);
    display: flex;
    align-items: center;
    padding-inline: 0.8em;
    border-radius: var(--border-radius);
    background: #fff;
    border: 2px solid #333;
    margin-bottom: 24px;
    transition: border-radius 0.5s ease;
}

.search-form button {
    border: none;
    background: none;
    color: #8b8ba7;
    cursor: pointer;
}

.search-form:before {
    content: "";
    position: absolute;
    background: var(--border-color);
    transform: scaleX(0);
    transform-origin: center;
    width: 100%;
    height: var(--border-height);
    left: 0;
    bottom: 0;
    border-radius: 1px;
    transition: transform var(--timing) ease;
}

.search-form:focus-within {
    border-radius: 1px;
}

.search-form:focus-within:before {
    transform: scale(1);
}

.search-input {
    font-size: 0.9rem;
    background-color: transparent;
    width: 100%;
    height: 100%;
    padding-inline: 0.5em;
    border: none;
    outline: none;
}

.search-form .reset {
    border: none;
    background: none;
    opacity: 0;
    visibility: hidden;
    cursor: pointer;
}

.search-input:not(:placeholder-shown) ~ .reset {
    opacity: 1;
    visibility: visible;
}

.search-form svg {
    width: 17px;
    margin-top: 3px;
}

.table-footer {
    position: fixed;
    bottom: 30px;
    right: 40px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-ver {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #ddd;
    border-radius: 50%;
    text-decoration: none;
    color: #555;
    transition: background 0.2s, color 0.2s;
    margin: 0 auto;
}

.btn-ver:hover {
    background: #c0392b;
    color: white;
}

.btn-secundario {
    padding: 14px 40px;
    background: white;
    color: #c0392b;
    border: 2px solid #c0392b;
    border-radius: 50px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
    display: inline-block;
}

.btn-secundario:hover {
    background: #c0392b;
    color: white;
}

/* ========================
   MODAL
======================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 440px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-title {
    font-size: 24px;
    color: #c0392b;
    font-weight: 700;
    margin-bottom: 28px;
    text-align: center;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}
.modal-card .field-group {
    justify-content: center;
}

.modal-card .field-group label {
    min-width: 80px;
    text-align: right;
}
/* ========================
   PACIENTE PAGE
======================== */
.paciente-page {
    width: 100%;
    padding: 40px 50px;
}

.tab-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
}

/* ========================
   TAB MENU (scoped a .tab-menu para no afectar el sidebar)
======================== */
.tab-menu {
    width: 100%;
    margin-bottom: 30px;
}

.tab-menu > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    background: #fff;
    border-bottom: 1px solid #ddd;
}

.tab-menu > ul > .tab-item {
    flex: 1;
    text-align: center;
    border-right: 1px solid #e0e0e0;
    transition: all 0.2s;
    cursor: pointer;
}

.tab-menu > ul > .tab-item:last-child {
    border-right: none;
}

.tab-menu > ul > .tab-item a {
    display: block;
    padding: 16px 10px;
    text-decoration: none;
    color: #aaa;
    font-size: 22px;
    transition: color 0.2s;
}

.tab-menu > ul > .tab-item div {
    font-size: 13px;
    font-weight: 600;
    margin-top: 6px;
    color: #aaa;
}

.tab-menu > ul > .tab-item:hover {
    background: #f5f5f5;
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.08);
}

.tab-menu > ul > .tab-item:hover a,
.tab-menu > ul > .tab-item:hover div {
    color: #c0392b;
}

.tab-menu > ul > .tab-item.active {
    background: #f9f9f9;
    border-bottom: 3px solid #c0392b;
}

.tab-menu > ul > .tab-item.active a,
.tab-menu > ul > .tab-item.active div {
    color: #c0392b;
}

/* ========================
   TAB CONTENT
======================== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========================
   GENERALES GRID (dos columnas)
======================== */
.generales-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 60px;
    margin-top: 30px;
}

.generales-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.generales-col .field-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
}

.generales-col .field-group label {
    min-width: 160px;
    text-align: right;
    font-size: 14px;
    color: #555;
}

.generales-col .field-group input,
.generales-col .field-group select {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 50px;
    background: #e8e8e8;
    font-size: 14px;
    color: #555;
    outline: none;
}

/* ========================
   EXAMEN
======================== */
.examen-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 30px 60px;
    margin-top: 30px;
}

.examen-col {
    display: flex;
    flex-direction: column;
    gap: 30px;
    min-width: 0;
}

.examen-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.examen-subtitle {
    font-size: 16px;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}

/* Tabla agudeza visual */
.av-table {
    width: 100%;
    border-collapse: collapse;
}

.av-table th {
    background: #f5f5f5;
    padding: 8px 12px;
    font-size: 13px;
    color: #888;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.av-table td {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    text-align: center;
    font-size: 14px;
    color: #555;
}

.av-input {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}

.av-input span {
    font-size: 14px;
    color: #555;
    white-space: nowrap;
}

.av-input input {
    width: 60px;
    padding: 6px 8px;
    border: none;
    border-radius: 8px;
    background: #e8e8e8;
    font-size: 14px;
    text-align: center;
    outline: none;
}

/* Impresión Clínica checkboxes */
.ic-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ic-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    position: relative;
}

.ic-checkbox input[type="checkbox"],
.ic-checkbox input[type="radio"] {
    display: none;
}

.ic-custom-check {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
    transition: all 0.2s;
    background: #fff;
}

.ic-checkbox input[type="checkbox"]:checked ~ .ic-custom-check,
.ic-checkbox input[type="radio"]:checked ~ .ic-custom-check {
    background: #c0392b;
    border-color: #c0392b;
}

.ic-checkbox input[type="checkbox"]:checked ~ .ic-custom-check::after,
.ic-checkbox input[type="radio"]:checked ~ .ic-custom-check::after {
    content: '✓';
    color: white;
    font-size: 12px;
    position: absolute;
    left: 3px;
    top: 0px;
}

/* Capacidades visuales adicionales: opciones en fila, sin partir el texto */
.cva-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
}

.cva-grid .ic-checkbox {
    white-space: nowrap;
}

/* Referido */
.referido-group {
    display: flex;
    gap: 24px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.radio-label input[type="radio"] {
    accent-color: #c0392b;
    width: 16px;
    height: 16px;
}

/* Tabla receta */
.receta-table {
    width: 100%;
    border-collapse: collapse;
}

.receta-table th {
    background: #f5f5f5;
    padding: 8px;
    font-size: 13px;
    color: #888;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.receta-table td {
    padding: 8px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.receta-table td input {
    width: 70px;
    padding: 6px 4px;
    border: none;
    border-radius: 8px;
    background: #e8e8e8;
    font-size: 13px;
    text-align: center;
    outline: none;
}

/* DIP grid */
.dip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.dip-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.av-input-labeled {
    display: flex;
    align-items: center;
    gap: 8px;
}

.av-input-labeled label {
    font-size: 13px;
    color: #888;
    min-width: 40px;
}

/* Material y montura */
.montura-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.montura-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.montura-label {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    margin-bottom: 4px;
}

/* Notas */
.notas-area {
    width: 100%;
    min-height: 100px;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    background: #e8e8e8;
    font-size: 14px;
    color: #555;
    outline: none;
    resize: vertical;
    font-family: 'Segoe UI', sans-serif;
}

.hidden {
    display: none;
}

.lente-otro-field {
    margin-top: 8px;
    width: 100%;
    padding: 8px 16px;
    border: none;
    border-radius: 50px;
    background: #e8e8e8;
    font-size: 14px;
    outline: none;
}

/* ========================
   ADMINISTRACIÓN
======================== */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px 60px;
    margin-top: 30px;
}

.admin-col {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

input:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
/* ========================
   HISTORIAL
======================== */
.historial-entry {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.historial-entry:last-child {
    border-bottom: none;
}
/* ========================
   MI PERFIL
======================== */
.perfil-page {
    width: 100%;
    padding: 40px 50px;
}

.perfil-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 60px;
    margin-top: 30px;
    align-items: start;
}

.perfil-foto-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.perfil-foto {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
}

.perfil-foto-default {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: #888;
}

.btn-cambiar-foto {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    text-decoration: underline;
    background: none;
    border: none;
}

.btn-cambiar-foto:hover {
    color: #c0392b;
}

.btn-eliminar-perfil {
    padding: 12px 32px;
    background: #c0392b;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}

.btn-eliminar-perfil:hover {
    background: #a93226;
}

.perfil-datos-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.perfil-btn-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.success-msg {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 14px;
}
/* Imagen de perfil etiquetas */
.perfil-foto {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e0e0e0;
}

.perfil-foto-default {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: #888;
}

.perfil-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 60px;
    margin-top: 30px;
    align-items: start;
}

.perfil-foto-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-top: 20px;
}

/* ========================
   MENSAJE GUARDADO
======================== */
.mensaje-guardado {
    max-width: 400px;
    margin: 0 auto 20px;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-cerrar-mensaje {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: inherit;
    opacity: 0.6;
    padding: 0;
    line-height: 1;
}

.btn-cerrar-mensaje:hover {
    opacity: 1;
}

/* ========================
   BOTÓN REGRESAR
======================== */
.btn-regresar {
    position: fixed;
    top: 40px;
    left: 180px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f0f0f0;
    border: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #555;
    transition: all 0.2s;
    z-index: 100;
    text-decoration: none;
}

.btn-regresar:hover {
    background: #e0e0e0;
    color: #333;
}

/* ========================
   SUBOPCIONES DE MONTURA
======================== */

.subopciones {
    margin-left: 24px;
    margin-top: 4px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-left: 2px solid #e0e0e0;
    padding-left: 12px;
    display: none;
}

/* Mostrar cuando corresponda */
.subopciones.visible {
    display: flex;
}

.subopcion {
    font-size: 13px;
    color: #777;
    display: flex;
}

/* ========================
   FILTROS DE JORNADAS
======================== */
.filtros-container {
    margin-bottom: 24px;
}

.filtros-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filtro-fecha {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #888;
}

.filtro-fecha input[type="date"] {
    padding: 10px 14px;
    border: 2px solid #333;
    border-radius: 50px;
    font-size: 14px;
    outline: none;
    color: #555;
    background: #fff;
    transition: border-color 0.2s;
}

.filtro-fecha input[type="date"]:focus {
    border-color: #c0392b;
}

.toggle-password {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: #777;
    border-radius: 6px;
}

.toggle-password svg {
    display: block;
    pointer-events: none;
}

.toggle-password:hover {
    color: #333;
}

.toggle-password:focus-visible {
    outline: 2px solid #777;
    outline-offset: 2px;
}

/* ========================
   AJUSTES DE LA PESTAÑA EXAMEN
======================== */

/* Permitir que los contenedores se ajusten al espacio */
#tab-examen .examen-col,
#tab-examen .examen-section,
#tab-examen .dip-col,
#tab-examen .field-group {
    min-width: 0;
}

/* AV final arriba; DIP y altura debajo */
#tab-examen .dip-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

/* Evitar que las etiquetas empujen los campos */
#tab-examen .field-group > label {
    min-width: 0;
    flex: 0 1 145px;
    overflow-wrap: break-word;
}

/* Los campos pueden reducirse dentro de su columna */
#tab-examen .field-group > input,
#tab-examen .field-group > select {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    flex: 1 1 0;
    box-sizing: border-box;
}

/* Ajustar las tablas de ambas recetas */
#tab-examen .receta-table {
    width: 100%;
    table-layout: fixed;
}

#tab-examen .receta-table th,
#tab-examen .receta-table td {
    padding: 8px 4px;
    overflow-wrap: break-word;
}

#tab-examen .receta-table th:first-child,
#tab-examen .receta-table td:first-child {
    width: 38px;
}

#tab-examen .receta-table td input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* Tablet y pantallas con menos espacio */
@media (max-width: 1200px) {
    #tab-examen .examen-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }
}

/* Teléfono: etiquetas encima de sus campos */
@media (max-width: 600px) {
    #tab-examen .field-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    #tab-examen .field-group > label {
        flex: none;
        text-align: left;
    }

    #tab-examen .field-group > input,
    #tab-examen .field-group > select {
        flex: none;
    }

    #tab-examen .ic-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ========================
   GENERALES Y ADMINISTRACIÓN
   Tablet vertical y teléfono
======================== */
@media (max-width: 1024px) {

    /* Una columna de datos */
    #tab-generales .generales-grid,
    #tab-administracion .admin-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    #tab-generales .generales-col,
    #tab-administracion .admin-col,
    #tab-administracion .examen-section {
        min-width: 0;
    }

    /* Etiqueta arriba y campo debajo */
    #tab-generales .field-group,
    #tab-administracion .field-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        min-width: 0;
    }

    #tab-generales .field-group > label,
    #tab-administracion .field-group > label {
        min-width: 0;
        text-align: left;
        flex: none;
    }

    /* Campos ajustados al ancho disponible */
    #tab-generales .field-group > input,
    #tab-generales .field-group > select,
    #tab-administracion .field-group > input,
    #tab-administracion .field-group > select {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        flex: none;
        box-sizing: border-box;
        font-size: 16px;
    }

    #tab-generales textarea,
    #tab-administracion textarea {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Permitir que las opciones se acomoden */
    #tab-administracion .referido-group {
        flex-wrap: wrap;
    }
}

/* ========================
   HISTORIAL: TABLA ADAPTABLE
======================== */

#tab-historial,
#tab-historial .historial-entry {
    min-width: 0;
    max-width: 100%;
}

#tab-historial .historial-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    margin-top: 12px;
}

#tab-historial .data-table {
    width: 100%;
    min-width: 900px;
}

#tab-historial .data-table td {
    white-space: nowrap;
}

#tab-historial .examen-subtitle {
    overflow-wrap: anywhere;
}

#tab-historial .historial-scroll:focus-visible {
    outline: 2px solid #c0392b;
    outline-offset: 2px;
}
#seccion-estatus-orden .orden-ayuda {
    margin: 0 0 14px;
    color: #777;
    font-size: 13px;
}

#seccion-estatus-orden .orden-pasos {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 0 20px;
}

#seccion-estatus-orden .orden-etapa {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

#seccion-estatus-orden .orden-etapa:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 18px;
    left: calc(50% + 22px);
    width: calc(100% - 36px);
    height: 2px;
    background: #ddd;
}

#seccion-estatus-orden .orden-numero {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    box-sizing: border-box;
    border: 2px solid #ddd;
    border-radius: 50%;
    background: #fff;
    color: #888;
    font-weight: 600;
}

#seccion-estatus-orden .orden-decision {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

#seccion-estatus-orden .orden-opcion {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 5px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #f4f4f4;
    color: #555;
    cursor: pointer;
    font-size: 13px;
    text-align: center;
    box-sizing: border-box;
}

#seccion-estatus-orden .orden-opcion input {
    width: 14px;
    height: 14px;
    min-width: 14px;
    margin: 0;
    padding: 0;
    accent-color: #c0392b;
}

#seccion-estatus-orden .orden-opcion:focus-within {
    outline: 2px solid #c0392b;
    outline-offset: 3px;
}

#seccion-estatus-orden .orden-opcion.seleccionada {
    border-color: #c0392b;
    background: #fbecea;
    color: #a52e22;
}

#seccion-estatus-orden .orden-etapa.actual .orden-numero {
    border-color: #c0392b;
    background: #c0392b;
    color: white;
}

#seccion-estatus-orden .orden-etapa.completada .orden-numero {
    border-color: #c0392b;
    color: #c0392b;
    background: #fbecea;
}

#seccion-estatus-orden .orden-etapa.completada::after {
    background: #c0392b;
}

#seccion-estatus-orden .orden-fechas {
    background: #f6f6f6;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13px;
    color: #555;
}

#seccion-estatus-orden .orden-fechas p {
    margin: 5px 0;
}

@media (max-width: 600px) {
    #seccion-estatus-orden .orden-pasos {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    #seccion-estatus-orden .orden-etapa {
        flex-direction: row;
        align-items: flex-start;
    }

    #seccion-estatus-orden .orden-etapa::after {
        display: none;
    }

    #seccion-estatus-orden .orden-numero {
        flex-shrink: 0;
    }

    #seccion-estatus-orden .orden-decision {
        width: auto;
    }
}