/* =====================================================
   PORTAL HOSPITAL — Stylesheet Consolidado
   Todas las reglas scopeadas bajo .ph-scope para
   no afectar otras vistas que usan el mismo layout.
   ===================================================== */

/* ----- Design Tokens ----- */
:root {
    --ph-blue:       #02395e;
    --ph-gold:       #ad8411;
    --ph-gold-dark:  #8a6810;
    --ph-teal:       #1cb2c1;
    --ph-red:        #f44336;
    --ph-green:      #3cb371;
    --ph-yellow:     #fdd400;
    --ph-orange:     orangered;
    --ph-gray-light: #eaeaec;
    --ph-muted:      #7f7f7f;
    --ph-font:       'Poppins', 'Inter', system-ui, sans-serif;
}

/* =====================================================
   GLOBAL RESETS within .ph-scope
   ===================================================== */
.ph-scope hr {
    border-color: #c8c4bc;
    opacity: 1;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* =====================================================
   BREADCRUMB / MIGA
   ===================================================== */
.ph-scope .miga {
    min-height: 34px;
    background-color: var(--ph-gold);
    border-radius: 25px;
    padding: 10px 20px;
    line-height: 19px;
    font-size: 16px;
    font-family: var(--ph-font);
    font-weight: 400;
    position: relative;
    margin: 20px 0;
}
.ph-scope .miga a,
.ph-scope .miga span {
    color: #000;
    font-size: 16px;
}
.ph-scope .miga .ph-miga-active {
    font-weight: 600;
}

/* =====================================================
   CABECERA — Header area
   ===================================================== */
.ph-scope .ph-cabecera-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px 0;
}
.ph-scope .ph-cabecera-header h6 {
    margin: 0;
    color: var(--ph-muted);
}

/* =====================================================
   CABECERA PILL NAV
   ===================================================== */
.ph-scope .ph-nav-container {
    border-radius: 20px;
    background-color: var(--ph-gray-light);
    text-align: left;
    padding: 8px 12px;
    margin-bottom: 8px;
}
.ph-scope .ph-nav-container .nav-pills {
    font-weight: bold;
    flex-wrap: wrap;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}
.ph-scope .liCabecera {
    display: flex !important;
    align-items: center;
    height: 40px;
}
.ph-scope .liCabecera > a {
    font-size: 15px !important;
    color: #333;
    padding: 5px 12px;
    border-radius: 20px;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}
.ph-scope .liCabecera > a:hover {
    background-color: var(--ph-gold);
    color: #fff !important;
}
.ph-scope .nav-pills li.active > a,
.ph-scope .nav-pills li.active > a:hover,
.ph-scope .nav-pills li.active > a:focus {
    background-color: var(--ph-gold) !important;
    color: #fff !important;
    border-radius: 20px;
}
.ph-scope .inactiveLink {
    pointer-events: none;
    cursor: default;
}

/* =====================================================
   HOSPITAL DETALLE — Tab Nav Pills
   ===================================================== */
.ph-scope .card .nav-pills {
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 500;
}
.ph-scope .card .nav-pills li > a {
    font-size: 16px !important;
    color: #333;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}
.ph-scope .card .nav-pills li > a:hover {
    background-color: rgba(173, 132, 17, 0.15);
    color: var(--ph-gold) !important;
}
.ph-scope .card .nav-pills li.active {
    background: var(--ph-gold) !important;
    border-radius: 20px;
    padding: 2px !important;
}
.ph-scope .card .nav-pills li.active > a,
.ph-scope .card .nav-pills li.active > a:hover,
.ph-scope .card .nav-pills li.active > a:focus {
    color: #fff !important;
}
.ph-scope .card .nav-pills .nav-link.active,
.ph-scope .card .nav-pills .nav-link.active:hover,
.ph-scope .card .nav-pills .nav-link.active:focus {
    background-color: var(--ph-gold) !important;
    color: #fff !important;
    border-radius: 20px;
}

/* =====================================================
   TABLES
   ===================================================== */

/* Make all table containers scrollable so wide tables don't clip */
.ph-scope div:has(> table.table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ph-scope .ph-table > thead,
.ph-scope .ph-table > thead tr {
    background-color: var(--ph-blue);
    color: white;
}
.ph-scope .ph-table > thead th,
.ph-scope .ph-table > thead td {
    text-align: center;
    vertical-align: middle !important;
    color: white;
}
.ph-scope .ph-table tbody tr td {
    vertical-align: middle;
}

/* Criteria table: light header */
.ph-scope .ph-table-criteria > thead {
    background: initial;
    border-top: 2px solid #ddd;
    color: black;
}
.ph-scope .ph-table-criteria > thead th {
    color: black;
    font-size: 14px;
}

/* Teal header variant (Recomendaciones) */
.ph-scope .ph-table-teal > thead,
.ph-scope .ph-table-teal > thead tr {
    background-color: #29ABE2;
    color: white;
}
.ph-scope .ph-table-teal > thead th {
    color: white;
}

/* Gold header variant (ComprasDetalle parciales) */
.ph-scope .ph-table-gold > thead,
.ph-scope .ph-table-gold > thead tr {
    background-color: var(--ph-gold);
    color: white;
}
.ph-scope .ph-table-gold > thead th,
.ph-scope .ph-table-gold > thead td {
    color: white;
    text-align: center;
}

/* Highlighted cell (existencia total) */
.ph-scope .ph-cell-highlight {
    background-color: #faf5e8;
    text-align: center;
}

/* =====================================================
   MODALS
   ===================================================== */
.ph-scope .modal-header {
    background-color: var(--ph-gold) !important;
    color: white;
}
.ph-scope .modal-header h4,
.ph-scope .modal-header h5,
.ph-scope .modal-header .modal-title {
    color: white !important;
}
.ph-scope .modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}
.ph-scope .modal .close {
    color: white !important;
}

/* Wide modal override — replaces width:140%/right:15% hacks */
.ph-scope .ph-modal-wide .modal-dialog {
    max-width: 85vw;
}
.ph-scope .ph-modal-wider .modal-dialog {
    max-width: 92vw;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.ph-scope .btn-primary {
    background-color: var(--ph-gold) !important;
    border-color: var(--ph-gold-dark) !important;
    color: #fff !important;
    background-clip: padding-box;
}
.ph-scope .btn-primary:hover,
.ph-scope .btn-primary:focus {
    background-color: var(--ph-teal) !important;
    border-color: var(--ph-teal) !important;
}

/* =====================================================
   ICONS (Bootstrap Icons)
   ===================================================== */
.ph-scope .bi {
    color: #000;
}
.ph-scope .bi:hover {
    color: var(--ph-gold);
}
.ph-scope .ph-icon-muted {
    font-size: 15px;
    margin-right: 15px;
    color: var(--ph-muted);
}

/* =====================================================
   GOLD LINKS & TEXT
   ===================================================== */
.ph-scope .ph-gold-link {
    color: var(--ph-gold);
}
.ph-scope .ph-gold-link:hover {
    color: var(--ph-gold-dark) !important;
}
.ph-scope .ph-gold-text {
    color: var(--ph-gold) !important;
}

/* =====================================================
   CARD SECTION HEADERS (Perfil pattern)
   ===================================================== */
.ph-scope .parrafoHeader {
    font-size: 17px;
    border-bottom: 1px solid var(--ph-muted);
    margin: 0 20px;
    padding-top: 8px;
    padding-bottom: 1px;
    color: var(--ph-gold);
    font-weight: 600;
}
.ph-scope .parrafo {
    font-size: 14px;
    margin-bottom: 0;
    font-weight: bold;
    padding-top: 3px;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--ph-muted);
    color: var(--ph-muted);
}
.ph-scope .parrafo.no-border {
    border-bottom: none;
}
.ph-scope .parrafo > span {
    color: black;
}

/* =====================================================
   TYPOGRAPHY — Titles
   ===================================================== */
.ph-scope .tituloFuerza {
    text-align: left;
    font-size: 21px;
    border-bottom: 1px solid var(--ph-muted);
    color: var(--ph-gold);
    margin-top: 10px;
    font-weight: 600;
    padding-bottom: 5px;
    margin-bottom: 15px;
    padding-left: 2px;
}
.ph-scope .ph-hospital-name {
    margin: 0 12px;
    color: var(--ph-gold);
    font-size: 23px;
    font-weight: 500;
    padding-top: 20px;
    padding-bottom: 0;
}
.ph-scope bold,
.ph-scope .ph-bold {
    font-size: 16px;
    font-weight: bold;
}
.ph-scope .form-label {
    font-size: 15px;
}
.ph-scope .ph-muted-text {
    color: var(--ph-muted);
}

/* Stat number (Perfil inventory counts) */
.ph-scope .ph-stat-number {
    color: black;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* =====================================================
   SUPPLY PERCENTAGE COLORS
   ===================================================== */
.ph-scope .ph-supply-low {
    color: var(--ph-orange) !important;
    font-weight: bold;
}
.ph-scope .ph-supply-mid {
    color: var(--ph-yellow) !important;
    font-weight: bold;
}
.ph-scope .ph-supply-high {
    color: var(--ph-green) !important;
    font-weight: bold;
}

/* Supply value typography */
.ph-scope .ph-supply-value {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* =====================================================
   SUPPLY BADGES (Perfil inventario counts)
   ===================================================== */
.ph-scope .ph-badge-supply {
    margin: 0 auto;
    border-radius: 4px;
    font-weight: 600;
    width: 75px;
    text-align: center;
    font-size: 16px;
    color: white;
    display: block;
}
.ph-scope .ph-badge-supply.abastecido {
    background: var(--ph-green);
}
.ph-scope .ph-badge-supply.desabastecido {
    background: #cb171e;
}

/* =====================================================
   IMAGES — Director & Hospital photos
   ===================================================== */
.ph-scope .ph-director-photo {
    height: 150px;
    width: 150px;
    display: block;
    margin: 0 auto;
    border-radius: 50%;
    object-fit: cover;
}
.ph-scope .ph-hospital-photo {
    height: 150px;
    width: 250px;
    max-width: 250px;
    display: block;
    margin: 0 auto;
    object-fit: cover;
}

/* =====================================================
   FORM ELEMENTS
   ===================================================== */
.ph-scope .selectSL {
    padding: 0 12px;
    color: black;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #ccc;
    border-radius: 20px;
    height: 30px;
    outline: none;
    box-shadow: none;
    width: 100%;
}
.ph-scope select.selectSL {
    cursor: pointer;
}
.ph-scope input.selectSL {
    cursor: text;
}
.ph-scope .selectSL:focus {
    border-color: var(--ph-gold);
    box-shadow: 0 0 0 2px rgba(173, 132, 17, 0.25);
    outline: none;
}
.ph-scope .selectSty {
    width: 45px;
    margin-left: 5px;
}

/* =====================================================
   FILTER BAR (HospitalCriterios toolbar)
   ===================================================== */
.ph-scope .ph-filter-bar {
    background: var(--ph-gray-light);
    margin-bottom: 8px;
    margin-top: 10px;
    border-radius: 4px;
    padding: 10px;
}

/* Slider row (Abastecimiento months) */
.ph-scope .ph-slider-row {
    padding: 10px 3.6% 30px;
}

/* =====================================================
   CRITERIA DOT & CHECKMARK
   ===================================================== */
.ph-scope .dot {
    height: 22px;
    width: 22px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
}
.ph-scope .checkmark {
    width: 6px;
    height: 14px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    display: inline-block;
}

/* =====================================================
   RESET BUTTON (filter reset animation)
   ===================================================== */
.ph-scope .ph-reset-btn {
    background: none;
    border: 0;
    padding-top: 5px;
    outline: none;
    cursor: pointer;
}
.ph-scope #reset {
    transition: 0.50s;
    color: #4c4a4a;
    font-size: 18px;
    font-weight: bold;
}
.ph-scope #reset:hover {
    transform: rotate(180deg);
    color: var(--ph-blue);
}

/* =====================================================
   ERROR MESSAGES (Edit forms)
   ===================================================== */
.ph-scope #errorMessages {
    display: none;
    width: 75%;
    list-style-type: disc;
    margin: 0 10px 15px;
    padding: 8px 35px 8px 30px;
    color: #B94A48;
    background-color: #F2DEDE;
    border: 2px solid #EED3D7;
    border-radius: 4px;
}
.ph-scope #errorMessages span {
    font-weight: bold;
}

/* =====================================================
   JQUERY UI SORTABLE (HospitalDetalle Red)
   ===================================================== */
.ph-scope #sortable {
    list-style-type: none;
    margin: 0;
    padding: 0;
    width: 60%;
    cursor: move;
}
.ph-scope #sortable li {
    margin: 0 3px 3px 3px;
    padding: 0.4em 0.4em 0.4em 1.5em;
    font-size: 15px;
    position: relative;
}
.ph-scope #sortable li span {
    position: absolute;
    margin-left: -1.3em;
}

/* =====================================================
   ACCORDION (Abastecimiento hospital groups)
   ===================================================== */
.ph-scope .accordion .card-header {
    background-color: var(--ph-gold) !important;
    color: white !important;
}
.ph-scope .accordion .card-header a {
    color: white;
    text-decoration: none;
}
.ph-scope .accordion .card-header a:hover {
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none;
}

/* =====================================================
   GOLD LINKS (AmCharts openGraf)
   ===================================================== */
.ph-scope .openGraf {
    color: var(--ph-gold);
}
.ph-scope .openGraf:hover {
    color: var(--ph-gold-dark) !important;
}

/* =====================================================
   DATATABLES — Hide default search for custom
   ===================================================== */
.ph-scope #tbMD_filter,
.ph-scope #tbMD_filter input {
    display: none;
}
.ph-scope #tbMD_filter label {
    font-weight: bold;
}
.ph-scope #tblPar_length label {
    font-weight: bold;
}

/* =====================================================
   EDICION PERFIL (float right edit buttons)
   ===================================================== */
.ph-scope .edicionPerfil {
    float: right;
}

/* =====================================================
   AMCHARTS — Container heights
   ===================================================== */
.ph-scope #grafGeneral,
.ph-scope #grafVital,
.ph-scope #grafEsencial,
.ph-scope #grafNoEsencial {
    height: 200px;
}
.ph-scope #grafFinanciero {
    height: 450px;
}
.ph-scope #grafFisico {
    height: 350px;
}
.ph-scope #grafGantt {
    height: 200px;
    width: 100%;
}
.ph-scope #chartdiv {
    height: 500px;
}

/* =====================================================
   CENTRADO utility
   ===================================================== */
.ph-scope .centrado {
    text-align: center;
}

/* =====================================================
   SECTION TITLE (Config panel in HospitalDetalle)
   ===================================================== */
.ph-scope .ph-section-title {
    font-size: 17px;
    border-bottom: 1px solid black;
    padding-bottom: 8px;
    color: black;
    font-weight: 600;
    margin-bottom: 8px;
}

/* =====================================================
   COMPRAS DETALLE — Summary layout
   ===================================================== */
.ph-scope .ph-compra-summary {
    color: var(--ph-muted);
}
.ph-scope .ph-compra-summary .ph-gold-text {
    font-weight: bold;
}
.ph-scope .ph-collapse-bg {
    background-color: #f5f4f1;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .ph-scope .ph-nav-container .nav-pills {
        flex-direction: column;
    }
    .ph-scope .ph-nav-container .nav-pills li.liCabecera {
        height: auto;
        padding: 4px 0;
    }
    .ph-scope .miga {
        border-radius: 10px;
        padding-left: 12px;
    }
    .ph-scope .ph-cabecera-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}
@media (min-width: 1200px) {
    .ph-scope #imgHospital {
        width: 100% !important;
    }
}

/* --- Phase H-A: Consolidated h5 colors (from 9 view style blocks) --- */
.ph-scope h5 {
    color: steelblue;
}

/* --- Phase H-B: Text utilities (from Covid19, MaizCatracho, ProduccionQuirurgica) --- */
/* (use BS5 text-end / text-center / align-middle instead) */

/* --- Phase H-C: Chart heights (from tabGraficoHospital) --- */
.ph-scope #grafGeneralHosp,
.ph-scope #grafVitalHosp,
.ph-scope #grafEsencialHosp,
.ph-scope #grafNoEsencialHosp {
    height: 200px;
}
.ph-scope #grafFinancieroHosp {
    height: 350px;
}

/* --- Phase H-E: HospitalCriteriosDetalle classes --- */
.ph-scope .recomHead {
    text-align: center;
    background: #7F7F7F;
    color: white;
    font-size: 18px;
    margin-bottom: 0.5em;
}
.ph-scope .recomPar {
    font-size: 14px;
    margin-bottom: 0.25em;
}
.ph-scope .btnRecom {
    width: 300px;
    height: 40px;
    border-radius: 100px;
}
.ph-scope .tdbold {
    color: black;
    font-weight: bold;
}
.ph-scope .tdnone {
    font-weight: 400;
}
.ph-scope #criteriomed thead {
    font-size: 14px;
}

/* --- Phase H-D: Mapa.cshtml classes (moved from global style block) --- */
.ph-scope #chartMap {
    width: 100%;
    height: 500px;
}
.ph-scope #infoDinamico {
    display: none;
}
.ph-scope .parrafoHeader {
    font-size: 18px;
    margin: 0 20px;
    padding-bottom: 1px;
    color: black;
    font-weight: 600;
}
.ph-scope .parrafo {
    font-size: 14px;
    margin-bottom: 0;
    font-weight: bold;
    padding-top: 3px;
    padding-bottom: 3px;
    color: #7f7f7f;
}
.ph-scope .panelMap {
    margin-top: 0;
    padding-top: 0;
}

/* --- Phase H-F: AbastecimientoSemanalDetalle --- */
.ph-scope .dot {
    height: 35px;
    width: 35px;
    border-radius: 50%;
    display: inline-block;
    padding-top: 9px;
    font-size: 9px;
}
.ph-scope .rotar {
    font-size: 13px;
    font-weight: bold;
    color: #9a9a9a;
}
