:root {
  --navy: #071d32;
  --navy-soft: #0d304a;
  --teal: #008db7;
  --teal-dark: #007da4;
  --ink: #071d32;
  --muted: #5d7285;
  --line: #d4e3ec;
  --canvas: #eef7fb;
  --white: #fff;
  --gold: #00acd1;
}

body.tema-osuthgra-mdp {
  --navy: #071d32;
  --navy-soft: #0d304a;
  --teal: #008db7;
  --teal-dark: #007da4;
  --ink: #071d32;
  --muted: #5d7285;
  --line: #d4e3ec;
  --canvas: #eef7fb;
  --gold: #00acd1;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--canvas); color: var(--ink); font-family: Arial, Helvetica, sans-serif; }
body.modal-open { overflow: hidden; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 25px 17px 19px; background: var(--navy); color: var(--white); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 9px 25px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand.brand-with-logo { min-height: 76px; align-items: center; padding: 0 3px 20px; }
.brand.brand-with-logo .brand-mark,
.brand.brand-with-logo > div:not(.brand-mark) { display: none; }
.institution-logo { display: block; width: 100%; max-width: 210px; height: auto; padding: 8px 10px; border-radius: 10px; background: #fff; object-fit: contain; object-position: left center; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--gold); color: #173540; font-family: Georgia, serif; font-size: 22px; font-weight: 800; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 16px; letter-spacing: .01em; }
.brand span { margin-top: 3px; color: #a8c0c8; font-size: 11px; }
nav { display: grid; gap: 5px; margin-top: 21px; }
.nav-item { display: flex; align-items: center; gap: 13px; padding: 11px 13px; border-radius: 9px; color: #b8ccd3; text-decoration: none; font-size: 13px; font-weight: 700; }
.nav-item span { width: 18px; text-align: center; font-size: 17px; }
.nav-item:hover, .nav-item.active { background: var(--navy-soft); color: var(--white); }
body.tema-osuthgra-mdp .sidebar { background: #071d32; }
body.tema-osuthgra-mdp .nav-item { color: #d8e7ef; }
body.tema-osuthgra-mdp .nav-item:hover,
body.tema-osuthgra-mdp .nav-item.active { background: #0d304a; box-shadow: inset 3px 0 0 #00acd1; }
body.tema-osuthgra-mdp .primary-action { box-shadow: 0 5px 15px rgba(0, 141, 183, .22); }
body.tema-osuthgra-mdp .quick-card.featured { border-color: #8bcddd; background: linear-gradient(135deg, #f8fdff, #eaf6fa); }
body.tema-osuthgra-mdp .module-topbar h1,
body.tema-osuthgra-mdp .module-panel h2 { color: #071d32; }
body.tema-osuthgra-mdp .module-kicker { color: #008db7 !important; }
body.tema-osuthgra-mdp .module-button { background: #008db7; box-shadow: 0 8px 20px rgba(0,141,183,.16); }
body.tema-osuthgra-mdp .module-button.secondary { border-color: #d4e3ec; background: #fff; color: #29465b; box-shadow: none; }
body.tema-osuthgra-mdp .metric-card span,
body.tema-osuthgra-mdp .data-row .badge-icon { background: #e3f5fa; color: #008db7; }
.trial-card { margin-top: auto; padding: 15px; border: 1px solid rgba(226,184,82,.32); border-radius: 11px; background: rgba(226,184,82,.08); }
.trial-card > span { color: #d6b867; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.trial-card strong { display: block; margin-top: 7px; font-size: 12px; }
.trial-progress { height: 4px; margin: 11px 0; overflow: hidden; border-radius: 5px; background: rgba(255,255,255,.15); }
.trial-progress i { display: block; width: 22%; height: 100%; background: var(--gold); }
.trial-card button { border: 0; background: none; color: #d8e4e7; padding: 0; font-size: 10px; text-decoration: underline; }
.profile-mini { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: auto; padding: 15px 8px 0; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar:has(.trial-card:not([hidden])) .profile-mini { margin-top: 15px; }
.avatar { width: 34px; height: 34px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #dcecef; color: #185d70; font-size: 11px; font-weight: 800; }
.profile-mini > div:nth-child(2) { min-width: 0; flex: 1; }
.profile-mini strong, .profile-mini span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-mini strong { font-size: 11px; }.profile-mini span { margin-top: 3px; color: #9cb5be; font-size: 9px; }
.profile-mini button { border: 0; background: none; color: #94adb6; }
.profile-mini .session-exit { width: 100%; display: flex; justify-content: center; gap: 7px; padding: 8px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; color: #d6e4e8; font-size: 9px; font-weight: 800; }
.profile-mini .session-exit:hover { background: rgba(255,255,255,.08); color: #fff; }

.workspace { min-width: 0; padding: 36px 43px 32px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.persistent-greeting { display:flex;align-items:center;justify-content:space-between;gap:30px;min-height:104px;border-bottom:1px solid var(--line);background:#fff; }
.persistent-greeting .persistent-date,.persistent-greeting .eyebrow { margin:0 0 8px;color:#8b8290;font-size:9px;font-weight:800;letter-spacing:.14em; }
.persistent-greeting h1 { color:var(--ink);font-size:29px; }
.persistent-greeting h1 em { margin-left:5px;color:var(--teal);font-style:normal; }
.workspace>.persistent-greeting { margin:-36px -43px 0;padding:24px 43px; }
.module-workspace>.persistent-greeting { margin:-32px -42px 28px;padding:24px 42px; }
.clinical-workspace>.persistent-greeting { margin:-36px -43px 27px;padding:24px 43px; }
.eyebrow { margin: 0 0 7px; color: #708089; font-size: 9px; font-weight: 800; letter-spacing: .11em; }
h1, h2 { font-family: Georgia, 'Times New Roman', serif; font-weight: 600; }
h1 { margin: 0; font-size: 31px; letter-spacing: -.025em; }
.subtitle { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-button { width: 38px; height: 38px; border: 1px solid #d6e0e2; border-radius: 10px; background: var(--white); color: #8ca0a7; font-size: 9px; }
.primary-action { border: 0; border-radius: 9px; background: var(--teal); color: var(--white); padding: 11px 16px; font-size: 11px; font-weight: 800; box-shadow: 0 5px 15px rgba(23,123,131,.18); }
.primary-action:hover { background: var(--teal-dark); }
.primary-action span { margin-right: 5px; font-size: 15px; }
.primary-action:disabled{border:1px solid #bdc9cf!important;background:#d8e0e4!important;color:#66757c!important;box-shadow:none!important;cursor:not-allowed;filter:grayscale(1);opacity:1}.primary-action:disabled:hover{background:#d8e0e4!important}.quick-card.action-disabled{cursor:not-allowed;filter:grayscale(.35);opacity:.62}.quick-card.action-disabled:hover{transform:none;box-shadow:none}.quick-card.action-disabled button{cursor:not-allowed}
.visit-result.validating{opacity:.68;cursor:wait}.visit-validation-error{display:grid;gap:5px;margin:10px 0 0;padding:13px 15px;border:1px solid #e6b5b5;border-radius:10px;background:#fff3f3;color:#8b3030}.visit-validation-error strong,.visit-validation-error span{display:block}.visit-validation-error span{font-size:12px;line-height:1.45}
.menu-button { display: none; }

.quick-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 14px; margin: 29px 0 18px; }
.quick-grid.compact { grid-template-columns: 1.15fr .85fr; }
.quick-grid:has(.agenda-card[hidden]) { grid-template-columns: 1.15fr 1fr; }
.quick-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) 30px; gap: 13px; align-items: center; min-height: 116px; padding: 18px; border: 1px solid #dde6e8; border-radius: 13px; background: var(--white); box-shadow: 0 4px 18px rgba(29,54,63,.04); }
.quick-card.featured { border-color: #83b8bc; background: linear-gradient(135deg, #f8ffff, #eef8f8); }
.quick-card > div:nth-child(2) > span { color: #75868d; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.quick-card h2 { margin: 5px 0; font-family: Arial, sans-serif; font-size: 13px; font-weight: 800; }
.quick-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.quick-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 11px; background: #dceff0; color: var(--teal); font-size: 22px; font-weight: 700; }
.quick-icon.soft { background: #e8eef6; color: #557299; }.quick-icon.warm { background: #f9efd8; color: #987022; }
.quick-card > button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #eef3f4; color: #577078; }
.quick-card.featured > button { background: var(--teal); color: var(--white); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(260px, .75fr); gap: 18px; }
.dashboard-grid.summary-only { grid-template-columns: minmax(0, 1fr); }
.dashboard-grid.summary-only .right-column { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
.dashboard-grid.summary-only .summary-panel,
.dashboard-grid.summary-only .help-card { min-height: 100%; }
.panel { border: 1px solid #dfe7e8; border-radius: 14px; background: var(--white); box-shadow: 0 4px 18px rgba(29,54,63,.035); }
.recent-panel { padding: 22px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; }
.panel h2 { margin: 0; font-size: 19px; }
.panel-header > button { border: 0; background: none; color: var(--teal); font-size: 10px; font-weight: 800; }
.search-box { display: flex; align-items: center; gap: 9px; margin: 18px 0 8px; padding: 10px 12px; border: 1px solid #d9e2e4; border-radius: 9px; color: #75868e; background: #fbfcfc; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 10px; }
.search-box.large { margin: 21px 0; padding: 13px; background: var(--white); }
.patient-list { display: grid; }
.patient-row { display: grid; grid-template-columns: 37px minmax(0, 1fr) 20px; gap: 12px; align-items: center; width: 100%; padding: 12px 4px; border: 0; border-bottom: 1px solid #edf1f2; background: none; text-align: left; }
.patient-row:hover { background: #f6f9f9; }
.patient-row:last-child { border-bottom: 0; }
.patient-row strong, .patient-row small { display: block; }.patient-row strong { font-size: 11px; }.patient-row small { margin-top: 4px; color: #7a898f; font-size: 9px; }
.patient-row i { color: #8ba0a6; font-style: normal; }
.patient-avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; font-size: 9px; font-weight: 800; }
.patient-avatar.blue{background:#e2f0f6;color:#2c7591}.patient-avatar.green{background:#e2f2eb;color:#327c61}.patient-avatar.violet{background:#eee9f5;color:#755b98}.patient-avatar.sand{background:#f8edd7;color:#916d2d}
.empty-state { padding: 25px; text-align: center; color: var(--muted); font-size: 11px; }
.right-column { display: grid; gap: 14px; align-content: start; }
.summary-panel { padding: 20px; }
.summary-panel header { margin-bottom: 8px; }
.metric { display: grid; grid-template-columns: 35px 1fr auto; gap: 10px; align-items: center; padding: 13px 0; border-bottom: 1px solid #edf1f2; }
.metric:last-child { border-bottom: 0; }.metric-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; font-size: 13px; }.metric-icon.blue{background:#e5f2f6;color:#237795}.metric-icon.green{background:#e3f3ec;color:#2e8061}.metric-icon.violet{background:#eee9f6;color:#715795}
.metric strong, .metric small { display: block; }.metric strong { font-family: Georgia, serif; font-size: 17px; }.metric small { margin-top: 2px; color: var(--muted); font-size: 8px; }.metric em { color: #2a8a67; font-size: 8px; font-style: normal; font-weight: 800; }
.help-card { padding: 21px; overflow: hidden; border-radius: 14px; background: var(--navy-soft); color: var(--white); }
.help-card > span { color: #acd0d5; font-size: 8px; font-weight: 800; letter-spacing: .1em; }.help-card h2 { margin: 8px 0; font-size: 17px; }.help-card p { color: #bdd0d5; font-size: 9px; line-height: 1.5; }.help-card button { margin-top: 5px; border: 1px solid rgba(255,255,255,.35); border-radius: 7px; background: transparent; color: var(--white); padding: 8px 10px; font-size: 9px; font-weight: 700; }
.osuthgra-product .help-card-contact{position:relative;isolation:isolate;padding:26px 27px 25px;border:1px solid rgba(67,211,232,.38);background:linear-gradient(135deg,#09283e 0%,#0d5068 58%,#008eae 100%);box-shadow:0 18px 42px rgba(7,54,75,.2);transition:transform .2s ease,box-shadow .2s ease}.osuthgra-product .help-card-contact:before,.osuthgra-product .help-card-contact:after{content:"";position:absolute;z-index:-1;border-radius:50%;background:rgba(255,255,255,.07)}.osuthgra-product .help-card-contact:before{width:160px;height:160px;right:-55px;top:-80px}.osuthgra-product .help-card-contact:after{width:95px;height:95px;right:70px;bottom:-65px}.osuthgra-product .help-card-contact:hover{transform:translateY(-2px);box-shadow:0 22px 48px rgba(7,54,75,.27)}.osuthgra-product .help-card-icon{position:absolute;right:24px;top:22px;display:grid;place-items:center;width:42px;height:42px;border:1px solid rgba(255,255,255,.28);border-radius:14px;background:rgba(255,255,255,.13);font:700 22px Georgia,serif;color:#fff}.osuthgra-product .help-card-contact>span{color:#7ee5f2;font-size:9px}.osuthgra-product .help-card-contact h2{max-width:78%;margin:10px 0 9px;font:700 22px/1.12 Georgia,serif}.osuthgra-product .help-card-contact p{max-width:92%;margin:0;color:#d4edf2;font-size:11px;line-height:1.55}.help-card-tags{display:flex;flex-wrap:wrap;gap:6px;margin:15px 0 13px}.help-card-tags small{padding:5px 8px;border:1px solid rgba(255,255,255,.2);border-radius:999px;background:rgba(255,255,255,.08);color:#dff6f8;font-size:8px;font-weight:700}.osuthgra-product .help-card-contact button{display:flex;align-items:center;justify-content:space-between;width:100%;margin-top:0;padding:11px 13px;border:0;border-radius:9px;background:#fff;color:#07566d;font-size:10px;box-shadow:0 8px 18px rgba(0,0,0,.13);cursor:pointer}.osuthgra-product .help-card-contact button b{font-size:15px}.osuthgra-product .nav-item[href*="mod_soporte"]{margin-top:8px;border:1px solid rgba(83,211,228,.22);background:rgba(11,143,176,.11);color:#bfeef4}.osuthgra-product .nav-item[href*="mod_soporte"]:hover,.osuthgra-product .nav-item[href*="mod_soporte"].active{background:#0b7897;color:#fff}

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(6,27,36,.48); backdrop-filter: blur(3px); }
.modal { position: relative; width: min(510px, 100%); padding: 30px; border-radius: 16px; background: var(--canvas); box-shadow: 0 25px 70px rgba(4,23,31,.25); }
.modal h2 { margin: 0; font-size: 25px; }.modal > p:not(.eyebrow) { color: var(--muted); font-size: 11px; line-height: 1.55; }
.modal-close { position: absolute; top: 15px; right: 17px; width: 31px; height: 31px; border: 0; border-radius: 50%; background: #e4ebec; color: #43565e; font-size: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; }
.wide-modal { width: min(720px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; }
.module-form { margin-top: 18px; }
.form-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.module-form label { display: grid; gap: 6px; color: #40545c; font-size: 10px; font-weight: 800; }
.module-form input,.module-form select,.module-form textarea { width: 100%; box-sizing: border-box; border: 1px solid #cfdbde; border-radius: 8px; background: #fff; padding: 11px 12px; color: #102b35; font: inherit; font-weight: 400; }
.module-form .field-help { color: var(--muted); font-size: 9px; font-weight: 500; line-height: 1.4; }
.module-form .field-help.important { color: #087f8c; font-weight: 800; }
.module-form > .modal-actions { margin-top: 20px; }
.module-form textarea { min-height: 90px; resize: vertical; }
.full-field { grid-column: 1 / -1; }
.form-error { margin: 12px 0; padding: 10px 12px; border-radius: 8px; background: #fff0ef; color: #9c3029 !important; }
.secondary-action { border: 1px solid #cddadd; border-radius: 9px; background: var(--white); color: #40545c; padding: 11px 14px; font-size: 10px; font-weight: 800; }
.visit-results { display: grid; gap: 7px; max-height: 210px; margin: 10px 0; overflow-y: auto; }
.visit-result { width: 100%; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid #d3dfe1; border-radius: 9px; background: #fff; color: var(--ink); text-align: left; }
.visit-result span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: #e2f0f2; color: var(--teal); font-weight: 800; }
.visit-result strong,.visit-result small { display: block; }.visit-result small { margin-top: 3px; color: var(--muted); font-size: 8px; }.visit-result i { color: var(--teal); font-style: normal; }
.visit-results .empty-state { margin: 4px 0; padding: 10px; }

@media (max-width: 1030px) {
  .app { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 24px 10px 16px; }
  .brand { justify-content: center; padding: 0 0 22px; }.brand > div:last-child, .trial-card, .profile-mini > div:nth-child(2), .profile-mini > button { display: none; }
  .nav-item { justify-content: center; padding: 11px; font-size: 0; }.nav-item span { font-size: 18px; }
  .profile-mini { justify-content: center; padding: 13px 0 0; }
  .workspace { padding: 32px 25px; }
  .quick-grid, .quick-grid.compact, .quick-grid:has(.agenda-card[hidden]) { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .module-workspace>.persistent-greeting { margin:-24px -22px 24px;padding:20px 22px; }
  .clinical-workspace>.persistent-greeting { margin:-24px -24px 24px;padding:20px 24px; }
}
@media (max-width: 620px) { .form-columns { grid-template-columns: 1fr; }.full-field { grid-column: auto; } }

@media (max-width: 720px) {
  .workspace>.persistent-greeting,.module-workspace>.persistent-greeting,.clinical-workspace>.persistent-greeting { margin:-18px -14px 22px;padding:18px 14px;min-height:84px; }
  .persistent-greeting h1 { font-size:24px; }
  .app { display: block; }.sidebar { position: fixed; z-index: 12; left: -260px; width: 250px; padding: 24px 16px; transition: left .22s ease; }.menu-open .sidebar { left: 0; box-shadow: 12px 0 35px rgba(9,32,41,.25); }
  .brand { justify-content: flex-start; }.brand > div:last-child, .profile-mini > div:nth-child(2), .profile-mini > button { display: block; }.trial-card { display: block; }
  .nav-item { justify-content: flex-start; font-size: 13px; }.nav-item span { font-size: 17px; }
  .profile-mini { justify-content: flex-start; }.workspace { padding: 22px 15px; }.menu-button { display: block; width: 38px; height: 38px; border: 1px solid #d7e0e2; border-radius: 9px; background: var(--white); }
  .topbar { align-items: flex-start; }.topbar > div:nth-child(2) { flex: 1; }h1 { font-size: 24px; }.subtitle { display: none; }.icon-button { display: none; }.primary-action { padding: 10px; font-size: 0; }.primary-action span { margin: 0; font-size: 18px; }
  .quick-grid { margin-top: 22px; }.dashboard-grid { grid-template-columns: 1fr; }.recent-panel { padding: 17px; }.right-column, .dashboard-grid.summary-only .right-column { grid-template-columns: 1fr; }.modal-actions { flex-direction: column; }.modal-actions button { width: 100%; }
}

@media (min-width: 721px) and (max-width: 1030px) {
  .profile-mini .session-exit { display: flex; width: 38px; padding: 8px; font-size: 0; }
  .profile-mini .session-exit span { font-size: 15px; }
}

.osuthgra-product .nav-item[href*="mod_soporte"]{position:relative}.support-unread-badge{display:grid;place-items:center;min-width:20px;height:20px;margin-left:auto;padding:0 5px;border:2px solid #082137;border-radius:999px;background:#ffb52e;color:#102a39;font-size:9px!important;font-style:normal;font-weight:900;line-height:1;box-shadow:0 0 0 3px rgba(255,181,46,.13);animation:supportBadgePulse 1.8s ease-in-out infinite}.nav-item.active .support-unread-badge{border-color:#0b7897}.nav-item.has-unread{color:#fff!important}@keyframes supportBadgePulse{0%,100%{transform:scale(1)}50%{transform:scale(1.1);box-shadow:0 0 0 6px rgba(255,181,46,.08)}}@media(max-width:1030px) and (min-width:721px){.support-unread-badge{position:absolute;right:5px;top:4px;min-width:18px;height:18px;margin:0;padding:0 4px}}

