/* Shared work areas. Tokens also apply to dialogs attached directly to the app. */
#horizon-sge-app #menu-area [hidden]{display:none!important}
#horizon-sge-app .hpc-overview-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:22px}
#horizon-sge-app .hpc-overview-stat{position:relative;text-align:left;padding:22px;min-width:0;border:1px solid var(--hpc-border);border-radius:16px;background:var(--hpc-surface);color:var(--hpc-text);cursor:pointer;font:inherit}
#horizon-sge-app .hpc-overview-stat strong{display:block;font-size:32px;color:var(--hpc-accent);line-height:1.2;margin-bottom:10px}
#horizon-sge-app .hpc-overview-stat span{display:block;font-size:12px;color:var(--hpc-muted);padding-right:20px;line-height:1.5}
#horizon-sge-app .hpc-overview-stat i{position:absolute;right:18px;bottom:24px;font-size:12px;color:var(--hpc-accent)}
#horizon-sge-app .hpc-upcoming{background:var(--hpc-surface);border:1px solid var(--hpc-border);border-radius:16px;padding:24px;margin-bottom:28px}
#horizon-sge-app .hpc-upcoming>div>small{color:var(--hpc-accent);font-size:11px;font-weight:700;letter-spacing:.04em}
#horizon-sge-app .hpc-upcoming h3,#horizon-sge-app .hpc-section-title{font-size:17px;color:var(--hpc-text);margin:8px 0 20px}
#horizon-sge-app .hpc-activity-list{display:grid;gap:8px}
#horizon-sge-app .hpc-activity-list button{display:flex;align-items:center;text-align:left;gap:16px;width:100%;min-width:0;border:0;border-radius:10px;padding:14px;background:var(--hpc-bg);color:var(--hpc-text);font:inherit;cursor:pointer}
#horizon-sge-app .hpc-activity-list button>span:nth-child(2){min-width:0;flex:1}
#horizon-sge-app .hpc-activity-list strong{display:block;font-size:13px;overflow-wrap:anywhere;line-height:1.5}
#horizon-sge-app .hpc-activity-list small{display:block;font-size:11px;color:var(--hpc-muted);margin-top:5px}
#horizon-sge-app .hpc-activity-date{flex-shrink:0;font-size:12px;font-weight:600;padding:10px;border-radius:8px}
#horizon-sge-app .hpc-overview-empty{color:var(--hpc-muted);font-size:13px;margin-bottom:0}
@media(max-width:760px){#horizon-sge-app .hpc-overview-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}#horizon-sge-app .hpc-overview-stat{padding:17px}#horizon-sge-app .hpc-upcoming{padding:18px}#horizon-sge-app .hpc-activity-list button{gap:10px;padding:10px}#horizon-sge-app .hpc-activity-date{padding:6px;font-size:11px}}
#horizon-sge-app{--hpc-bg:#f5f8fc;--hpc-surface:#fff;--hpc-soft:#edf3fa;--hpc-text:#182f4d;--hpc-muted:#586f88;--hpc-border:#dce5ef;--hpc-accent:#195cc6;--hpc-accent-text:#fff;--hpc-warning:#8c4d06;--hpc-warning-bg:#fff4db}
#horizon-sge-app:is(.hsg-dark,[data-hsg-theme="dark"]){--hpc-bg:#0a1625;--hpc-surface:#112238;--hpc-soft:#182e47;--hpc-text:#e7f0fc;--hpc-muted:#acbfd6;--hpc-border:#304860;--hpc-accent:#79b7ff;--hpc-accent-text:#071a31;--hpc-warning:#ffd18a;--hpc-warning-bg:#3b2d1a}
#horizon-sge-app :is(.hpc-workspace,.hpc-enhanced,.hpc-area-nav){color:var(--hpc-text);font-family:inherit;min-width:0}
#horizon-sge-app .hpc-heading{display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:20px;margin:0 0 24px;padding:8px 0 22px;border-bottom:1px solid var(--hpc-border)}
#horizon-sge-app .hpc-heading small{color:var(--hpc-accent);font-weight:700;letter-spacing:.12em;font-size:10px}
#horizon-sge-app .hpc-heading h2{font-size:clamp(22px,2.3vw,30px);line-height:1.25;color:var(--hpc-text);margin:7px 0 9px;letter-spacing:-.025em}
#horizon-sge-app .hpc-heading p{color:var(--hpc-muted);font-size:14px;margin:0;max-width:680px;line-height:1.6}
#horizon-sge-app :is(.hpc-actions,.hpc-list-head,.hpc-pagination,.hpc-area-nav){display:flex;align-items:center;flex-wrap:wrap;gap:10px}
#horizon-sge-app :is(.hpc-button,.hpc-primary){border:1px solid var(--hpc-border);border-radius:10px;background:var(--hpc-surface);color:var(--hpc-text);font:600 12px/1.4 system-ui,sans-serif;font-family:inherit;padding:10px 14px;min-height:40px;cursor:pointer;transition:background .15s,border-color .15s}
#horizon-sge-app .hpc-primary{background:var(--hpc-accent);color:var(--hpc-accent-text);border-color:var(--hpc-accent);font-weight:700}
#horizon-sge-app .hpc-button:hover{background:var(--hpc-soft);border-color:var(--hpc-accent)}
#horizon-sge-app :is(.hpc-button,.hpc-primary):disabled{opacity:.5;cursor:default}
#horizon-sge-app :is(.hpc-workspace,.hpc-table-controls,.hpc-area-nav) :is(button,input,select,textarea):focus-visible{outline:3px solid var(--hpc-accent);outline-offset:3px}
#horizon-sge-app :is(.hpc-filters,.hpc-fields){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
#horizon-sge-app .hpc-filters{grid-template-columns:110px minmax(180px,1fr) minmax(180px,1.4fr) auto auto;align-items:end;background:var(--hpc-surface);padding:20px;border:1px solid var(--hpc-border);border-radius:16px;margin-bottom:24px}
#horizon-sge-app :is(.hpc-workspace,.hpc-table-controls) label{display:flex;flex-direction:column;gap:7px;font-size:12px;font-weight:600;min-width:0;color:var(--hpc-muted)}
#horizon-sge-app :is(.hpc-workspace,.hpc-table-controls) :is(input,select,textarea){width:100%;min-width:0;box-sizing:border-box;background:var(--hpc-bg);color:var(--hpc-text);border:1px solid var(--hpc-border);border-radius:9px;padding:11px 12px;font:400 14px/1.4 system-ui,sans-serif;font-family:inherit;min-height:43px}
#horizon-sge-app .hpc-workspace textarea{resize:vertical;line-height:1.65}
#horizon-sge-app .hpc-catalog{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
#horizon-sge-app .hpc-service-card{appearance:none;text-align:left;display:flex;align-items:flex-start;flex-direction:column;padding:24px;background:var(--hpc-surface);color:var(--hpc-text);border:1px solid var(--hpc-border);border-radius:16px;cursor:pointer;min-width:0;box-shadow:0 4px 14px #12376605;transition:transform .15s,border-color .15s}
#horizon-sge-app .hpc-service-card:hover{transform:translateY(-2px);border-color:var(--hpc-accent)}
#horizon-sge-app .hpc-card-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;background:var(--hpc-soft);color:var(--hpc-accent);margin-bottom:20px;font-size:18px}
#horizon-sge-app .hpc-service-card strong{font-size:16px;line-height:1.4;font-weight:700}
#horizon-sge-app .hpc-service-card p{color:var(--hpc-muted);font:400 13px/1.7 system-ui,sans-serif;font-family:inherit;margin:10px 0 20px}
#horizon-sge-app .hpc-card-link{font-size:12px;font-weight:600;color:var(--hpc-accent);margin-top:auto;display:flex;gap:10px;align-items:center}
#horizon-sge-app .hpc-list-head{justify-content:space-between;margin:8px 0 18px;color:var(--hpc-muted);font-size:13px}
#horizon-sge-app .hpc-records{display:grid;gap:12px}
#horizon-sge-app .hpc-record{display:flex;justify-content:space-between;align-items:center;gap:24px;background:var(--hpc-surface);border:1px solid var(--hpc-border);border-radius:14px;padding:22px}
#horizon-sge-app .hpc-record>div:first-child{min-width:0;flex:1}
#horizon-sge-app .hpc-record h3{font-size:17px;margin:10px 0 7px;color:var(--hpc-text);overflow-wrap:anywhere}
#horizon-sge-app .hpc-record :is(p,small){color:var(--hpc-muted);font-size:13px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}
#horizon-sge-app .hpc-record p{margin:12px 0 0}
#horizon-sge-app .hpc-chips{display:flex;flex-wrap:wrap;gap:8px}
#horizon-sge-app .hpc-chips span{background:var(--hpc-soft);border-radius:6px;padding:4px 8px;color:var(--hpc-muted);font-size:11px}
#horizon-sge-app .hpc-pagination{justify-content:center;margin:24px 0;color:var(--hpc-muted);font-size:12px}
#horizon-sge-app .hpc-empty{background:var(--hpc-surface);border:1px dashed var(--hpc-border);border-radius:14px;padding:45px 24px;text-align:center;color:var(--hpc-muted)}
#horizon-sge-app .hpc-empty i{font-size:28px;color:var(--hpc-accent)}
#horizon-sge-app .hpc-dialog{box-sizing:border-box;width:min(820px,calc(100vw - 32px));max-width:none;max-height:88dvh;overflow:auto;padding:28px;border:1px solid var(--hpc-border);border-radius:20px;background:var(--hpc-surface);color:var(--hpc-text);box-shadow:0 24px 90px #0005}
#horizon-sge-app .hpc-dialog::backdrop{background:#07162c99;backdrop-filter:blur(3px)}
#horizon-sge-app .hpc-wide{grid-column:1/-1}
#horizon-sge-app .hpc-savebar{display:flex;justify-content:space-between;align-items:center;gap:16px;border-top:1px solid var(--hpc-border);padding-top:18px;margin-top:20px}
#horizon-sge-app .hpc-savebar p{color:var(--hpc-muted);font-size:13px;white-space:pre-wrap}
#horizon-sge-app .hpc-savebar .error{color:#bc354a}
#horizon-sge-app.hsg-dark .hpc-savebar .error{color:#ffa5ad}
#horizon-sge-app .hpc-form-note{font-size:12px;line-height:1.6;color:var(--hpc-muted)}
#horizon-sge-app .hpc-detail{display:grid;gap:20px;grid-template-columns:repeat(2,minmax(0,1fr))}
#horizon-sge-app .hpc-detail dt{color:var(--hpc-muted);font-size:12px;margin-bottom:6px}
#horizon-sge-app .hpc-detail dd{margin:0;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}
#horizon-sge-app .hpc-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:24px}
#horizon-sge-app .hpc-stats>div{border:1px solid var(--hpc-border);border-radius:14px;background:var(--hpc-surface);padding:24px}
#horizon-sge-app .hpc-stats strong{display:block;font-size:30px;line-height:1.2;color:var(--hpc-accent);margin-bottom:8px}
#horizon-sge-app .hpc-stats span{font-size:12px;color:var(--hpc-muted)}
#horizon-sge-app .hpc-table{overflow:auto;border:1px solid var(--hpc-border);border-radius:14px;background:var(--hpc-surface)}
#horizon-sge-app .hpc-table table{width:100%;border-collapse:collapse;min-width:500px}
#horizon-sge-app .hpc-table :is(td,th){text-align:left;padding:16px;vertical-align:top;border-bottom:1px solid var(--hpc-border);font-size:13px;color:var(--hpc-text);white-space:normal}
#horizon-sge-app .hpc-table th{background:var(--hpc-soft);color:var(--hpc-muted);font-size:11px;letter-spacing:.035em}
#horizon-sge-app .hpc-table td small{display:block;color:var(--hpc-muted);margin-top:6px}
#horizon-sge-app .hpc-score{display:inline-block;background:var(--hpc-soft);padding:6px 9px;margin:0 6px 6px 0;border-radius:6px}
#horizon-sge-app .hpc-attention{background:var(--hpc-warning-bg);color:var(--hpc-warning)}
#horizon-sge-app .hpc-area-nav{margin:0 0 22px;padding-bottom:16px;border-bottom:1px solid var(--hpc-border)}
#horizon-sge-app .hpc-table-controls{display:flex;align-items:end;flex-wrap:wrap;justify-content:space-between;gap:16px;margin:16px 0;color:var(--hpc-muted);font-size:12px}
#horizon-sge-app .hpc-table-controls label{min-width:180px;max-width:360px;flex:1}
#horizon-sge-app :is(.hpc-enhanced,.h320-shell) :is(.card,.hsg15-card,.hsg28-card,.h320-card,.h320-form,.comunicado-card,.table-container){border:1px solid var(--hpc-border);border-radius:14px;box-shadow:0 4px 16px #12376604;overflow-wrap:anywhere}
#horizon-sge-app .h320-shell{--h320-surface:var(--hpc-surface);--h320-text:var(--hpc-text);--h320-muted:var(--hpc-muted);--h320-border:var(--hpc-border)}
#horizon-sge-app .h320-shell .h320-content{padding:24px;background:var(--hpc-surface);border:1px solid var(--hpc-border);border-radius:16px}
#horizon-sge-app .h320-shell .h320-card{padding:22px;background:var(--hpc-surface);margin-bottom:14px}
#horizon-sge-app .h320-shell .h320-form{padding:22px;background:var(--hpc-bg);margin-bottom:22px}
#horizon-sge-app .h320-shell .h320-tabs{gap:8px;margin-bottom:20px}
#horizon-sge-app:is(.hsg-dark,[data-hsg-theme="dark"]) .h320-shell .h320-tabs{background:var(--hpc-surface)!important;border-color:var(--hpc-border)!important}
#horizon-sge-app .h320-shell .h320-tabs button[aria-pressed="true"]{background:var(--hpc-accent);color:var(--hpc-accent-text);border-color:var(--hpc-accent)}
#horizon-sge-app .hpc-theme-toggle{flex:0 0 auto;gap:8px;min-width:42px;min-height:42px;justify-content:center;cursor:pointer}
#horizon-sge-app .hpc-theme-toggle i{font-size:17px}
#horizon-sge-app #system-container .top-header .hpc-theme-toggle{display:inline-flex!important;border-radius:12px!important;background:var(--hpc-surface)!important;color:var(--hpc-text)!important;border-color:var(--hpc-border)!important;padding:9px 12px!important}
#horizon-sge-app:is(.hsg-dark,[data-hsg-theme="dark"]) #system-container .top-header .hpc-theme-toggle:hover{background:var(--hpc-soft)!important;color:var(--hpc-accent)!important}
@media(max-width:900px){#horizon-sge-app #system-container .top-header{flex-wrap:nowrap!important}#horizon-sge-app #system-container .top-header .header-left{min-width:0!important;flex:1 1 0!important}#horizon-sge-app #system-container .top-header .user-area{width:auto!important;flex:0 0 auto!important}#horizon-sge-app #system-container .top-header #page-title{min-width:0!important;max-width:100%!important}}
/* Footer identity, legal links and authorship stay readable in both themes. */
:is(#horizon-sge-app,.h33-legal-page) .h33-footer{box-sizing:border-box;width:100%;margin:36px 0 0;padding:26px 28px 18px;border:1px solid var(--hpc-border,#dce5ef);border-radius:18px;background:var(--hpc-surface,#fff);color:var(--hpc-muted,#586f88);font:400 12px/1.7 system-ui,sans-serif;text-align:left}
:is(#horizon-sge-app,.h33-legal-page) .hpc-footer-top{display:flex;align-items:center;justify-content:space-between;gap:24px;padding-bottom:22px}
:is(#horizon-sge-app,.h33-legal-page) .hpc-footer-brand{display:flex;align-items:center;gap:12px;flex-shrink:0}
:is(#horizon-sge-app,.h33-legal-page) .hpc-footer-brand>span{display:grid;place-items:center;box-sizing:border-box;background:#1857b6;color:#fff;font:800 24px/1 system-ui;width:42px;height:42px;border-radius:12px}
:is(#horizon-sge-app,.h33-legal-page) .hpc-footer-brand strong{display:block;letter-spacing:.09em;color:var(--hpc-text,#182f4d);font-size:12px}
:is(#horizon-sge-app,.h33-legal-page) .hpc-footer-brand small{display:block;font-size:11px;color:var(--hpc-muted,#586f88)}
:is(#horizon-sge-app,.h33-legal-page) .h33-footer nav{display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap;gap:8px 18px;margin:0}
:is(#horizon-sge-app,.h33-legal-page) .h33-footer :is(a,button){color:var(--hpc-muted,#586f88);text-decoration:none;font:inherit;white-space:normal}
:is(#horizon-sge-app,.h33-legal-page) .h33-footer nav a{padding:6px 0}
:is(#horizon-sge-app,.h33-legal-page) .h33-footer :is(a,button):hover{color:var(--hpc-accent,#195cc6);text-decoration:underline}
:is(#horizon-sge-app,.h33-legal-page) .h33-footer [data-hsg-install]{border:1px solid var(--hpc-border,#dce5ef);border-radius:8px;padding:7px 11px;text-decoration:none;cursor:pointer}
:is(#horizon-sge-app,.h33-legal-page) .hpc-footer-bottom{display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:8px 24px;border-top:1px solid var(--hpc-border,#dce5ef);padding-top:16px;font-size:11px}
:is(#horizon-sge-app,.h33-legal-page) .hpc-footer-bottom p{margin:0}
#horizon-sge-app .h31-login-footer .h33-footer{margin:0;padding:24px;border:1px solid var(--hpc-border);text-align:left}
#horizon-sge-app .h31-login-footer .h33-footer nav{justify-content:flex-end}
/* Legacy surfaces and dialogs used by communication, libraries and academic workflows. */
#horizon-sge-app:is(.hsg-dark,[data-hsg-theme="dark"]) :is(.h320-content,.h320-card,.h320-form,.h320-header,.hsg15-card,.hsg15-task,.hsg15-message,.hsg15-task-kpis>div,.hsg15-toolbar,.comunicado-card,.modal,.modal-header,.modal-footer,.hsg28-card,.hsg305-card,.hsg21-card,.hsg21-panel,.hsg-card,.hsg29-card,.hr-dialog,.hsg-cadastro-modal,.hpc-enhanced .card,.hpc-enhanced .table-container){background:var(--hpc-surface)!important;color:var(--hpc-text)!important;border-color:var(--hpc-border)!important}
#horizon-sge-app:is(.hsg-dark,[data-hsg-theme="dark"]) :is(.modal,.hpc-workspace,.hpc-enhanced,.h320-shell) :is(h1,h2,h3,h4,h5,label,summary,dt,dd){color:var(--hpc-text)!important}
#horizon-sge-app:is(.hsg-dark,[data-hsg-theme="dark"]) :is(.modal,.hpc-enhanced,.h320-shell) :is(p,small,.com-meta){color:var(--hpc-muted)!important}
#horizon-sge-app:is(.hsg-dark,[data-hsg-theme="dark"]) :is(.modal,.hpc-workspace,.hpc-enhanced,.h320-shell) :is(input:not([type=checkbox]):not([type=radio]),select,textarea){background:var(--hpc-bg)!important;color:var(--hpc-text)!important;border-color:var(--hpc-border)!important}
#horizon-sge-app:is(.hsg-dark,[data-hsg-theme="dark"]) :is(.hpc-enhanced,.h320-shell) :is(.btn-cancel,.h320-actions button,.h320-tabs button:not([aria-pressed="true"])){background:var(--hpc-soft);color:var(--hpc-text);border-color:var(--hpc-border)}
#horizon-sge-app:is(.hsg-dark,[data-hsg-theme="dark"]) .h33-footer{background:var(--hpc-surface)!important;color:var(--hpc-muted)!important;border-color:var(--hpc-border)!important}
#horizon-sge-app .hpc-enhanced [hidden]{display:none!important}
@media(max-width:1100px){#horizon-sge-app .hpc-filters{grid-template-columns:110px 1fr 1fr}#horizon-sge-app .hpc-catalog{grid-template-columns:repeat(2,minmax(0,1fr))}:is(#horizon-sge-app,.h33-legal-page) .hpc-footer-top{align-items:flex-start;flex-direction:column}:is(#horizon-sge-app,.h33-legal-page) .h33-footer nav{justify-content:flex-start}}
@media(max-width:650px){#horizon-sge-app .hpc-catalog,#horizon-sge-app .hpc-fields,#horizon-sge-app .hpc-detail{grid-template-columns:1fr}#horizon-sge-app .hpc-filters{grid-template-columns:1fr 1fr;padding:16px;gap:14px}#horizon-sge-app .hpc-filters .hpc-search{grid-column:1/-1}#horizon-sge-app .hpc-record{align-items:flex-start;flex-direction:column;padding:18px;gap:16px}#horizon-sge-app .hpc-stats{gap:8px}#horizon-sge-app .hpc-stats>div{padding:14px 10px}#horizon-sge-app .hpc-stats strong{font-size:25px}#horizon-sge-app .hpc-stats span{font-size:10px}#horizon-sge-app .hpc-dialog{padding:20px}#horizon-sge-app .hpc-savebar{align-items:stretch;flex-direction:column}#horizon-sge-app .hpc-heading{gap:16px}#horizon-sge-app .hpc-theme-toggle span{display:none}#horizon-sge-app .h320-shell .h320-content{padding:16px}#horizon-sge-app .h320-shell :is(.h320-card,.h320-form){padding:16px}:is(#horizon-sge-app,.h33-legal-page) .h33-footer{padding:22px 18px}#horizon-sge-app .h31-login-footer .h33-footer nav{justify-content:flex-start}}
@media(prefers-reduced-motion:reduce){#horizon-sge-app .hpc-service-card{transition:none}}
@media print{#horizon-sge-app :is(.hpc-area-nav,.hpc-filters,.hpc-actions,.hpc-pagination,.hpc-table-controls,.h33-footer,.hpc-theme-toggle){display:none!important}#horizon-sge-app .hpc-workspace{--hpc-surface:#fff;--hpc-text:#182f4d;--hpc-muted:#586f88;--hpc-border:#dce5ef;background:white!important;color:#182f4d!important}}
