/* ===== Estilos globales compartidos ===== */

/* ── Encabezado de página ── */
.encabezado-pagina {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 14px;
}

.encabezado-pagina h1 {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
}

.encabezado-pagina p {
    color: #64748b;
    font-size: 13.5px;
    margin-top: 4px;
    font-weight: 400;
}

/* ── Tarjetas ── */
.tarjeta {
    background: #ffffff;
    border-radius: 16px;
    padding: 26px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 16px rgba(0,0,0,0.05);
    margin-bottom: 22px;
    border: 1px solid rgba(0,0,0,0.04);
}

.tarjeta-titulo {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Botones ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn:active { transform: translateY(0); }

.btn-primario {
    background: linear-gradient(135deg, #2c5078, #1e3a5f);
    color: #fff;
    box-shadow: 0 2px 8px rgba(44,80,120,0.35);
}
.btn-primario:hover { background: linear-gradient(135deg, #1e3a5f, #16304f); box-shadow: 0 6px 16px rgba(44,80,120,0.4); }

.btn-exito {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}
.btn-exito:hover { box-shadow: 0 6px 16px rgba(16,185,129,0.4); }

.btn-peligro {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 2px 8px rgba(239,68,68,0.3);
}
.btn-peligro:hover { box-shadow: 0 6px 16px rgba(239,68,68,0.4); }

.btn-secundario {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.btn-secundario:hover { background: #e2e8f0; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.btn-pequeno { padding: 7px 14px; font-size: 12px; border-radius: 8px; }

/* ── Tablas ── */
.tabla-contenedor {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
}

/* ── Tabla de listados (registros: ODI, etc.) ── */
.tabla-listado {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.tabla-listado th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #64748b;
    padding: 8px 10px;
    border-bottom: 2px solid #e2e8f0;
}
.tabla-listado td {
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
    color: #334155;
    overflow-wrap: break-word;
}
.tabla-listado tbody tr:hover { background: #f8fafc; }

table.tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.tabla thead { background: #f8fafc; }

.tabla th {
    text-align: left;
    padding: 13px 16px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.tabla td {
    padding: 13px 16px;
    border-bottom: 1px solid #f8fafc;
    color: #334155;
    vertical-align: middle;
}

.tabla tbody tr { transition: background 0.15s; }
.tabla tbody tr:hover td { background: #f8fafc; }
.tabla tbody tr:last-child td { border-bottom: none; }

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge-verde  { background: #dcfce7; color: #15803d; }
.badge-amarillo { background: #fef9c3; color: #92400e; }
.badge-naranja { background: #ffedd5; color: #c2410c; }
.badge-rojo   { background: #fee2e2; color: #b91c1c; }
.badge-azul   { background: #dbe6f0; color: #122740; }
.badge-gris   { background: #f1f5f9; color: #64748b; }
.badge-morado { background: #fdebd9; color: #b45309; }

/* ── Formularios ── */
.formulario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.campo { display: flex; flex-direction: column; gap: 7px; }

.campo label {
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
    letter-spacing: 0.1px;
}

.campo input,
.campo select,
.campo textarea {
    padding: 10px 13px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: #fafafa;
    color: #1e293b;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
    border-color: #2c5078;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(44,80,120,0.12);
}

.campo-completo { grid-column: 1 / -1; }

.ayuda-campo {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
    line-height: 1.4;
}

.campo-checkbox {
    flex-direction: row;
    align-items: center;
    gap: 9px;
}

.campo-checkbox input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #2c5078;
    cursor: pointer;
}

.acciones-formulario {
    display: flex;
    gap: 10px;
    margin-top: 22px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ── Alertas ── */
.alerta {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 13.5px;
    font-weight: 500;
    border: 1px solid transparent;
}

.alerta-exito { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.alerta-error  { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.alerta-info   { background: #edf3f8; color: #122740; border-color: #c3d5e6; }
.alerta-aviso  { background: #fffbeb; color: #92400e; border-color: #fde68a; }

/* ── Barra de búsqueda ── */
.barra-busqueda,
.barra-filtros {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.barra-filtros input,
.barra-filtros select {
    min-width: 160px;
}

.barra-filtros input {
    flex: 2;
    min-width: 220px;
}

.barra-busqueda input {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.barra-busqueda input:focus {
    border-color: #2c5078;
    box-shadow: 0 0 0 3px rgba(44,80,120,0.1);
}

/* ── Estado vacío ── */
.estado-vacio {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.estado-vacio span { font-size: 48px; display: block; margin-bottom: 14px; opacity: 0.6; }
.estado-vacio p { font-size: 14px; }
