/* HORIZON SGE 30.5 — revisão piloto expandida */
#horizon-sge-app .hsg305-host{display:block;min-width:0}
#horizon-sge-app .hsg305-loading,#horizon-sge-app .hsg305-empty{padding:28px;border:1px solid var(--ws-border,#dce6f0);border-radius:18px;background:var(--ws-surface,#fff);display:flex;gap:12px;align-items:center;color:var(--ws-muted,#60758a)}
#horizon-sge-app .hsg305-empty{flex-direction:column;text-align:center}
#horizon-sge-app .hsg305-empty i{font-size:28px;color:#1A75D3}
#horizon-sge-app .hsg305-hero{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:24px 26px;margin-bottom:18px;border-radius:20px;background:linear-gradient(135deg,#004A99,#1A75D3);color:#fff;box-shadow:0 16px 38px rgba(0,74,153,.16)}
#horizon-sge-app .hsg305-hero small{display:block;font-size:10px;font-weight:800;letter-spacing:.12em;opacity:.8}
#horizon-sge-app .hsg305-hero h2{margin:4px 0 6px;color:#fff;font-size:24px}
#horizon-sge-app .hsg305-hero p{margin:0;color:rgba(255,255,255,.84);max-width:760px}
#horizon-sge-app .hsg305-hero>i{font-size:42px;opacity:.9}
#horizon-sge-app .hsg305-school-select{display:flex;align-items:center;gap:10px;margin:0 0 16px;padding:12px 14px;background:var(--ws-surface,#fff);border:1px solid var(--ws-border,#dce6f0);border-radius:14px}
#horizon-sge-app .hsg305-school-select span{font-size:12px;font-weight:800;color:var(--ws-muted,#60758a)}
#horizon-sge-app .hsg305-school-select select{min-width:280px;max-width:100%;padding:10px 12px;border:1px solid var(--ws-border,#dce6f0);border-radius:10px;background:var(--ws-surface,#fff);color:var(--ws-text,#172b46)}
#horizon-sge-app .hsg305-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:16px}
#horizon-sge-app .hsg305-card{background:var(--ws-surface,#fff);border:1px solid var(--ws-border,#dce6f0);border-radius:18px;padding:18px;box-shadow:0 10px 26px rgba(0,45,99,.05);margin-bottom:16px;min-width:0}
#horizon-sge-app .hsg305-card>header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;flex-wrap:wrap}
#horizon-sge-app .hsg305-card>header h3{margin:0;color:var(--ws-text,#172b46)}
#horizon-sge-app .hsg305-card>header span{font-size:11px;color:var(--ws-muted,#60758a)}
#horizon-sge-app .hsg305-card label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:700;color:var(--ws-muted,#60758a);margin-bottom:12px}
#horizon-sge-app .hsg305-card input,#horizon-sge-app .hsg305-card select,#horizon-sge-app .hsg305-card textarea{width:100%;min-height:42px;padding:10px 12px;border-radius:11px;border:1px solid var(--ws-border,#dce6f0);background:var(--ws-surface2,#f8fafc);color:var(--ws-text,#172b46);font:inherit}
#horizon-sge-app .hsg305-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
#horizon-sge-app .hsg305-note{display:flex;align-items:flex-start;gap:9px;margin-top:14px;padding:12px;background:#edf5fe;border:1px solid #cfe1f5;border-radius:12px;color:#31526f;font-size:11px;line-height:1.45}
#horizon-sge-app .hsg305-note i{color:#004A99}
#horizon-sge-app .hsg305-list{display:flex;flex-direction:column;gap:9px}
#horizon-sge-app .hsg305-list article{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 13px;border:1px solid var(--ws-border,#e0e7ef);border-radius:12px;background:var(--ws-surface2,#fafcff)}
#horizon-sge-app .hsg305-list strong,#horizon-sge-app .hsg305-list small{display:block}
#horizon-sge-app .hsg305-list small{margin-top:3px;color:var(--ws-muted,#60758a);font-size:11px}
#horizon-sge-app .hsg305-badge{padding:5px 8px;border-radius:999px;background:#edf2f7;color:#5a6f84;font-size:10px;font-weight:800;text-transform:uppercase;white-space:nowrap}
#horizon-sge-app .hsg305-badge.ok{background:#e8f7ef;color:#168657}
#horizon-sge-app .hsg305-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px}
#horizon-sge-app .hsg305-kpis article{padding:15px 16px;border-radius:16px;border:1px solid var(--ws-border,#dce6f0);background:var(--ws-surface,#fff)}
#horizon-sge-app .hsg305-kpis span{display:block;font-size:11px;color:var(--ws-muted,#60758a)}
#horizon-sge-app .hsg305-kpis strong{display:block;margin-top:5px;font-size:24px;color:var(--ws-text,#172b46)}
#horizon-sge-app .hsg305-loan-form{display:grid;grid-template-columns:1.1fr 1.5fr 100px auto;gap:12px;align-items:end}
#horizon-sge-app .hsg305-loan-form label{margin:0}
#horizon-sge-app .hsg305-book-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
#horizon-sge-app .hsg305-book{display:grid;grid-template-columns:48px 1fr auto;gap:12px;align-items:center;padding:14px;border:1px solid var(--ws-border,#dce6f0);border-radius:14px;background:var(--ws-surface2,#fafcff)}
#horizon-sge-app .hsg305-book-icon{width:46px;height:46px;display:grid;place-items:center;border-radius:12px;background:#e8f2fc;color:#004A99;font-size:18px}
#horizon-sge-app .hsg305-book strong,#horizon-sge-app .hsg305-book span,#horizon-sge-app .hsg305-book small{display:block}
#horizon-sge-app .hsg305-book span,#horizon-sge-app .hsg305-book small{font-size:11px;color:var(--ws-muted,#60758a);margin-top:3px}
#horizon-sge-app .hsg305-book button{border:1px solid #bcd6ee;background:#edf5fe;color:#004A99;border-radius:10px;padding:9px 10px;cursor:pointer;font-weight:700}
#horizon-sge-app .hsg305-switches{display:grid;grid-template-columns:1fr 1fr;gap:10px}
#horizon-sge-app .hsg305-switches label{display:flex;flex-direction:row;align-items:center;gap:8px;margin:0;padding:10px;border:1px solid var(--ws-border,#dce6f0);border-radius:11px;background:var(--ws-surface2,#fafcff)}
#horizon-sge-app .hsg305-switches input{width:auto;min-height:0}
#horizon-sge-app .hsg305-switches button{grid-column:1/-1}
#horizon-sge-app .hsg305-justify{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px;align-items:end}
#horizon-sge-app .hsg305-justify .wide{grid-column:1/-1}
#horizon-sge-app .hsg305-justify button{grid-column:1/-1;justify-self:start}
#horizon-sge-app .hsg305-attendance{display:flex;flex-direction:column;gap:8px}
#horizon-sge-app .hsg305-attendance article{display:grid;grid-template-columns:32px 1fr auto;align-items:center;gap:10px;padding:11px 13px;border:1px solid var(--ws-border,#dce6f0);border-radius:12px;background:var(--ws-surface2,#fafcff)}
#horizon-sge-app .hsg305-attendance article>i{font-size:18px}
#horizon-sge-app .hsg305-attendance article.present>i{color:#14945f}
#horizon-sge-app .hsg305-attendance article.absent>i{color:#cf3e3e}
#horizon-sge-app .hsg305-attendance strong,#horizon-sge-app .hsg305-attendance small{display:block}
#horizon-sge-app .hsg305-attendance small{font-size:11px;color:var(--ws-muted,#60758a);margin-top:2px}
#horizon-sge-app .hsg305-preview{padding:16px;border:1px solid #cfe1f5;border-radius:16px;background:#f6faff;margin-top:14px}
#horizon-sge-app .hsg305-preview header{display:flex;justify-content:space-between;gap:12px;align-items:center}
#horizon-sge-app .hsg305-preview h3{margin:3px 0}
#horizon-sge-app .hsg305-preview-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:14px 0}
#horizon-sge-app .hsg305-preview-grid b{padding:12px;background:white;border:1px solid #dce8f5;border-radius:12px;font-size:20px}
#horizon-sge-app .hsg305-preview-grid small{display:block;font-size:10px;color:#64798d;margin-top:3px}
#horizon-sge-app .hsg305-ok{color:#148657;font-weight:700}
#horizon-sge-app .hsg305-ticket-badge{display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#d92d20;color:#fff;font-size:9px;margin-left:4px}
#horizon-sge-app .hsg305-offline-state{display:inline-flex;align-items:center;gap:6px;padding:5px 8px;border-radius:999px;background:#eaf7ef;color:#157b50;font-size:10px;font-weight:800;margin-left:auto}
#horizon-sge-app .hsg305-offline-state.is-offline{background:#fff1db;color:#a36200}
#horizon-sge-app.hsg-dark .hsg305-note{background:#122c45;border-color:#244d70;color:#c4d8eb}
#horizon-sge-app.hsg-dark .hsg305-preview{background:#102238;border-color:#284864}
#horizon-sge-app.hsg-dark .hsg305-preview-grid b{background:#13283f;border-color:#284864;color:#eef5fc}
#horizon-sge-app.hsg-dark .hsg305-book-icon{background:#173755;color:#78b7f0}
@media(max-width:900px){
 #horizon-sge-app .hsg305-grid,#horizon-sge-app .hsg305-book-grid{grid-template-columns:1fr}
 #horizon-sge-app .hsg305-kpis{grid-template-columns:1fr 1fr}
 #horizon-sge-app .hsg305-loan-form{grid-template-columns:1fr 1fr}
 #horizon-sge-app .hsg305-justify{grid-template-columns:1fr 1fr}
}
@media(max-width:560px){
 #horizon-sge-app .hsg305-hero{padding:18px;border-radius:16px}#horizon-sge-app .hsg305-hero>i{display:none}
 #horizon-sge-app .hsg305-kpis,#horizon-sge-app .hsg305-row,#horizon-sge-app .hsg305-switches,#horizon-sge-app .hsg305-justify,#horizon-sge-app .hsg305-loan-form,#horizon-sge-app .hsg305-preview-grid{grid-template-columns:1fr}
 #horizon-sge-app .hsg305-school-select{align-items:stretch;flex-direction:column}#horizon-sge-app .hsg305-school-select select{min-width:0;width:100%}
 #horizon-sge-app .hsg305-book{grid-template-columns:42px 1fr}.hsg305-book button{grid-column:1/-1}
}

/* Preferências globais de notificação */
#horizon-sge-app .h29-notification-head [data-hsg305-notif-prefs]{display:inline-flex;align-items:center;gap:6px}
.hsg305-pref-overlay{position:fixed;inset:0;z-index:1000001;background:rgba(7,19,33,.58);display:grid;place-items:center;padding:18px;overflow:auto}
.hsg305-pref-dialog{width:min(620px,100%);background:#fff;color:#16324a;border:1px solid #dce7f2;border-radius:18px;overflow:hidden;box-shadow:0 24px 80px rgba(0,32,70,.26)}
.hsg305-pref-dialog>header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:20px 22px;background:linear-gradient(135deg,#004A99,#1A75D3);color:#fff}.hsg305-pref-dialog>header small{font-size:10px;font-weight:800;letter-spacing:.12em;opacity:.78}.hsg305-pref-dialog>header h2{margin:3px 0 4px;color:#fff}.hsg305-pref-dialog>header p{margin:0;font-size:12px;color:rgba(255,255,255,.84)}.hsg305-pref-dialog>header button{width:40px;height:40px;border-radius:11px;border:1px solid rgba(255,255,255,.28);background:rgba(255,255,255,.12);color:#fff}.hsg305-pref-dialog>.hsg305-loading{padding:30px;text-align:center}
.hsg305-global-switches{padding:18px 22px}.hsg305-global-switches>label{display:flex!important;align-items:center;justify-content:space-between;gap:20px;padding:12px 0;border-bottom:1px solid #e4ecf4}.hsg305-global-switches>label span{display:flex;flex-direction:column;gap:3px}.hsg305-global-switches>label small{font-size:11px;color:#65778b}.hsg305-global-switches>label input{width:20px;height:20px}.hsg305-global-switches>footer{display:flex;justify-content:flex-end;gap:10px;padding-top:18px}
#horizon-sge-app.hsg-dark~.hsg305-pref-overlay .hsg305-pref-dialog,.hsg-dark .hsg305-pref-dialog{background:#0f1c2d;color:#eef5fc;border-color:#263a50}.hsg-dark .hsg305-global-switches>label{border-color:#263a50}.hsg-dark .hsg305-global-switches>label small{color:#9cb0c5}
@media(max-width:560px){.hsg305-pref-overlay{padding:8px}.hsg305-pref-dialog>header{padding:17px}.hsg305-global-switches{padding:12px 16px}.hsg305-global-switches>label{gap:12px}}

#horizon-sge-app .hsg305-copy-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px}#horizon-sge-app .hsg305-copy-grid article{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px;border:1px solid var(--ws-border,#dce7f2);border-radius:13px;background:var(--ws-surface2,#f7fafd)}#horizon-sge-app .hsg305-copy-grid strong,#horizon-sge-app .hsg305-copy-grid small{display:block}#horizon-sge-app .hsg305-copy-grid small{margin-top:3px;color:var(--ws-muted,#65778b);font-size:11px}#horizon-sge-app .hsg305-copy-grid select{max-width:135px;min-width:120px}
