/* WINDEV Dealer Portal v1.6.3 — sidebar + light-theme refinement */
:root{
 --ha-primary:#D8B634;--ha-accent:#F1CF4B;--ha-brand-bg:#0B0E11;--ha-sidebar:#0B0E11;--ha-sidebar-surface:#11161b;--ha-sidebar-border:rgba(255,255,255,.08);
 --ha-bg:#0D1117;--ha-surface:#151B23;--ha-raised:#1A222C;--ha-soft:#111820;--ha-input:#0F151C;--ha-text:#E6EAF0;--ha-muted:#AAB4BF;--ha-subtle:#87929E;--ha-border:rgba(255,255,255,.105);--ha-border-strong:rgba(255,255,255,.17);--ha-shadow:0 10px 28px rgba(0,0,0,.14);--ha-sidebar-width:244px;--ha-header-height:72px;--ha-radius:1rem;--ha-content-gutter:1.5rem;
 --navy:var(--ha-text);--green:var(--ha-primary);--ink:var(--ha-text);--muted:var(--ha-muted);--line:var(--ha-border);--paper:var(--ha-bg);
}
[data-bs-theme="light"]{--ha-bg:#F5F7FA;--ha-surface:#FFFFFF;--ha-raised:#FFFFFF;--ha-soft:#EEF2F6;--ha-input:#FFFFFF;--ha-text:#23272F;--ha-muted:#66717D;--ha-subtle:#87929E;--ha-border:#D9DEE5;--ha-border-strong:#C8D0D9;--ha-shadow:0 10px 28px rgba(32,42,56,.08);--navy:#23272F;--green:#9B7A00;--ink:#23272F;--muted:#66717D;--line:#D9DEE5;--paper:#F5F7FA;}
html,body{background:var(--ha-bg)!important;color:var(--ha-text)!important}body.homeaid-system{font:14px/1.55 system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;min-height:100vh}body.homeaid-system a{color:var(--ha-accent)}
body.homeaid-system>header,body.homeaid-system>main,body.homeaid-system>footer{max-width:none}
body.homeaid-system .app-shell{min-height:100vh;display:flex;flex-direction:column;margin-left:var(--ha-sidebar-width)}body.homeaid-system .app-shell-public{margin-left:0}
body.homeaid-system .app-header{position:sticky;top:0;z-index:1030;height:var(--ha-header-height);min-height:var(--ha-header-height);padding:0 var(--ha-content-gutter);display:flex;align-items:center;justify-content:space-between;gap:1rem;background:color-mix(in srgb,var(--ha-bg) 88%,transparent);border-bottom:1px solid var(--ha-border);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
body.homeaid-system .app-content{max-width:none!important;width:100%;margin:0!important;padding:1.5rem var(--ha-content-gutter) 2rem!important;display:block!important;grid-template-columns:none!important;gap:0!important;flex:1 0 auto;outline:none}body.homeaid-system .content-frame{width:100%;max-width:1800px;margin:0 auto}
body.homeaid-system .app-footer{max-width:none!important;width:100%;margin:0!important;padding:1rem var(--ha-content-gutter)!important;display:block!important;border-top:1px solid var(--ha-border)!important;background:transparent;color:var(--ha-subtle);font-size:.68rem}
.app-sidebar{position:fixed;inset:0 auto 0 0;z-index:1040;width:var(--ha-sidebar-width);flex-direction:column;background:var(--ha-sidebar);color:#eef2f5;border-right:1px solid var(--ha-sidebar-border)}.sidebar-brand{min-height:var(--ha-header-height);display:flex;align-items:center;gap:.75rem;padding:0 1rem;border-bottom:1px solid var(--ha-sidebar-border)}.brand-mark{width:38px;height:38px;display:grid;place-items:center;flex:0 0 38px;border-radius:12px;color:#111;background:linear-gradient(135deg,var(--ha-primary),var(--ha-accent));font-weight:900;font-size:1.05rem;box-shadow:0 8px 22px rgba(216,182,52,.18)}.brand-name{font-weight:800;font-size:.8rem;letter-spacing:.025em;color:#fff;line-height:1.2;text-transform:uppercase}.brand-subtitle{margin-top:.18rem;color:rgba(255,255,255,.44);font-size:.68rem}.sidebar-scroll{overflow-y:auto;padding:.85rem .7rem 1rem}.sidebar-section-label{padding:.45rem .7rem .6rem;color:rgba(255,255,255,.34);font-size:.62rem;text-transform:uppercase;letter-spacing:.21em;font-weight:800}.sidebar-accordion,.sidebar-accordion .accordion-item,.sidebar-accordion .accordion-button{--bs-accordion-bg:transparent;--bs-accordion-border-color:transparent;background:transparent;color:inherit}.sidebar-accordion .accordion-item{border:0;margin-bottom:.28rem}.sidebar-accordion .accordion-button{min-height:42px;padding:.64rem .72rem;gap:.7rem;border-radius:.72rem!important;box-shadow:none;color:rgba(255,255,255,.72);font-weight:700;font-size:.82rem}.sidebar-accordion .accordion-button::after{filter:invert(1) grayscale(1);opacity:.55;transform:scale(.72)}.sidebar-accordion .accordion-button:not(.collapsed),.sidebar-accordion .accordion-button:hover{color:#fff;background:rgba(255,255,255,.055)}.sidebar-accordion .accordion-body{padding:.3rem 0 .38rem}.sidebar-link{display:flex;align-items:center;gap:.64rem;min-height:38px;margin:.18rem 0;padding:.5rem .7rem .5rem 2.22rem;border-radius:.66rem;color:rgba(255,255,255,.58)!important;text-decoration:none!important;font-size:.8rem;font-weight:650;transition:transform 160ms ease,color 160ms ease,background 160ms ease;text-align:left;background:transparent}.sidebar-link:hover{color:rgba(255,255,255,.9)!important;background:rgba(255,255,255,.045);transform:translateY(-1px)}.sidebar-link.active{color:#111!important;background:linear-gradient(135deg,var(--ha-primary),var(--ha-accent));box-shadow:0 8px 22px rgba(216,182,52,.13)}.sidebar-footer{padding:.8rem;border-top:1px solid var(--ha-sidebar-border)}.security-card{display:flex;gap:.7rem;align-items:flex-start;padding:.75rem;border:1px solid rgba(255,255,255,.07);background:rgba(255,255,255,.035);border-radius:.8rem}.security-icon{width:30px;height:30px;border-radius:.65rem;display:grid;place-items:center;background:rgba(216,182,52,.12);color:var(--ha-accent)}.sidebar-logout{padding-left:.72rem!important;cursor:pointer}
.app-mobile-sidebar{--bs-offcanvas-width:min(88vw,320px);background:var(--ha-sidebar);color:#fff;border-right:1px solid var(--ha-sidebar-border)}.app-mobile-sidebar .offcanvas-header{min-height:64px;border-bottom:1px solid var(--ha-sidebar-border);padding:0 .9rem}.app-mobile-sidebar .sidebar-brand{border:0;min-height:auto}.app-mobile-sidebar .sidebar-scroll{height:calc(100dvh - 64px)}.offcanvas-backdrop.show{opacity:.72;background:#05070a}
.header-left,.header-actions{display:flex;align-items:center;gap:.75rem;min-width:0}.header-title{font-weight:800;letter-spacing:-.015em;font-size:.96rem;white-space:nowrap;color:var(--ha-text)}.header-caption{color:var(--ha-subtle);font-size:.71rem;margin-top:.1rem}.workspace-status{align-items:center;padding-right:.8rem;border-right:1px solid var(--ha-border)}.role-copy{display:flex;flex-direction:column;text-align:right;line-height:1.15}.role-copy strong{font-size:.75rem;color:var(--ha-text)}.role-copy span{color:var(--ha-muted);font-size:.66rem;margin-top:.22rem}.status-dot{display:inline-block;width:7px;height:7px;margin-right:.25rem;border-radius:50%;background:#35c46a;box-shadow:0 0 0 3px rgba(53,196,106,.12)}.btn-icon{width:40px;height:40px;display:inline-grid;place-items:center;padding:0;border:1px solid var(--ha-border);background:var(--ha-surface);color:var(--ha-muted);border-radius:.75rem}.btn-icon:hover{color:var(--ha-text);border-color:var(--ha-border-strong);background:var(--ha-soft)}.avatar-button{width:40px;height:40px;border:0;background:transparent;padding:0;border-radius:50%}.avatar{width:40px;height:40px;display:grid;place-items:center;border-radius:50%;color:#111;font-size:.76rem;font-weight:900;background:linear-gradient(135deg,var(--ha-primary),var(--ha-accent));box-shadow:0 0 0 3px rgba(216,182,52,.11)}.theme-icon-light{display:none}[data-bs-theme="light"] .theme-icon-dark{display:none}[data-bs-theme="light"] .theme-icon-light{display:inline-block}.public-brand-link{display:flex;align-items:center;gap:.7rem;color:var(--ha-text)!important;text-decoration:none!important}.public-brand-link strong{display:block;font-size:.82rem}.public-brand-link small{display:block;color:var(--ha-subtle);font-size:.65rem;margin-top:.1rem}.dropdown-menu{--bs-dropdown-bg:var(--ha-surface);--bs-dropdown-border-color:var(--ha-border);--bs-dropdown-link-color:var(--ha-text);--bs-dropdown-link-hover-color:var(--ha-text);--bs-dropdown-link-hover-bg:var(--ha-soft);border-radius:.85rem;padding:.45rem}.dropdown-item{border-radius:.55rem;display:flex;align-items:center;gap:.55rem;font-size:.86rem}.dropdown-item-text{display:flex!important;align-items:center;gap:.45rem}
.app-icon{width:1em;height:1em;fill:currentColor;flex:0 0 auto}.skip-link{position:fixed;z-index:1100;left:.75rem;top:.75rem;padding:.55rem .8rem;border-radius:.55rem;background:var(--ha-primary);color:#111!important;font-weight:700}
body.homeaid-system h1,body.homeaid-system h2,body.homeaid-system h3,body.homeaid-system h4,body.homeaid-system h5,body.homeaid-system h6{color:var(--ha-text);letter-spacing:-.018em}body.homeaid-system .premium-page-title h1,body.homeaid-system .page-title h1{font-size:1.75rem!important;line-height:1.2;letter-spacing:-.025em;margin:.3rem 0 .45rem!important;color:var(--ha-text)!important}.eyebrow,.premium-kicker{color:var(--ha-primary)!important;font-size:.65rem!important;line-height:1.2;font-weight:900!important;letter-spacing:.24em!important;text-transform:uppercase}.premium-page-title p,.page-title p,.premium-card-head p,.card-title p,p{color:var(--ha-muted)}
body.homeaid-system .premium-card,body.homeaid-system .premium-metric,body.homeaid-system .card,body.homeaid-system .stats>div,body.homeaid-system .metric-card,body.homeaid-system .panel-card,body.homeaid-system .table-card{background:var(--ha-surface)!important;border:1px solid var(--ha-border)!important;border-radius:var(--ha-radius)!important;box-shadow:none!important;color:var(--ha-text)!important}.premium-card:hover,.premium-metric:hover{border-color:var(--ha-border-strong)!important}.premium-metric{transition:transform 170ms ease,border-color 170ms ease}.premium-metric:hover{transform:translateY(-3px)}.metric-label,.premium-metric .metric-label{color:var(--ha-muted)!important}.premium-metric strong,.stats strong{color:var(--ha-text)!important}
body.homeaid-system .btn,body.homeaid-system button,.button{font-weight:700;border-radius:.72rem;min-height:39px;transition:transform 160ms ease,box-shadow 160ms ease,background 160ms ease,border-color 160ms ease}.btn:hover,.button:hover{transform:translateY(-2px);text-decoration:none}.btn-primary,.primary,.button.primary{background:var(--ha-primary)!important;border-color:var(--ha-primary)!important;color:#111!important;box-shadow:0 8px 18px rgba(216,182,52,.1)!important}.btn-primary:hover,.primary:hover,.button.primary:hover{background:var(--ha-accent)!important;border-color:var(--ha-accent)!important;color:#111!important}.secondary,.button.secondary,.btn-light{background:var(--ha-soft)!important;border:1px solid var(--ha-border)!important;color:var(--ha-text)!important}.btn-outline-primary{--bs-btn-color:var(--ha-accent);--bs-btn-border-color:rgba(216,182,52,.48);--bs-btn-hover-color:#111;--bs-btn-hover-bg:var(--ha-primary);--bs-btn-hover-border-color:var(--ha-primary)}
body.homeaid-system label,.form-label{color:var(--ha-text)!important;font-weight:750;font-size:.76rem}.form-control,.form-select,body.homeaid-system input,body.homeaid-system select,body.homeaid-system textarea{color:var(--ha-text)!important;background-color:var(--ha-input)!important;border:1px solid var(--ha-border)!important;border-radius:.72rem!important;min-height:42px}.form-control:focus,.form-select:focus,body.homeaid-system input:focus,body.homeaid-system select:focus,body.homeaid-system textarea:focus{color:var(--ha-text)!important;background-color:var(--ha-input)!important;border-color:var(--ha-primary)!important;box-shadow:0 0 0 .22rem rgba(216,182,52,.14)!important;outline:0!important}.form-text,.field-help,.fine{color:var(--ha-subtle)!important}.field-error,.invalid-feedback{color:#ff8d8d!important}.field-wrap.has-error input,.field-wrap.has-error select,.field-wrap.has-error textarea,.is-invalid{border-color:#dc3545!important;box-shadow:0 0 0 .18rem rgba(220,53,69,.13)!important}
body.homeaid-system .modal{--bs-modal-bg:var(--ha-surface);--bs-modal-border-color:var(--ha-border);--bs-modal-color:var(--ha-text)}body.homeaid-system .modal-dialog{max-height:calc(100dvh - 2rem)}body.homeaid-system .modal-content{overflow:hidden;border-radius:1rem;border:1px solid var(--ha-border);background:var(--ha-surface)!important;box-shadow:0 26px 70px rgba(0,0,0,.28)}body.homeaid-system .modal-header,body.homeaid-system .modal-footer{border-color:var(--ha-border);padding:1rem 1.1rem}body.homeaid-system .modal-body{padding:1rem 1.1rem 1.2rem;background:var(--ha-surface)!important;overflow-y:auto}body.homeaid-system .modal-dialog-scrollable .modal-content{max-height:calc(100dvh - 2rem)}[data-bs-theme="dark"] .modal .btn-close{filter:invert(1) grayscale(100%) brightness(200%)}
body.homeaid-system .table{--bs-table-bg:transparent;--bs-table-color:var(--ha-text);--bs-table-border-color:var(--ha-border);--bs-table-hover-bg:color-mix(in srgb,var(--ha-primary) 4%,var(--ha-surface));--bs-table-hover-color:var(--ha-text);margin-bottom:0}body.homeaid-system .table thead th,body.homeaid-system th{color:var(--ha-muted)!important;font-size:.68rem;text-transform:uppercase;letter-spacing:.07em;font-weight:800;white-space:nowrap;border-bottom-color:var(--ha-border-strong)!important}body.homeaid-system .table tbody td,body.homeaid-system td{border-color:var(--ha-border)!important;color:var(--ha-text)}.dealer-table-wrap,.table-wrap{border-radius:.8rem;overflow:auto}.dt-container,.dt-local-container{color:var(--ha-text)}.dt-container .dt-input,.dt-local-container input,.dt-local-container select{min-height:36px;border:1px solid var(--ha-border)!important;border-radius:.68rem!important;background:var(--ha-input)!important;color:var(--ha-text)!important}.dt-local-toolbar,.dt-local-footer{color:var(--ha-muted)!important}.dt-local-paging .btn-light{background:var(--ha-soft)!important;color:var(--ha-text)!important}
.notice,.error{border-radius:.85rem!important;margin:0 0 1rem!important;padding:.8rem 1rem!important}.notice{background:rgba(25,135,84,.12)!important;border:1px solid rgba(25,135,84,.28)!important;color:#6ee7a5!important}.error{background:rgba(220,53,69,.12)!important;border:1px solid rgba(220,53,69,.28)!important;color:#ff9da8!important}.alert{border-radius:.85rem;border-color:var(--ha-border)}
.status-pill,.badge,.mini-chip,.access-badge{font-weight:800}.status-success,.access-allowed{background:rgba(25,135,84,.15)!important;border-color:rgba(25,135,84,.32)!important;color:#70d99c!important}.status-warning{background:rgba(255,193,7,.13)!important;border-color:rgba(255,193,7,.3)!important;color:#ffd861!important}.status-danger,.access-blocked{background:rgba(220,53,69,.13)!important;border-color:rgba(220,53,69,.3)!important;color:#ff909b!important}.status-info{background:rgba(13,202,240,.12)!important;border-color:rgba(13,202,240,.26)!important;color:#7fe8ff!important}
.machine-code-emphasis,.activation-code-emphasis,.machine-inline code{background:var(--ha-soft)!important;border:1px solid rgba(216,182,52,.33)!important;color:var(--ha-accent)!important;border-radius:.75rem!important}.machine-code-emphasis{font-size:clamp(1.15rem,2.2vw,1.65rem)!important;font-weight:900!important;letter-spacing:.055em!important;line-height:1.35!important;padding:.8rem 1rem!important}.machine-code-emphasis.compact{font-size:clamp(1rem,1.7vw,1.3rem)!important}.activation-code-emphasis{font-size:clamp(1.05rem,1.9vw,1.4rem)!important;font-weight:900!important;padding:.75rem 1rem!important}
.setup-page{background:var(--ha-bg)!important}.setup-page main.setup-main{display:block!important;width:100%!important;max-width:1800px!important;margin:0 auto!important;padding:1.5rem var(--ha-content-gutter) 2rem!important}.setup-page .setup-grid{gap:1rem!important}.setup-page .card,.setup-page .premium-card{background:var(--ha-surface)!important;border-color:var(--ha-border)!important}.setup-page .card-title h2,.setup-page .premium-page-title h1,.setup-page .setup-unlock h1{color:var(--ha-text)!important}.setup-page .setup-section-title{color:var(--ha-primary)!important;border-top-color:var(--ha-border)!important}.setup-page .setup-footnote{background:var(--ha-soft)!important;border-color:var(--ha-border)!important}.setup-page .health-item,.health-item{background:var(--ha-soft)!important;border-color:var(--ha-border)!important}.setup-page footer{background:transparent!important}
.auth-shell .content-frame{max-width:1280px}.auth-shell .app-content{display:grid!important;place-items:center}.auth-shell .centered{max-width:620px}.auth-shell .card{width:100%;padding:1.5rem!important}.public-app-shell .hero{position:static!important}.public-app-shell main.app-content>.content-frame{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:2rem;align-items:start}.public-app-shell main.app-content>.content-frame>.centered,.public-app-shell main.app-content>.content-frame>.dashboard,.public-app-shell main.app-content>.content-frame>.notice,.public-app-shell main.app-content>.content-frame>.error{grid-column:1/-1}
@media(max-width:991.98px){:root{--ha-content-gutter:1rem}.app-shell{margin-left:0!important}.app-header{height:68px!important;min-height:68px!important}.app-content{padding-top:1.2rem!important}.public-app-shell main.app-content>.content-frame{grid-template-columns:1fr}.hero{position:static!important}.public-app-shell main.app-content>.content-frame>*{grid-column:1!important}}
@media(max-width:767.98px){.dt-container .dt-layout-row,.dt-local-toolbar,.dt-local-footer{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:.65rem!important}.dt-container .dt-layout-cell,.dt-local-search,.dt-local-length{width:100%!important}.dt-container .dt-search,.dt-container .dt-length{width:100%;display:flex}.dt-container .dt-search .dt-input,.dt-container .dt-length .dt-input,.dt-local-search input,.dt-local-length select{width:100%!important;min-width:0!important}.premium-page-head,.page-title{align-items:flex-start!important}.premium-page-actions{width:100%}}
@media(max-width:575.98px){:root{--ha-content-gutter:.85rem}.app-header{height:64px!important;min-height:64px!important;padding:0 .85rem!important}.app-content{padding:1rem .85rem 1.2rem!important}.header-actions{gap:.42rem}.btn-icon,.avatar-button,.avatar{width:38px;height:38px}.modal-dialog{margin:.25rem!important;min-height:calc(100dvh - .5rem)!important;max-height:calc(100dvh - .5rem)!important}.modal-dialog-centered{min-height:calc(100dvh - .5rem)!important}.modal-content{max-height:100%!important}.modal-header,.modal-footer,.modal-body{padding-left:.85rem!important;padding-right:.85rem!important}.card,.premium-card{border-radius:.86rem!important}.premium-page-title h1,.page-title h1{font-size:1.45rem!important}.machine-code-emphasis{font-size:1.12rem!important;overflow-wrap:anywhere}.public-brand-link .brand-mark{width:34px;height:34px;flex-basis:34px}.header-copy{display:none}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}.btn:hover,.premium-metric:hover,.sidebar-link:hover{transform:none!important}}

/* V1.6.2 integration refinements */
.public-header-nav{display:flex;align-items:center;gap:.25rem;min-width:0}.public-header-nav a{display:inline-flex;align-items:center;gap:.45rem;min-height:40px;padding:.5rem .7rem;border-radius:.7rem;color:var(--ha-muted);text-decoration:none;font-size:.84rem;font-weight:650;white-space:nowrap;transition:background-color .16s ease,color .16s ease,transform .16s ease}.public-header-nav a:hover,.public-header-nav a:focus-visible{color:var(--ha-text);background:var(--ha-soft);transform:translateY(-1px)}.public-header-nav a.active{color:#17130a;background:linear-gradient(135deg,var(--ha-primary),var(--ha-accent))}.public-header-nav .app-icon{width:.9rem;height:.9rem}.public-app-shell .app-content{display:flex;justify-content:center}.public-app-shell .content-frame{width:min(100%,1800px)}
.form-validation-summary{margin-bottom:1rem}.form-validation-summary[hidden]{display:none!important}.is-invalid~.invalid-feedback{display:block}.app-toast-container{position:fixed;right:1rem;bottom:1rem;z-index:1090;display:flex;flex-direction:column;gap:.65rem;width:min(380px,calc(100vw - 2rem))}.app-toast-container .toast{width:100%;border:1px solid var(--ha-border-strong);box-shadow:0 16px 44px rgba(0,0,0,.24)}
.table-card{border:1px solid var(--ha-border);border-radius:1rem;background:var(--ha-surface)}.table-card>.table-responsive{border-radius:.8rem}.table thead th{font-weight:650;color:var(--ha-muted);font-size:.74rem;letter-spacing:.04em;text-transform:uppercase;border-bottom-color:var(--ha-border-strong)}
.homeaid-system .machine-code,.homeaid-system .machine-code-large,.homeaid-system .machine-emphasis,.homeaid-system [data-machine-code]{font-size:clamp(1.2rem,2vw,1.65rem)!important;font-weight:800!important;letter-spacing:.035em!important;color:var(--ha-accent)!important;overflow-wrap:anywhere}.homeaid-system .activation-code,.homeaid-system .activation-code-emphasis{font-size:clamp(1.12rem,1.8vw,1.45rem)!important;font-weight:800!important;color:var(--ha-accent)!important}
.setup-page .setup-main{max-width:none;margin:0;padding:0}.setup-page .setup-dashboard,.setup-page .setup-unlock{max-width:none}.setup-page .setup-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:1rem}.setup-page .setup-grid>.card{grid-column:span 6}.setup-page .setup-grid>.setup-wide{grid-column:1/-1}.setup-page .setup-section-title{margin-top:1.1rem;padding-top:.9rem;border-top:1px solid var(--ha-border);font-size:.7rem;font-weight:800;text-transform:uppercase;letter-spacing:.16em;color:var(--ha-accent)}.setup-page label{display:block;font-weight:650;color:var(--ha-text);margin-bottom:.75rem}.setup-page label input,.setup-page label select,.setup-page label textarea{display:block;width:100%;margin-top:.4rem}.setup-page .field-help{display:block;margin-top:.35rem;color:var(--ha-muted);font-size:.78rem;font-weight:500}.setup-page .grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.setup-page .setup-button-row{display:flex;flex-wrap:wrap;gap:.65rem;margin:.75rem 0}.setup-page .setup-health{display:grid;gap:.55rem}.setup-page .health-item,.setup-page .backup-row{padding:.8rem;border:1px solid var(--ha-border);border-radius:.8rem;background:var(--ha-soft)}.setup-page .health-item small,.setup-page .backup-row small{display:block;color:var(--ha-muted);margin-top:.2rem}.setup-page .health-pass strong{color:var(--bs-success)}.setup-page .health-fail strong{color:var(--bs-danger)}.setup-page .backup-row{display:flex;justify-content:space-between;gap:1rem;align-items:center}.setup-page .setup-footnote{margin-top:1rem;color:var(--ha-muted)}
@media(max-width:991.98px){.public-header-nav a span{display:none}.public-header-nav a{padding:.5rem}.setup-page .setup-grid>.card{grid-column:1/-1}}
@media(max-width:575.98px){.public-header-nav{gap:.1rem}.public-header-nav a{min-width:38px;justify-content:center}.app-toast-container{right:.5rem;bottom:.5rem;width:calc(100vw - 1rem)}.setup-page .grid{grid-template-columns:1fr}.setup-page .backup-row{align-items:flex-start;flex-direction:column}}


/* v1.6.3 — sidebar layout correction + light-theme legibility refinement */
/* The legacy portal stylesheet defines generic nav as flex. Scope the application
   sidebar navigation explicitly so its functional groups always stack vertically. */
.app-sidebar .sidebar-scroll,
.app-mobile-sidebar .sidebar-scroll{
  display:block!important;
  flex:1 1 auto!important;
  width:100%;
  min-width:0;
  min-height:0;
  margin:0!important;
  padding:.7rem .65rem 1rem!important;
  gap:0!important;
  align-items:stretch!important;
  font-size:inherit!important;
}
.app-sidebar .sidebar-section-label,
.app-mobile-sidebar .sidebar-section-label{
  display:block;
  margin:0 0 .28rem;
  padding:.42rem .68rem .48rem;
}
.app-sidebar .sidebar-accordion,
.app-mobile-sidebar .sidebar-accordion{
  display:block!important;
  width:100%;
  margin:0;
}
.sidebar-accordion .accordion-item{width:100%;margin:.18rem 0!important}
.sidebar-accordion .accordion-header{width:100%;margin:0}
.sidebar-accordion .accordion-button{
  width:100%;
  min-height:42px;
  justify-content:flex-start;
  padding:.62rem .7rem;
  border:1px solid transparent;
}
.sidebar-accordion .accordion-button .app-icon{width:.92rem;height:.92rem;color:rgba(255,255,255,.54)}
.sidebar-accordion .accordion-button:not(.collapsed){
  color:#fff;
  background:rgba(255,255,255,.065);
  border-color:rgba(255,255,255,.055);
  box-shadow:inset 3px 0 0 var(--ha-primary)!important;
}
.sidebar-accordion .accordion-button:not(.collapsed) .app-icon{color:var(--ha-accent)}
.sidebar-accordion .accordion-body{display:block!important;padding:.26rem 0 .38rem!important}
.sidebar-link{
  width:100%;
  min-height:38px;
  margin:.14rem 0;
  padding:.49rem .66rem .49rem 2.14rem!important;
  line-height:1.35;
}
.sidebar-link .app-icon{width:.82rem;height:.82rem;margin-left:-1.38rem;opacity:.78}
.sidebar-link.active .app-icon{opacity:1}
.sidebar-footer{flex:0 0 auto;background:linear-gradient(180deg,rgba(11,14,17,0),rgba(11,14,17,.96) 22%)}
.security-card{padding:.68rem .72rem}.security-card .fw-semibold{font-size:.76rem}.security-card .small{font-size:.64rem;line-height:1.45}

/* Keep the fixed sidebar dark in every theme, but make its hierarchy more readable. */
[data-bs-theme="light"] .app-sidebar,
[data-bs-theme="light"] .app-mobile-sidebar{background:#0B0E11;color:#eef2f5}
[data-bs-theme="light"] .sidebar-accordion .accordion-button{color:rgba(255,255,255,.74)}
[data-bs-theme="light"] .sidebar-link{color:rgba(255,255,255,.62)!important}
[data-bs-theme="light"] .sidebar-link:hover{color:#fff!important}
[data-bs-theme="light"] .sidebar-link.active{color:#15120a!important}

/* Light mode: preserve the specified semantic palette while increasing information contrast. */
[data-bs-theme="light"]{
  --ha-bg:#F5F7FA;
  --ha-surface:#FFFFFF;
  --ha-raised:#FAFBFC;
  --ha-soft:#EEF2F6;
  --ha-input:#FFFFFF;
  --ha-text:#23272F;
  --ha-muted:#56626F;
  --ha-subtle:#697582;
  --ha-border:#D9DEE5;
  --ha-border-strong:#C8D0D9;
  --ha-gold-text:#765A00;
  --ha-soft-gold:#FFF8DB;
  --ha-success-text:#17633B;
  --ha-warning-text:#735000;
  --ha-danger-text:#A52834;
}
[data-bs-theme="light"] body.homeaid-system{
  background:linear-gradient(180deg,#F7F9FC 0,#F5F7FA 190px,#F4F6F9 100%)!important;
  color:var(--ha-text)!important;
}
[data-bs-theme="light"] body.homeaid-system .app-header{
  background:rgba(255,255,255,.94)!important;
  border-bottom-color:#D8DEE6!important;
  box-shadow:0 5px 18px rgba(31,42,55,.045);
}
[data-bs-theme="light"] .header-title,
[data-bs-theme="light"] .role-copy strong{color:#202630!important}
[data-bs-theme="light"] .header-caption,
[data-bs-theme="light"] .role-copy span{color:#65717D!important}
[data-bs-theme="light"] .btn-icon{background:#FFF!important;border-color:#D7DDE5!important;color:#586572!important}
[data-bs-theme="light"] .btn-icon:hover{background:#F0F3F7!important;color:#23272F!important;border-color:#C5CDD7!important}

[data-bs-theme="light"] body.homeaid-system .premium-card,
[data-bs-theme="light"] body.homeaid-system .premium-metric,
[data-bs-theme="light"] body.homeaid-system .card,
[data-bs-theme="light"] body.homeaid-system .stats>div,
[data-bs-theme="light"] body.homeaid-system .metric-card,
[data-bs-theme="light"] body.homeaid-system .panel-card,
[data-bs-theme="light"] body.homeaid-system .table-card,
[data-bs-theme="light"] .role-card,
[data-bs-theme="light"] .permission-group,
[data-bs-theme="light"] .permission-check,
[data-bs-theme="light"] .term-chip-row{
  background:#FFF!important;
  border-color:#D7DDE5!important;
  color:#23272F!important;
  box-shadow:0 5px 18px rgba(31,42,55,.045)!important;
}
[data-bs-theme="light"] .premium-card-head,
[data-bs-theme="light"] .dealer-table-toolbar,
[data-bs-theme="light"] .premium-modal .modal-header,
[data-bs-theme="light"] .premium-modal .modal-footer,
[data-bs-theme="light"] body.homeaid-system .modal-header,
[data-bs-theme="light"] body.homeaid-system .modal-footer{
  background:#FAFBFC!important;
  border-color:#D9DEE5!important;
}
[data-bs-theme="light"] body.homeaid-system .modal-content,
[data-bs-theme="light"] body.homeaid-system .modal-body{background:#FFF!important;color:#23272F!important}

/* Typography and metadata: small text must remain readable in dense enterprise tables. */
[data-bs-theme="light"] body.homeaid-system p,
[data-bs-theme="light"] .premium-page-title p,
[data-bs-theme="light"] .page-title p,
[data-bs-theme="light"] .premium-card-head p,
[data-bs-theme="light"] .card-title p,
[data-bs-theme="light"] .page-subtitle,
[data-bs-theme="light"] .panel-subtitle{color:#596673!important}
[data-bs-theme="light"] .form-text,
[data-bs-theme="light"] .field-help,
[data-bs-theme="light"] .fine{color:#65717D!important}
[data-bs-theme="light"] body.homeaid-system td small,
[data-bs-theme="light"] .activity-item small,
[data-bs-theme="light"] .dealer-admin-v150 td small,
[data-bs-theme="light"] .request-ref-line{
  color:#596875!important;
  font-size:.72rem!important;
  line-height:1.45;
}
[data-bs-theme="light"] .request-ref-line b{color:#34424F!important;font-weight:800}
[data-bs-theme="light"] .request-ref-line span{color:#8B96A1!important}
[data-bs-theme="light"] .dealer-cell-title,
[data-bs-theme="light"] .activity-item strong,
[data-bs-theme="light"] .activity-item span,
[data-bs-theme="light"] .term-chip-row strong,
[data-bs-theme="light"] .role-card h3,
[data-bs-theme="light"] .permission-check b{color:#26313C!important}

/* Tables/DataTables: stronger visual hierarchy and easier scanning in light mode. */
[data-bs-theme="light"] body.homeaid-system .table,
[data-bs-theme="light"] body.homeaid-system table{color:#28333E!important;background:#FFF!important}
[data-bs-theme="light"] body.homeaid-system .table thead th,
[data-bs-theme="light"] body.homeaid-system th{
  background:#F1F4F7!important;
  color:#4E5B69!important;
  border-bottom-color:#CBD3DD!important;
  font-size:.7rem!important;
  font-weight:800!important;
}
[data-bs-theme="light"] body.homeaid-system .table tbody td,
[data-bs-theme="light"] body.homeaid-system td{
  color:#293541!important;
  border-bottom-color:#E1E6EC!important;
}
[data-bs-theme="light"] body.homeaid-system .table-hover>tbody>tr:hover>*{background:#F8FAFC!important;color:#1F2933!important}
[data-bs-theme="light"] .dt-container,
[data-bs-theme="light"] .dt-local-container,
[data-bs-theme="light"] .dataTables_wrapper{color:#44515E!important}
[data-bs-theme="light"] .dt-container label,
[data-bs-theme="light"] .dt-local-toolbar,
[data-bs-theme="light"] .dt-local-footer{color:#53616E!important;font-weight:650}
[data-bs-theme="light"] .dt-container .dt-input,
[data-bs-theme="light"] .dt-local-container input,
[data-bs-theme="light"] .dt-local-container select{
  background:#FFF!important;
  color:#23272F!important;
  border-color:#C9D1DB!important;
}
[data-bs-theme="light"] .dt-container .dt-input::placeholder,
[data-bs-theme="light"] input::placeholder,
[data-bs-theme="light"] textarea::placeholder{color:#8995A1!important;opacity:1}
[data-bs-theme="light"] .dt-paging-button,
[data-bs-theme="light"] .dt-local-paging .btn,
[data-bs-theme="light"] .page-link{
  background:#F4F6F8!important;
  color:#45525F!important;
  border-color:#D5DCE5!important;
}
[data-bs-theme="light"] .dt-paging-button.current,
[data-bs-theme="light"] .dt-local-paging .btn.btn-primary,
[data-bs-theme="light"] .page-item.active .page-link{
  background:var(--ha-primary)!important;
  color:#17130A!important;
  border-color:#C7A82F!important;
  font-weight:800!important;
}

/* Statuses and high-value identifiers use darker semantic text in light mode. */
[data-bs-theme="light"] .status-success,
[data-bs-theme="light"] .access-allowed,
[data-bs-theme="light"] .dealer-badge-allowed{background:#EAF7EF!important;border-color:#B8DEC7!important;color:#17633B!important}
[data-bs-theme="light"] .status-warning{background:#FFF4CF!important;border-color:#E7C65C!important;color:#735000!important}
[data-bs-theme="light"] .status-danger,
[data-bs-theme="light"] .access-blocked,
[data-bs-theme="light"] .dealer-badge-blocked{background:#FFF0F1!important;border-color:#EAB9BE!important;color:#A52834!important}
[data-bs-theme="light"] .status-info{background:#E9F5FA!important;border-color:#BDDDE9!important;color:#245E75!important}
[data-bs-theme="light"] .machine-code-emphasis,
[data-bs-theme="light"] .activation-code-emphasis,
[data-bs-theme="light"] .machine-inline code,
[data-bs-theme="light"] .homeaid-system .machine-code,
[data-bs-theme="light"] .homeaid-system .machine-code-large,
[data-bs-theme="light"] .homeaid-system .machine-emphasis,
[data-bs-theme="light"] .homeaid-system [data-machine-code],
[data-bs-theme="light"] .homeaid-system .activation-code{
  background:#FFF8DB!important;
  border-color:#E5CA63!important;
  color:#765A00!important;
}
[data-bs-theme="light"] .table-machine-code{background:#FFF8DB!important;border-color:#E5CA63!important;color:#765A00!important}
[data-bs-theme="light"] .btn-outline-primary{--bs-btn-color:#765A00;--bs-btn-border-color:#C9A62D;--bs-btn-hover-color:#17130A;--bs-btn-hover-bg:var(--ha-primary);--bs-btn-hover-border-color:#C9A62D}

/* Form controls and selectable content get stronger boundaries in light mode. */
[data-bs-theme="light"] .form-control,
[data-bs-theme="light"] .form-select,
[data-bs-theme="light"] body.homeaid-system input,
[data-bs-theme="light"] body.homeaid-system select,
[data-bs-theme="light"] body.homeaid-system textarea{
  background:#FFF!important;
  color:#23272F!important;
  border-color:#C9D1DB!important;
}
[data-bs-theme="light"] .form-control:focus,
[data-bs-theme="light"] .form-select:focus,
[data-bs-theme="light"] body.homeaid-system input:focus,
[data-bs-theme="light"] body.homeaid-system select:focus,
[data-bs-theme="light"] body.homeaid-system textarea:focus{
  border-color:#B69522!important;
  box-shadow:0 0 0 .22rem rgba(216,182,52,.18)!important;
}
[data-bs-theme="light"] .dropdown-menu{background:#FFF!important;border-color:#D1D8E1!important;box-shadow:0 14px 34px rgba(31,42,55,.12)!important}
[data-bs-theme="light"] .dropdown-item{color:#28333E!important}
[data-bs-theme="light"] .dropdown-item:hover{background:#EEF2F6!important;color:#1F2933!important}

/* Dark mode also neutralizes old hard-coded light surfaces from pre-integration modules. */
[data-bs-theme="dark"] .premium-card-head,
[data-bs-theme="dark"] .dealer-table-toolbar,
[data-bs-theme="dark"] .premium-modal .modal-header,
[data-bs-theme="dark"] .premium-modal .modal-footer,
[data-bs-theme="dark"] .role-card,
[data-bs-theme="dark"] .permission-group,
[data-bs-theme="dark"] .permission-check,
[data-bs-theme="dark"] .term-chip-row,
[data-bs-theme="dark"] .activity-item{
  background:var(--ha-surface)!important;
  border-color:var(--ha-border)!important;
  color:var(--ha-text)!important;
}
[data-bs-theme="dark"] .dealer-cell-title,
[data-bs-theme="dark"] .activity-item strong,
[data-bs-theme="dark"] .activity-item span,
[data-bs-theme="dark"] .role-card h3,
[data-bs-theme="dark"] .permission-check b,
[data-bs-theme="dark"] .term-chip-row strong{color:var(--ha-text)!important}
[data-bs-theme="dark"] .activity-item small,
[data-bs-theme="dark"] .request-ref-line,
[data-bs-theme="dark"] .dealer-admin-v150 td small{color:var(--ha-muted)!important}

@media(max-width:991.98px){
  .app-mobile-sidebar .sidebar-scroll{height:calc(100dvh - 64px)!important;padding-bottom:1.2rem!important}
}

/* v1.6.3 dense-information readability floor */
body.homeaid-system .table tbody td{font-size:.8rem;line-height:1.45}
body.homeaid-system .table tbody td>strong{font-weight:780}
body.homeaid-system .premium-metric small,body.homeaid-system .stats small{color:var(--ha-subtle)!important;font-size:.69rem;line-height:1.4}
body.homeaid-system .premium-metric .metric-label,body.homeaid-system .metric-label{font-size:.66rem!important;letter-spacing:.075em;font-weight:800!important}
body.homeaid-system .premium-card-head h2,body.homeaid-system .premium-card-head h3{font-weight:800}
[data-bs-theme="light"] body.homeaid-system .premium-metric small,[data-bs-theme="light"] body.homeaid-system .stats small{color:#66727F!important}
