*{box-sizing:border-box}body{margin:0;background:#f1f4fa;color:#24344d;font:16px system-ui,Arial}header{background:#084b98;color:white;border-bottom:6px solid #ffd329;padding:20px 5%;display:flex;justify-content:space-between;align-items:center;gap:20px;flex-wrap:wrap}.brand{font-size:30px;font-weight:800}.brand span{font-size:18px;margin-left:16px}nav,.actions,.toolbar,.search,.pagination{display:flex;align-items:center;gap:12px;flex-wrap:wrap}nav a{color:white}nav form{margin:0}main{max-width:1180px;margin:30px auto;padding:0 20px;min-height:70vh}h1{font-size:28px}h2{font-size:19px}.card{background:white;border:2px solid #4b5260;border-radius:12px;padding:24px;margin:22px 0;box-shadow:0 6px 20px #1232}.card h1,.card h2{background:#084b98;color:white;padding:14px;margin:-24px -24px 22px;border-radius:9px 9px 0 0}.auth{max-width:470px;margin:50px auto}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}.grid .card{margin:0}label{display:block;font-weight:600;margin-bottom:18px}input,select{font:inherit;width:100%;border:2px solid #606d80;border-radius:7px;padding:12px;margin-top:7px;background:white;color:#24344d}input:focus,select:focus,a:focus,button:focus{outline:3px solid #e5b900;outline-offset:3px}button,.button{display:inline-block;background:#ffd329;color:#102e55;border:2px solid #b18b00;border-radius:7px;padding:11px 18px;font:600 15px system-ui;text-decoration:none;cursor:pointer}button:hover,.button:hover{filter:brightness(.94)}.secondary{background:#e8f0ff;border-color:#084b98;color:#084b98;padding:7px 12px}.light{background:white;border-color:white}.toolbar{justify-content:space-between}.search input{flex:1;min-width:240px;margin:0}.notice{background:#fff3b5;border:2px solid #e6ba00;border-left:7px solid #084b98;padding:16px;border-radius:8px;margin:18px 0}.error{border-color:#b53b3b}small{display:block;font-size:13px;font-weight:400;margin-top:6px;color:#506078}.check{display:flex;align-items:center;gap:10px;margin-top:24px}.check input{width:22px;height:22px;margin:0}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;text-align:left}th{background:#084b98;color:white}td,th{padding:14px;border-bottom:1px solid #ccd5e2}.badge{border-radius:20px;padding:5px 10px;font-size:13px;font-weight:700}.active{background:#d7f0e0;color:#14592e}.inactive{background:#f5d7d7;color:#8a2121}.pagination{justify-content:center;margin-top:24px}.number{font-size:48px;color:#084b98}.identity{text-align:right;font-size:14px;color:#52627a}a{color:#084b98}footer{text-align:center;padding:25px;color:#607087}@media(max-width:700px){.grid{grid-template-columns:1fr}header{padding:16px}.brand span{display:block;margin:0}.card{padding:18px}.card h1,.card h2{margin:-18px -18px 20px}nav{gap:10px}}

.services{grid-template-columns:repeat(3,minmax(0,1fr))}.services .service{display:block;text-decoration:none;margin:0;border-top:5px solid #ffd329}.service:hover{box-shadow:0 8px 24px #084b9833}.service h2{min-height:76px;display:flex;align-items:center}.service>span{font-weight:700}.services p{color:#52627a}@media(max-width:950px){.services{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.services{grid-template-columns:1fr}}

.hcd-logo{width:52px;height:52px;object-fit:contain;background:#fff;border-radius:50%;padding:5px;flex-shrink:0;display:block}@media(max-width:650px){.hcd-logo{width:44px;height:44px}}

.brand{display:flex;align-items:center;gap:14px}.brand span{margin:0;font-size:20px}.brand small{display:block;font-size:14px;font-weight:400}

header .hcd-logo{width:52px;height:52px;max-width:52px;max-height:52px;border-radius:50%;background:#fff;object-fit:contain;padding:5px}@media(max-width:650px){header .hcd-logo{width:44px;height:44px;max-width:44px;max-height:44px}}

.queue-list,.screen-list{display:grid;gap:12px}
.queue-list{grid-template-columns:repeat(auto-fit,minmax(min(100%,245px),1fr))}
.queue-turn{display:grid;gap:6px;background:#eef4fc;color:#163451;border:1px solid #c9daee;border-radius:12px;padding:14px;overflow-wrap:anywhere}
.queue-turn button{width:100%;margin-top:8px}
.queue-code{font-size:2rem;color:#0a4f93;line-height:1}
.screen-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
.screen-list{grid-template-columns:repeat(2,minmax(0,1fr))}
.screen-list .queue-code{font-size:clamp(1.6rem,4vw,3.4rem)}
.screen-list small{color:#3c5874}
.waiting-screen{margin:0 auto}
@media(max-width:700px){.screen-columns{grid-template-columns:1fr}}

.report-heading{display:flex;align-items:center;gap:20px;border-bottom:3px solid #e8bb22;padding:12px 0}
.report-heading img{width:76px;height:76px;object-fit:contain}
.report .report-heading h1{margin:.15em 0;padding:10px 14px;border-radius:8px;background:#084b98;color:#fff;line-height:1.2;font-size:clamp(1.15rem,3vw,1.75rem)}
.report-heading p{margin:.25em 0}
.report-filters{margin:20px 0}
.report-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px;margin:18px 0}
.report-summary div{background:#e9f1fb;padding:12px;border-radius:8px}
.report-summary strong,.report-summary span{display:block}
.report-summary strong{color:#104c83;font-size:1.45rem}
.report-group h2{border-left:5px solid #e8bb22;padding-left:10px;margin-top:24px}
.report td,.report th{overflow-wrap:anywhere}
#user-category[hidden]{display:none}
@media print{
  @page{size:landscape;margin:12mm}
  body{background:white;color:#101820}
  body>header,body>footer,.report-filters,.identity{display:none!important}
  body>main{padding:0;margin:0;max-width:none}
  .report{border:0;box-shadow:none;padding:0;margin:0;font-size:10pt}
  .report-heading img{width:52px;height:52px}
  .report .report-heading h1{background:transparent;color:#103b67;font-size:17pt;padding:0}
  .report-group h2{break-after:avoid;font-size:13pt}
  .report table{width:100%;min-width:0}
  .report thead{display:table-header-group}
  .report tr{break-inside:avoid}
  .report td,.report th{padding:5px}
  .report .table-wrap{overflow:visible}
  .report-summary div{border:1px solid #a5b8ca}
}

.turn-alerts{position:fixed;z-index:1000;top:clamp(12px,10vh,90px);right:16px;width:min(380px,calc(100vw - 32px));display:grid;gap:8px;pointer-events:none}
.turn-alert{pointer-events:auto;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#0b4f82;color:white;border-left:6px solid #ffc400;border-radius:10px;padding:14px;box-shadow:0 8px 26px #17365150}
.turn-alert strong{display:block;font-size:1.2rem}.turn-alert button{flex:none;padding:5px 10px;min-width:36px}
[data-queue-action-status]:empty{display:none}

.consultation-dialog{width:min(600px,calc(100% - 28px));max-height:calc(100dvh - 28px);overflow:auto;border:2px solid #0b4f82;border-radius:14px;padding:clamp(16px,4vw,28px);color:#17345a;box-shadow:0 16px 54px #10335555}
.consultation-dialog::backdrop{background:#132946aa}
.consultation-dialog h2{margin-top:0}
.consultation-clock{display:grid;gap:4px;background:#e9f1fb;border-radius:10px;padding:14px;text-align:center}
.consultation-clock time{font-size:clamp(2rem,8vw,3.5rem);color:#0b4f82;font-weight:800;font-variant-numeric:tabular-nums}
.consultation-details{display:grid;grid-template-columns:minmax(85px,1fr) minmax(0,2fr);gap:8px 12px}
.consultation-details dt{font-weight:700}.consultation-details dd{margin:0;overflow-wrap:anywhere}
.consultation-dialog button{width:100%}
[data-consultation-status]:empty{display:none}

button[data-install-app][hidden]{display:none!important}
.screen-page>header{padding:8px 2%;gap:8px}
.screen-page .brand small,.screen-page>footer{display:none}
.screen-page>main{max-width:none;margin:10px auto;padding:0 clamp(8px,2vw,24px);min-height:0}
.screen-page .waiting-screen{padding:12px}
.waiting-screen .toolbar{gap:8px;margin:0}
.waiting-screen .toolbar h1{margin:0;padding:8px 12px;border-radius:8px;font-size:clamp(1.1rem,2.5vw,1.7rem)}
.waiting-screen [data-queue-status]{margin:8px 0;color:#3c5874;font-size:.9rem}
.waiting-screen .screen-columns{grid-template-columns:minmax(0,1fr) minmax(0,3fr);gap:12px}
.waiting-screen .screen-columns h2{margin:0 0 8px;padding:8px 10px;border-radius:7px;font-size:clamp(0.95rem,2vw,1.15rem)}
.waiting-screen .screen-list{--screen-cols:4;--screen-card-height:86px;grid-template-columns:repeat(var(--screen-cols), minmax(0,1fr));gap:8px}
.waiting-screen [data-in-progress]{--screen-cols:1}
.waiting-screen .queue-turn{height:var(--screen-card-height);padding:6px 9px;gap:2px;border-radius:8px;grid-template-rows:auto minmax(14px,1fr) auto;align-items:center}
.waiting-screen .queue-code{font-size:clamp(1.4rem,3.6vw,2.35rem)}
.waiting-screen .queue-turn span{line-height:1.08;font-size:clamp(.72rem,1.4vw,.92rem)}
.waiting-screen .queue-turn small{font-size:.73rem;margin:0}
@media(max-width:900px){.waiting-screen [data-queue-list]{--screen-cols:3}}
@media(max-width:640px){.waiting-screen .screen-columns{grid-template-columns:1fr}.waiting-screen .screen-list,.waiting-screen [data-in-progress]{--screen-cols:2}}

.tv-colored [data-service="ingresos"]{--turn-bg:#e2effd;--turn-accent:#2e6da4}
.tv-colored [data-service="orientacion"]{--turn-bg:#e5f3e0;--turn-accent:#49763c}
.tv-colored [data-service="psicologia"]{--turn-bg:#eee5f9;--turn-accent:#74489c}
.tv-colored [data-service="psiquiatria"]{--turn-bg:#fbe5ee;--turn-accent:#a1416a}
.tv-colored [data-service="analisis"]{--turn-bg:#ffe9dc;--turn-accent:#a14f27}
.tv-colored [data-service="direccion"]{--turn-bg:#e1f2f1;--turn-accent:#297675}
.tv-colored .tv-legend{display:flex;flex-wrap:wrap;gap:7px 9px;padding:0;margin:0 0 12px;list-style:none}
.tv-colored .tv-legend li{display:flex;align-items:center;gap:7px;border:1px solid #cbd7e2;border-radius:20px;padding:4px 10px;background:var(--turn-bg,#eef4fc);color:#172f46;font-size:clamp(.72rem,1.25vw,.91rem);font-weight:650}
.tv-colored .tv-legend li strong{flex:none;min-width:.85em;color:var(--turn-accent,#365d81);font-size:1.25em;line-height:1;text-align:center;font-weight:850}
.tv-colored .waiting-screen .screen-columns h2{font-size:clamp(1.15rem,2vw,1.5rem);font-weight:800}
.tv-colored .waiting-screen .queue-turn[data-service]{background:var(--turn-bg,#eef4fc);border-left:5px solid var(--turn-accent,#52789e);color:#142d44}
.tv-colored .waiting-screen .queue-code{color:#0b3158}

.tv-colored .waiting-screen .tv-state-en_atencion h2{background:#197148;color:#fff}
.tv-colored .waiting-screen .tv-state-espera h2{background:#ffd329;color:#102e55}

.tv-colored{min-height:100vh;display:flex;flex-direction:column}
.tv-colored>main{display:flex;flex:1 0 auto;flex-direction:column;width:100%;gap:10px}
.tv-institutional{display:grid;margin-top:auto;background:#203784;color:#fff;border-radius:12px;padding:clamp(10px,1.7vw,24px) clamp(14px,3vw,50px)}
.tv-institutional-slide{grid-area:1 / 1;display:grid;grid-template-columns:minmax(100px,22%) minmax(0,1fr);align-items:center;gap:clamp(12px,3vw,48px);opacity:0;visibility:hidden;transition:opacity .65s ease,visibility 0s linear .65s}
.tv-institutional-slide.is-visible{opacity:1;visibility:visible;transition:opacity .65s ease}
.tv-institutional-slide h2{margin:0;color:#ffdf48;font-size:clamp(1.25rem,3vw,2.5rem);font-weight:850}
.tv-institutional-slide p,.tv-institutional-slide ul{margin:0;font-size:clamp(.85rem,1.45vw,1.25rem);line-height:1.45}
.tv-institutional-slide ul{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 20px;padding-inline-start:20px}
@media(max-width:520px){
    .tv-institutional-slide{grid-template-columns:1fr;gap:6px}
    .tv-institutional-slide ul{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){.tv-institutional-slide,.tv-institutional-slide.is-visible{transition:none}}

.tv-colored>main{padding-inline:clamp(8px,1.6vw,24px)}
.tv-colored .waiting-screen{width:100%;margin-inline:0}
.tv-colored .waiting-screen .screen-list{--screen-card-height:74px}
.tv-colored .waiting-screen .queue-turn{grid-template-rows:auto minmax(14px,1fr)}
.tv-clock{display:flex;align-items:center;gap:9px;margin-left:auto;color:#103c66;font-size:clamp(.85rem,1.6vw,1.18rem);font-weight:750;white-space:nowrap;font-variant-numeric:tabular-nums}
.tv-clock time+time{border-left:1px solid #c4d2df;padding-left:9px}
.tv-colored .tv-is-fullscreen .toolbar{padding-right:14px}
.tv-is-fullscreen .tv-fullscreen-control{position:fixed;top:0;right:0;z-index:10;min-width:210px;min-height:60px;display:flex;align-items:flex-start;justify-content:flex-end;padding:8px}
.tv-is-fullscreen .tv-fullscreen-control button{opacity:0;transition:opacity .2s ease}
.tv-is-fullscreen.tv-control-ready .tv-fullscreen-control:hover button,
.tv-is-fullscreen .tv-fullscreen-control button:focus-visible{opacity:1}
@media(max-width:640px){.tv-clock{margin-left:0}}

.tv-colored>.tv-topbar{padding:6px clamp(10px,2vw,26px);border-bottom-width:4px;gap:8px 14px}
.tv-topbar .brand{gap:8px}
.tv-topbar .brand .hcd-logo{width:36px;height:36px;max-width:36px;max-height:36px;padding:4px}
.tv-topbar .brand span{font-size:clamp(.84rem,1.35vw,1.1rem)}
.tv-topbar h1{margin:0;font-size:clamp(1.05rem,2vw,1.55rem);line-height:1.15}
.tv-topbar .tv-clock{color:#fff}
.tv-topbar .tv-clock time+time{border-left-color:#a4bddc}
.tv-topbar .tv-fullscreen-control button{padding:5px 10px;font-size:.8rem}
.tv-queue-meta{display:flex;align-items:center;justify-content:space-between;gap:5px 10px;flex-wrap:wrap;margin-bottom:8px}
.tv-colored .tv-queue-meta .tv-legend{margin:0}
.tv-colored .tv-queue-meta [data-queue-status]{margin:0;font-size:.83rem}
@media(min-width:760px) and (orientation:landscape){
    .tv-colored .waiting-screen .screen-columns{grid-template-columns:minmax(0,1fr) minmax(0,2.6fr)}
    .tv-colored .waiting-screen [data-in-progress]{--screen-cols:2}
}
@media(min-width:760px) and (max-height:600px) and (orientation:landscape){
    .tv-colored>main{margin:6px auto;gap:6px}
    .tv-colored .waiting-screen{padding:8px}
    .tv-colored .waiting-screen .screen-list{--screen-card-height:57px;gap:6px}
    .tv-colored .waiting-screen .queue-turn{padding:4px 7px}
    .tv-colored .waiting-screen .queue-code{font-size:clamp(1.35rem,3vw,1.95rem)}
    .tv-colored .waiting-screen .screen-columns h2{margin-bottom:5px;padding:4px 8px;font-size:1.13rem}
    .tv-colored .tv-legend li{padding:2px 7px;font-size:.75rem}
    .tv-colored .tv-institutional{padding:8px 16px}
    .tv-colored .tv-institutional-slide{grid-template-columns:minmax(75px,15%) minmax(0,1fr);gap:12px}
    .tv-colored .tv-institutional-slide p,.tv-colored .tv-institutional-slide ul{font-size:clamp(.8rem,1.4vw,1rem);line-height:1.3}
    .tv-colored .tv-institutional-slide ul{grid-template-columns:repeat(3,minmax(0,1fr))}
}

.tv-colored .waiting-screen .screen-columns{grid-template-columns:minmax(0,1fr);gap:10px}
.tv-colored .waiting-screen [data-in-progress]{--screen-cols:3;--screen-card-height:70px}
.tv-colored .waiting-screen [data-queue-list]{--screen-cols:4;--screen-card-height:110px}
.tv-colored .waiting-screen [data-queue-list] .queue-code{font-size:clamp(1.9rem,4.9vw,3.4rem)}
.tv-colored .waiting-screen [data-queue-list] .queue-turn{padding:9px 14px}
.tv-colored .waiting-screen [data-queue-list] .queue-turn span{font-size:clamp(.88rem,1.55vw,1.15rem)}
@media(max-height:600px) and (orientation:landscape){
    .tv-colored .waiting-screen [data-in-progress]{--screen-card-height:58px}
    .tv-colored .waiting-screen [data-queue-list]{--screen-card-height:82px}
    .tv-colored .waiting-screen [data-queue-list] .queue-code{font-size:clamp(1.65rem,4.1vw,2.8rem)}
    .tv-colored .waiting-screen [data-queue-list] .queue-turn{padding:5px 10px}
}
@media(max-width:640px){
    .tv-colored .waiting-screen [data-in-progress],.tv-colored .waiting-screen [data-queue-list]{--screen-cols:2}
}

.hcd-nav .hcd-nav-link{background:#e8f2ff;border-color:#c4ddfc;color:#123e68;text-decoration:none;padding:8px 12px}
.hcd-nav .hcd-nav-link[aria-current="page"]{background:#ffd329;border-color:#ffd329;color:#122d46}
.dashboard-heading{align-items:flex-start}
.dashboard-period{margin-top:8px}
.dashboard-period summary{cursor:pointer;list-style:none}
.dashboard-period summary::-webkit-details-marker{display:none}
.dashboard-period form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px;margin-top:10px;padding:12px;background:white;border:1px solid #c1d3e7;border-radius:8px}
.dashboard-period form label{margin:0;font-size:.85rem}
.dashboard-period form .actions{align-self:end}
.consultation-ticket{display:grid;place-items:center;margin:10px auto;width:clamp(100px,28vw,150px);aspect-ratio:1;border-radius:50%;background:#e1effc;color:#0b3158;border:2px solid #bfd9ef}
.consultation-ticket strong{font-size:clamp(2rem,7vw,3.3rem);font-weight:900}
.tv-topbar [data-tv-sound]{padding:5px 9px;font-size:.8rem;border-color:#f5d663}
.tv-topbar [data-tv-sound][aria-pressed="true"]{background:#e3f3e9;border-color:#b2ddc2}
.tv-topbar [data-tv-sound][hidden]{display:none}
