/* Theme-local presentation. Existing service consoles keep their own component styles. */
body.hg-core-page{--hg-x-surface:#fff;--hg-x-soft:#f7f5fa;--hg-x-border:#e5deed;--hg-x-text:#282237;--hg-x-muted:#71677c;--hg-x-accent:#761098}
html[data-bs-theme="dark"] body.hg-core-page{--hg-x-surface:#181521;--hg-x-soft:#211b2d;--hg-x-border:#383044;--hg-x-text:#eee9f6;--hg-x-muted:#b5a8c5;--hg-x-accent:#d696ee}
body.hg-core-page #main-body .primary-content{min-width:0;color:var(--hg-x-text);text-align:start}
body.hg-core-page #main-body .primary-content>.card,
body.hg-core-page #main-body .primary-content>form>.card{background:var(--hg-x-surface);border:1px solid var(--hg-x-border);border-radius:16px;box-shadow:0 6px 24px #24102f06;overflow:visible;margin-bottom:20px}
body.hg-core-page #main-body .card-body{padding:26px;min-width:0}
body.hg-core-page #main-body .card-header{background:var(--hg-x-soft);border-bottom:1px solid var(--hg-x-border);padding:18px 24px;text-align:start}
body.hg-core-page #main-body .primary-content :is(h1,h2,h3,h4,.card-title){text-align:start;letter-spacing:-.02em;color:var(--hg-x-text);line-height:1.3}
body.hg-core-page #main-body .primary-content .card-title{font-size:22px;font-weight:700;margin-bottom:18px}
body.hg-core-page #main-body .primary-content :is(p,address){line-height:1.7;overflow-wrap:anywhere}
body.hg-core-page #main-body .primary-content .text-muted{color:var(--hg-x-muted)!important}
body.hg-core-page #main-body .primary-content label:not(.form-check){font-size:14px;font-weight:600;line-height:1.5;display:inline-block;margin-bottom:8px;text-align:start;color:var(--hg-x-text)}
body.hg-core-page #main-body .primary-content :is(input,select,textarea).form-control{background:var(--hg-x-surface);color:var(--hg-x-text);border:1px solid var(--hg-x-border);border-radius:10px;box-shadow:none;min-height:44px;padding:10px 12px;font-size:14px;text-align:start;max-width:100%}
body.hg-core-page #main-body .primary-content textarea.form-control{height:auto;min-height:112px}
body.hg-core-page #main-body .primary-content :is(input,select,textarea).form-control:focus{border-color:var(--hg-x-accent);box-shadow:0 0 0 3px #9b35bf22;outline:0}
body.hg-core-page #main-body .primary-content :is(input,select,textarea).form-control:disabled{background:var(--hg-x-soft);opacity:.8}
body.hg-core-page #main-body .primary-content .form-group{margin-bottom:22px}
body.hg-core-page #main-body .primary-content .form-check{line-height:1.65;text-align:start;white-space:normal}
body.hg-core-page #main-body .primary-content :is(.well,.alert){border-radius:12px;text-align:start;overflow-wrap:anywhere}
body.hg-core-page #main-body .primary-content .well{background:var(--hg-x-soft);border:1px solid var(--hg-x-border);padding:18px}
body.hg-core-page #main-body .primary-content .btn{border-radius:10px;min-height:40px;white-space:normal;line-height:1.4;padding:10px 16px;font-weight:600;vertical-align:middle}
body.hg-core-page #main-body .primary-content .btn-default{background:var(--hg-x-soft);color:var(--hg-x-text);border:1px solid var(--hg-x-border)}
body.hg-core-page #main-body .primary-content .btn-default:hover{border-color:var(--hg-x-accent);color:var(--hg-x-accent)}
body.hg-core-page #main-body .primary-content .btn:focus-visible{outline:3px solid var(--hg-x-accent);outline-offset:3px}
body.hg-core-page #main-body .primary-content .btn:disabled,
body.hg-core-page #main-body .primary-content .btn.disabled{opacity:.5;cursor:not-allowed}
body.hg-core-page #main-body .primary-content .table{color:var(--hg-x-text);border-color:var(--hg-x-border)}
body.hg-core-page #main-body .primary-content .table :is(th,td){padding:16px 12px;border-color:var(--hg-x-border);vertical-align:middle;text-align:start}
body.hg-core-page #main-body .primary-content .table th{font-weight:600;color:var(--hg-x-muted);font-size:13px;background:var(--hg-x-soft)}
body.hg-core-page #main-body .primary-content .table-striped tbody tr:nth-of-type(odd){background:var(--hg-x-soft)}
body.hg-core-page #main-body .hg-user-table td:last-child{width:42%;min-width:0}
body.hg-core-page #main-body .hg-user-table td :is(a.btn,button){margin:3px 0;max-width:100%}
body.hg-core-page #main-body .hg-user-table td{overflow-wrap:anywhere}
body.hg-records-page #main-body .hg-record-action .btn{white-space:normal}
body.hg-records-page #main-body .hg-message-subject{overflow-wrap:anywhere;text-align:start}
body.hg-records-page #main-body .dataTables_empty{padding:48px 20px!important;line-height:1.65}
@media(max-width:767.98px){
 body.hg-core-page #main-body .card-body{padding:20px 16px}
 body.hg-core-page #main-body .card-header{padding:16px}
 body.hg-core-page #main-body .primary-content .card-title{font-size:20px}
 body.hg-core-page #main-body .hg-user-table,
 body.hg-core-page #main-body .hg-user-table tbody,
 body.hg-core-page #main-body .hg-user-table tr,
 body.hg-core-page #main-body .hg-user-table td{display:block;width:100%}
 body.hg-core-page #main-body .hg-user-table tr:has(th){display:none}
 body.hg-core-page #main-body .hg-user-table tr{border-bottom:1px solid var(--hg-x-border);padding:8px 0}
 body.hg-core-page #main-body .hg-user-table td{border:0;padding:10px 8px}
 body.hg-core-page #main-body .hg-user-table td:last-child{width:100%;display:flex;gap:8px;flex-wrap:wrap}
 body.hg-core-page #main-body .hg-user-table td:last-child form{display:flex;flex-wrap:wrap;gap:8px}
 body.hg-emails-page #main-body .table-list,
 body.hg-quotes-page #main-body .table-list{min-width:0;width:100%!important}
 body.hg-emails-page #main-body .table-list thead,
 body.hg-quotes-page #main-body .table-list thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 body.hg-emails-page #main-body .table-list :is(tbody,tr,td),
 body.hg-quotes-page #main-body .table-list :is(tbody,tr,td){display:block;width:100%;max-width:100%}
 body.hg-emails-page #main-body .table-list tr,
 body.hg-quotes-page #main-body .table-list tr{padding:16px;border-bottom:1px solid var(--hg-record-border,#e5deed)}
 body.hg-emails-page #main-body .table-list td,
 body.hg-quotes-page #main-body .table-list td{padding:6px 0!important;text-align:start!important;border:0;white-space:normal!important;overflow-wrap:anywhere}
 body.hg-emails-page #main-body .table-list td[data-title]::before,
 body.hg-quotes-page #main-body .table-list td[data-title]::before{content:attr(data-title);display:block;font-size:12px;line-height:1.5;opacity:.7;margin-bottom:4px}
 body.hg-emails-page #main-body .table-list .dataTables_empty,
 body.hg-quotes-page #main-body .table-list .dataTables_empty{padding:32px 8px!important}
}
@media(prefers-reduced-motion:reduce){body.hg-core-page #main-body .primary-content *{scroll-behavior:auto;transition:none}}
/* The shared legacy bridge uses important declarations; override them only on core pages. */
body.hg-core-page #main-body .primary-content .card:not(.card-sidebar):not(.view-ticket){background:var(--hg-x-surface)!important;border:1px solid var(--hg-x-border)!important;border-radius:16px!important;box-shadow:0 6px 24px #24102f06!important}
body.hg-core-page #main-body .primary-content .card:not(.card-sidebar)>.card-body{padding:26px!important}
body.hg-core-page #main-body .primary-content .card:not(.card-sidebar)>.card-header{background:var(--hg-x-soft)!important;border-bottom-color:var(--hg-x-border)!important;padding:18px 24px!important}
body.hg-core-page #main-body .primary-content .card .card-title{font-size:22px!important;color:var(--hg-x-text)!important}
body.hg-core-page #main-body .primary-content :is(input,select,textarea).form-control{background:var(--hg-x-surface)!important;border-color:var(--hg-x-border)!important;color:var(--hg-x-text)!important}
body.hg-core-page #main-body .primary-content .btn-default{background:var(--hg-x-soft)!important;color:var(--hg-x-text)!important;border-color:var(--hg-x-border)!important}
@media(max-width:767.98px){body.hg-core-page #main-body .primary-content .card:not(.card-sidebar)>.card-body{padding:20px 16px!important}body.hg-core-page #main-body .primary-content .card .card-title{font-size:20px!important}}

/* The password dialog belongs to WHMCS; keep its controls readable in both site themes. */
#modalGeneratePassword{--pw-surface:#fff;--pw-soft:#f7f5fa;--pw-text:#282237;--pw-border:#e5deed;text-align:start}
html[data-bs-theme="dark"] #modalGeneratePassword{--pw-surface:#1e1828;--pw-soft:#292132;--pw-text:#f3edf8;--pw-border:#46384f}
#modalGeneratePassword .modal-dialog{max-width:580px;margin:6vh auto;padding:0 16px}
#modalGeneratePassword .modal-content{background:var(--pw-surface)!important;color:var(--pw-text);border:1px solid var(--pw-border);border-radius:18px;overflow:hidden;box-shadow:0 20px 80px #0004}
#modalGeneratePassword .modal-header{display:flex;align-items:center;justify-content:space-between;gap:16px;background:var(--pw-surface)!important;padding:22px 24px;border-bottom:1px solid var(--pw-border)}
#modalGeneratePassword .modal-title{margin:0;color:var(--pw-text)!important;font-size:22px;line-height:1.35;text-align:start}
#modalGeneratePassword .close{flex:0 0 36px;float:none;width:36px;height:36px;padding:0;margin:0;margin-inline-start:auto;display:grid;place-items:center;border:0;border-radius:8px;background:var(--pw-soft);color:var(--pw-text)!important;font-size:26px;line-height:1;opacity:1;text-shadow:none}
#modalGeneratePassword .modal-body{background:var(--pw-surface);padding:24px}
#modalGeneratePassword .form-group{margin-bottom:20px}
#modalGeneratePassword label{color:var(--pw-text);font-size:14px;line-height:1.5;text-align:start}
#modalGeneratePassword .form-control{height:44px;min-height:44px;max-width:100%;border:1px solid var(--pw-border);border-radius:9px;background:var(--pw-soft)!important;color:var(--pw-text)!important;box-shadow:none;direction:ltr;text-align:left}
#modalGeneratePassword #inputGeneratePasswordOutput{font-family:ui-monospace,monospace;font-size:15px}
#modalGeneratePassword .btn{min-height:40px;border-radius:9px;padding:10px 14px;font-size:13px;font-weight:600;line-height:1.4;white-space:normal;max-width:100%}
#modalGeneratePassword .btn-default{background:var(--pw-soft)!important;color:var(--pw-text)!important;border:1px solid var(--pw-border)}
#modalGeneratePassword .btn-primary{background:#761098!important;border-color:#761098!important;color:#fff!important}
#modalGeneratePassword :is(.btn,.close,.form-control):focus-visible{outline:3px solid #bb72d4;outline-offset:2px}
#modalGeneratePassword .hg-password-actions{display:flex;flex-wrap:wrap;gap:8px}
#modalGeneratePassword .hg-password-copy-icon{width:16px;height:16px;vertical-align:middle;margin-inline-end:4px;fill:none;stroke:currentColor;stroke-width:1.8}
#modalGeneratePassword .modal-footer{display:flex;flex-wrap:wrap;gap:10px;background:var(--pw-surface);border-top:1px solid var(--pw-border);padding:18px 24px}
#modalGeneratePassword .modal-footer>.btn{margin:0}
@media(max-width:575.98px){#modalGeneratePassword .modal-header,#modalGeneratePassword .modal-body,#modalGeneratePassword .modal-footer{padding:18px}#modalGeneratePassword .modal-title{font-size:20px}#modalGeneratePassword .modal-footer{flex-direction:column-reverse;align-items:stretch}#modalGeneratePassword label{display:block;margin-bottom:6px}}
