/* HORIZON SGE 30.5.2 — correções finais: dark mode, prontuário documental e login */
#horizon-sge-app #h31-login-theme{width:42px!important;height:42px!important;min-width:42px!important;padding:0!important;border-radius:50%!important;display:grid!important;place-items:center!important;font-size:0!important;line-height:1!important;overflow:hidden!important}
#horizon-sge-app #h31-login-theme i{font-size:16px!important;line-height:1!important;margin:0!important}
#horizon-sge-app #h31-login-theme::before,#horizon-sge-app #h31-login-theme::after{content:none!important;display:none!important}

#horizon-sge-app .hsg3052-doc-overlay{z-index:100120!important;padding:18px!important;overflow:auto!important}
#horizon-sge-app .hsg3052-doc-modal{width:min(1180px,96vw)!important;max-height:92vh!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}
#horizon-sge-app .hsg3052-doc-content{overflow:auto!important;padding:4px 2px 18px!important;min-height:0!important}
#horizon-sge-app .hsg3052-doc-loading{min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;color:#506981;text-align:center;padding:34px}
#horizon-sge-app .hsg3052-doc-loading i{font-size:28px;color:#1A75D3}
#horizon-sge-app .hsg3052-doc-loading strong{font-size:16px;color:#17324d}
#horizon-sge-app .hsg3052-doc-grid{contain:layout style;content-visibility:auto;contain-intrinsic-size:600px}
#horizon-sge-app .hsg3052-doc-card{min-width:0!important}

/* Camada final do modo escuro para módulos 28/30.4/30.5/30.5.1/30.5.2. */
#horizon-sge-app.hsg-dark{--h3052-bg:#07111d;--h3052-surface:#0d1b2a;--h3052-surface2:#112337;--h3052-surface3:#162b42;--h3052-border:#284159;--h3052-text:#edf5fc;--h3052-muted:#9db2c6}
#horizon-sge-app.hsg-dark #system-container :where(.hsg28-shell,.hsg28-card,.hsg281-doc-card,.hsg281-issued-row,.hsg281-emit-card,.hsg28-student-result,.student-detail-panel,.calendar-event-item,.hsg-council-panel,.hsg-risk-card,.hsg304-reader,.hsg304-side,.hsg304-history,.hsg304-config,.hsg304-camera,.hsg304-idcard,.hsg305-card,.hsg305-book,.hsg305-row,.hsg305-list,.hsg305-loan-form,.hsg305-offline-state,.hsg305-preview,.hsg305-attendance,.hsg305-pref-dialog,.hsg305-copy-grid>*,.hsg3051-print-shell,.hsg3052-doc-modal){background:var(--h3052-surface)!important;color:var(--h3052-text)!important;border-color:var(--h3052-border)!important;box-shadow:none!important}
#horizon-sge-app.hsg-dark #system-container :where(.hsg28-toolbar,.hsg28-card-head,.hsg304-areas,.hsg304-meals,.hsg304-reader-actions,.hsg305-hero,.hsg305-kpis>*,.hsg305-switches,.hsg305-global-switches,.hsg305-doc-actions,.hsg3051-print-head){border-color:var(--h3052-border)!important}
#horizon-sge-app.hsg-dark #system-container :where(.hsg28-shell,.hsg305-host,.hsg304-layout){color:var(--h3052-text)!important}
#horizon-sge-app.hsg-dark #system-container :where(.hsg28-card h2,.hsg28-card h3,.hsg28-card h4,.hsg281-doc-card strong,.hsg281-issued-row strong,.hsg281-emit-card strong,.hsg28-student-result strong,.hsg304-idbody h2,.hsg305-card h3,.hsg305-book strong,.hsg305-row strong,.hsg3052-doc-loading strong){color:var(--h3052-text)!important}
#horizon-sge-app.hsg-dark #system-container :where(.hsg28-card p,.hsg28-card small,.hsg28-card span,.hsg281-doc-info small,.hsg281-issued-row small,.hsg28-student-result small,.hsg304-card-info small,.hsg304-idbody p,.hsg305-card p,.hsg305-row small,.hsg305-note,.hsg305-empty,.hsg3052-doc-loading small){color:var(--h3052-muted)!important}
#horizon-sge-app.hsg-dark #system-container :where(.hsg28-detail-grid>div,.hsg305-preview-grid b,.hsg305-global-switches>label,.hsg305-switches>label,.hsg304-switches>label,.hsg304-event-fields,.hsg305-loan-form,.hsg305-school-select){background:var(--h3052-surface2)!important;border-color:var(--h3052-border)!important;color:var(--h3052-text)!important}
#horizon-sge-app.hsg-dark #system-container :where(.hsg281-issued-row,.hsg281-doc-card,.hsg281-emit-card,.hsg28-student-result,.hsg305-row){border-color:var(--h3052-border)!important}
#horizon-sge-app.hsg-dark #system-container :where(.hsg281-doc-card:hover,.hsg281-emit-card:hover,.hsg28-student-result:hover,.hsg305-row:hover){background:var(--h3052-surface2)!important}
#horizon-sge-app.hsg-dark #system-container :where(.hsg281-count-pill,.hsg305-badge,.hsg305-ticket-badge){background:#153b5f!important;color:#b9ddff!important;border-color:#285b86!important}
#horizon-sge-app.hsg-dark #system-container :where(.hsg28-search,.search-input-wrapper){background:var(--h3052-surface2)!important;border-color:var(--h3052-border)!important}
#horizon-sge-app.hsg-dark #system-container :where(.hsg28-search input,.search-input-wrapper input){background:transparent!important;color:var(--h3052-text)!important}
#horizon-sge-app.hsg-dark #system-container :where(.hsg304-result,.hsg304-empty,.hsg305-empty){border-color:var(--h3052-border)!important}
#horizon-sge-app.hsg-dark #system-container option{background:#0d1b2a!important;color:#edf5fc!important}

/* Overlays que são criados fora do contêiner principal recebem a classe sincronizada pelo JS. */
.hsg-dark-external :where(.hsg305-pref-dialog,.modal,.modal-content){background:#0d1b2a!important;color:#edf5fc!important;border-color:#284159!important}
.hsg-dark-external :where(h1,h2,h3,h4,strong,label){color:#edf5fc!important}
.hsg-dark-external :where(p,small,.form-hint){color:#9db2c6!important}
.hsg-dark-external :where(input:not([type=checkbox]):not([type=radio]),select,textarea){background:#091827!important;color:#edf5fc!important;border-color:#35516b!important}

@media(max-width:700px){#horizon-sge-app .hsg3052-doc-overlay{padding:8px!important}#horizon-sge-app .hsg3052-doc-modal{width:100%!important;max-height:96vh!important}#horizon-sge-app .hsg281-doc-actions{width:100%!important;display:flex!important;flex-wrap:wrap!important}}
