diff --git a/lab_pacientes.php b/lab_pacientes.php index e3f7b11..cc32c99 100644 --- a/lab_pacientes.php +++ b/lab_pacientes.php @@ -11,6 +11,19 @@ if (!isUserLoggedIn()) { } if (isEnfermero()) { header('Location: enfermero_portal.php'); exit; } $adminNombre = $_SESSION['admin_user']['full_name'] ?? $_SESSION['admin_user']['username'] ?? 'Admin'; + +// Color de marca +$brandColor = '#1565c0'; +try { + $row = Database::getInstance()->fetch("SELECT valor FROM lab_config WHERE clave = 'doc_color'"); + if ($row && preg_match('/^#[0-9a-fA-F]{3,8}$/', $row['valor'])) $brandColor = $row['valor']; +} catch (\Throwable $_) {} +$hex = ltrim($brandColor, '#'); +$brandDark = sprintf('#%02x%02x%02x', + max(0, hexdec(substr($hex,0,2)) - 40), + max(0, hexdec(substr($hex,2,2)) - 40), + max(0, hexdec(substr($hex,4,2)) - 40) +); ?> @@ -20,11 +33,70 @@ $adminNombre = $_SESSION['admin_user']['full_name'] ?? $_SESSION['admin_user']['