/* AEI Survey & Solution v1.6 — shared light/dark visual system.
   Does not modify PHP logic, admin roles, client data or report security.
   Existing AEI red brand accent (admin-editable) is maintained in both modes. */
:root{
  --theme-surface:#ffffff;--theme-canvas:#f8f7f8;--theme-subtle:#faf6f7;
  --theme-text:#24232a;--theme-muted:#655d67;--theme-stroke:#eae5e8;
  --theme-input:#ffffff;--theme-halo:rgba(30,22,31,.07)
}
.theme-toggle{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  flex:0 0 auto;min-height:39px;min-width:39px;padding:7px 11px;
  border:1px solid #e7d9dd;border-radius:10px;background:#fff;
  color:#302a30;font:800 12px/1.1 Manrope,'Hind Siliguri',Arial,sans-serif;
  cursor:pointer;transition:background .2s,border-color .2s,transform .2s;
  -webkit-tap-highlight-color:transparent
}
.theme-toggle:hover{background:#faeef0;border-color:#d99aa5;transform:translateY(-1px)}
.theme-toggle:focus-visible{outline:3px solid var(--accent,#c52d3d);outline-offset:2px}
.theme-toggle-symbol{font-size:20px;line-height:1;min-width:18px;text-align:center;color:var(--accent,#c52d3d)}
.theme-toggle--public{margin-left:0}.theme-toggle--admin{margin-left:auto;margin-right:12px}
.theme-toggle--login{position:fixed;right:25px;top:23px;z-index:5}
.mobile-more-theme{display:none}
@media(min-width:901px){.public-site .nav{gap:12px}.public-site .nav-links{gap:clamp(7px,.85vw,13px)}.public-site .nav-links>a:not(.btn){font-size:clamp(10px,.76vw,12px)}}
@media(min-width:901px) and (max-width:1160px){.theme-toggle--public{width:38px;padding:7px}.theme-toggle--public .theme-toggle-label{display:none}}
@media(max-width:900px){.public-site .nav .theme-toggle--public{order:1;margin-left:auto;margin-right:4px}.public-site .nav .menu-toggle{order:2}.public-site .nav .nav-links{order:3}.theme-toggle--public .theme-toggle-label{display:none}.theme-toggle--public{height:41px;width:41px;padding:7px}}
@media(max-width:800px){.public-site .nav .theme-toggle--public{order:1;margin-left:auto}.mobile-more-theme{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 17px 8px;color:#6b5f65;font-size:13px;font-weight:700}.theme-toggle--admin{margin-right:8px}.theme-toggle--admin .theme-toggle-label{display:none}}
@media(max-width:480px){.theme-toggle--admin{width:38px;height:38px;padding:6px;margin-left:auto}.theme-toggle--login{top:10px;right:10px}.admin-top .theme-toggle--admin{flex-shrink:0}}
/* Dark mode — shared palette */
html[data-theme="dark"]{
  --ink:#f4eef1;--navy:#14151a;--navy2:#27232c;--body:#c4b8bf;
  --paper:#201c24;--border:#40363f;--white:#211d25;--shadow:0 18px 48px rgba(0,0,0,.20);
  --theme-surface:#241f28;--theme-canvas:#18151c;--theme-subtle:#221c24;
  --theme-text:#f4eef1;--theme-muted:#c7b8c1;--theme-stroke:#423740;
  --theme-input:#2b252f;--theme-halo:rgba(0,0,0,.26);
  color-scheme:dark
}
html[data-theme="dark"] body{background:var(--theme-canvas);color:var(--theme-text)}
html[data-theme="dark"] .muted,
html[data-theme="dark"] .section-heading p,
html[data-theme="dark"] .split-content p,
html[data-theme="dark"] .statement-card p,
html[data-theme="dark"] .simple-card p,
html[data-theme="dark"] .side-box p,
html[data-theme="dark"] .service-card>p,
html[data-theme="dark"] .project-info p,
html[data-theme="dark"] .post-body p,
html[data-theme="dark"] .equipment-info p,
html[data-theme="dark"] .team-details>p,
html[data-theme="dark"] .company-contact-box>p,
html[data-theme="dark"] .client-carousel-header p,
html[data-theme="dark"] .office-locations-heading p,
html[data-theme="dark"] .office-field p,
html[data-theme="dark"] .report-main p{color:var(--theme-muted)}
html[data-theme="dark"] .section-tint,
html[data-theme="dark"] .team-group-leadership,
html[data-theme="dark"] .team-group-staff,
html[data-theme="dark"] .team-section:nth-of-type(even),
html[data-theme="dark"] .client-carousel-section,
html[data-theme="dark"] .office-locations-section{background:var(--theme-canvas);color:var(--theme-text)}
html[data-theme="dark"] .team-group-leadership,html[data-theme="dark"] .section-tint{background:#1e1a22}
html[data-theme="dark"] .site-header{background:#211c25;border-color:#3b303a;box-shadow:0 8px 18px rgba(0,0,0,.19)}
html[data-theme="dark"] .public-site .nav-links>a:not(.btn){color:#e0d1da}
html[data-theme="dark"] .public-site .nav-links>a.nav-active,html[data-theme="dark"] .public-site .nav-links>a:not(.btn):hover{color:#f57c91}
html[data-theme="dark"] .menu-toggle{color:#f1e7eb}
html[data-theme="dark"] .site-header .brand-logo-wrap{background:#fff;border-radius:10px;padding:3px 8px}
html[data-theme="dark"] .theme-toggle{background:#332b35;border-color:#574452;color:#f7e9ef}
html[data-theme="dark"] .theme-toggle:hover{background:#493340;border-color:#9f5f72}
html[data-theme="dark"] .theme-toggle-symbol{color:#ffb4c3}
html[data-theme="dark"] .service-card,
html[data-theme="dark"] .project-card,
html[data-theme="dark"] .post-card,
html[data-theme="dark"] .equipment-card,
html[data-theme="dark"] .team-card,
html[data-theme="dark"] .statement-card,
html[data-theme="dark"] .simple-card,
html[data-theme="dark"] .side-box,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .info-aside,
html[data-theme="dark"] .verification-result,
html[data-theme="dark"] .portal-login,
html[data-theme="dark"] .report-card,
html[data-theme="dark"] .partner-logo,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .company-contact-box,
html[data-theme="dark"] .office-card,
html[data-theme="dark"] .client-carousel-item,
html[data-theme="dark"] .graphic-label{
  background:var(--theme-surface);color:var(--theme-text);border-color:var(--theme-stroke);box-shadow:var(--shadow)
}
html[data-theme="dark"] .team-details h3,
html[data-theme="dark"] .project-info h3,
html[data-theme="dark"] .equipment-info h3,
html[data-theme="dark"] .client-carousel-item strong,
html[data-theme="dark"] .office-card h3,
html[data-theme="dark"] .company-contact-box .contact-detail a,
html[data-theme="dark"] .office-field a,
html[data-theme="dark"] .portal-heading h2{color:var(--theme-text)}
html[data-theme="dark"] .service-glyph,
html[data-theme="dark"] .simple-icon,
html[data-theme="dark"] .client-fallback-icon,
html[data-theme="dark"] .social-links a{background:#3d2832;color:#ff91a3}
html[data-theme="dark"] .feature-list>div,
html[data-theme="dark"] .file-row,
html[data-theme="dark"] .status-grid>div,
html[data-theme="dark"] .report-files,
html[data-theme="dark"] .report-app-nav,
html[data-theme="dark"] .disclaimer,
html[data-theme="dark"] .estimate-panel,
html[data-theme="dark"] .credentials-box,
html[data-theme="dark"] .detail-row,
html[data-theme="dark"] .office-map-empty{background:#2f2631;color:#f0e4e9;border-color:#4a3b46}
html[data-theme="dark"] .status-grid b,html[data-theme="dark"] .status-grid span{color:#eddee6}
html[data-theme="dark"] .report-app-nav a{color:#e1ccd7}
html[data-theme="dark"] .report-app-nav a.selected{background:#57303d;color:#ffe0e6}
html[data-theme="dark"] .report-main small,
html[data-theme="dark"] .contact-detail small,
html[data-theme="dark"] .client-carousel-bottom,
html[data-theme="dark"] .office-field>span{color:#c9b3bd}
html[data-theme="dark"] .file-link,
html[data-theme="dark"] .btn-outline-dark,
html[data-theme="dark"] .report-pin-toggle{background:#392d38;color:#ffdbdf;border-color:#6a4957}
html[data-theme="dark"] .file-link:hover,html[data-theme="dark"] .btn-outline-dark:hover{background:#4a3542}
html[data-theme="dark"] .form-grid input:not([type=checkbox]):not([type=file]),
html[data-theme="dark"] .form-grid textarea,
html[data-theme="dark"] .form-grid select,
html[data-theme="dark"] .form-stack input,
html[data-theme="dark"] .form-stack textarea,
html[data-theme="dark"] .form-stack select,
html[data-theme="dark"] .lookup-form input,
html[data-theme="dark"] .inline-status-form select{
  background:var(--theme-input);color:#fff;border-color:#65505d
}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#bdaab5;opacity:1}
html[data-theme="dark"] .form-grid>label,html[data-theme="dark"] .form-stack>label{color:#f1e7ec}
html[data-theme="dark"] .form-grid input[type=file]{color:#d7bdc7}
html[data-theme="dark"] .form-grid label>small{color:#c5afbc}
html[data-theme="dark"] .btn-dark{background:#47313e;color:white}
html[data-theme="dark"] .btn-dark:hover{background:#613d4e}
html[data-theme="dark"] .footer{background:#120f15;color:#d4c4cc}
html[data-theme="dark"] .footer-grid p,html[data-theme="dark"] .footer-grid a:not(.brand){color:#cdbdc4}
html[data-theme="dark"] .footer-bottom{border-color:#3a2e38}
html[data-theme="dark"] .client-carousel-actions button{background:#392d39;color:#f5c7ce;border-color:#75525c}
html[data-theme="dark"] .office-map-empty{background:#2a232d}
html[data-theme="dark"] .office-card-icon{background:#4a303e;color:#ffd0d7}
html[data-theme="dark"] .map-container,html[data-theme="dark"] .contact-map{border-color:#65505b;background:#29252b}
html[data-theme="dark"] .alert{background:#23332e;color:#d7ffe8;border-color:#375448}
html[data-theme="dark"] .alert-error{background:#3e2530;color:#ffd6df;border-color:#6c3e4d}
/* Public mobile: maintain original five-tab structure and red Report emphasis. */
@media(max-width:800px){
 html[data-theme="dark"] .public-site .mobile-bottom-nav{background:#211b25;border-color:#433542;box-shadow:0 -8px 28px rgba(0,0,0,.3)}
 html[data-theme="dark"] .mobile-nav-item{color:#d8c3cc}
 html[data-theme="dark"] .mobile-nav-item.is-active:not(.mobile-nav-item--report){color:#ff9cae}
 html[data-theme="dark"] .mobile-more-sheet{background:#251e29;color:#f7e9ef;border-color:#5c4452}
 html[data-theme="dark"] .mobile-more-links a{background:#352b36;color:#f4e5ec;border-color:#554350}
 html[data-theme="dark"] .mobile-more-links a[aria-current=page]{background:#5c3342;color:#ffe7ee}
 html[data-theme="dark"] .mobile-more-close{background:#41313f;color:white;border-color:#715463}
 html[data-theme="dark"] .mobile-more-theme{color:#e3d0da;border-top:1px solid #4a3743}
 html[data-theme="dark"] .public-site .report-app-section .form-card{background:#28212c;color:#f5e8ee;border-color:#57414e}
 html[data-theme="dark"] .public-site .report-app-section .info-aside{background:#28212c;color:#f5e8ee;border-color:#57414e}
 html[data-theme="dark"] .public-site .report-app-section .lookup-form input,
 html[data-theme="dark"] .public-site .portal-login .form-stack input{background:#332936;color:#fff;border-color:#6a4c5d}
 html[data-theme="dark"] .public-site .report-app-section .verification-result{background:#302633;color:#f5e8ee;border-color:#694e5b}
 html[data-theme="dark"] .public-site .status-grid>div{background:#3b2d3b;border-color:#715362}
 html[data-theme="dark"] .public-site .report-card{background:#28212c;color:#f5e8ee;border-color:#57414e}
 html[data-theme="dark"] .public-site .report-files .file-link{background:#3a2e3b;color:#ffdce5;border-color:#674855}
}
/* Admin dashboard, forms, menus, tables and the v1.5 Backup Center. */
html[data-theme="dark"] .admin-body{background:#17141b;color:var(--theme-text)}
html[data-theme="dark"] .admin-sidebar{background:#16131a;border-color:#342c36}
html[data-theme="dark"] .admin-main{background:#17141b}
html[data-theme="dark"] .admin-top{background:#211b25;border-color:#423441;color:#f4e5ed}
html[data-theme="dark"] .admin-top h1{color:#f5e8f0}
html[data-theme="dark"] .admin-crumb,html[data-theme="dark"] .admin-account small{color:#bea8b5}
html[data-theme="dark"] .admin-account b{color:#f8edf1}
html[data-theme="dark"] .admin-content{background:#17141b}
html[data-theme="dark"] .admin-panel,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .backup-feature,
html[data-theme="dark"] .backup-note{
  background:#262029;color:#f7e9ed;border-color:#493842;box-shadow:0 12px 38px rgba(0,0,0,.17)
}
html[data-theme="dark"] .admin-panel h2,
html[data-theme="dark"] .panel-head h2,
html[data-theme="dark"] .metric-card strong,
html[data-theme="dark"] .backup-feature b,
html[data-theme="dark"] .backup-note h3{color:#f7edf0}
html[data-theme="dark"] .backup-feature small,
html[data-theme="dark"] .backup-note p,
html[data-theme="dark"] .metric-card small,
html[data-theme="dark"] .page-action p{color:#d2bdc8}
html[data-theme="dark"] .admin-body .responsive-table{background:#262029}
html[data-theme="dark"] .admin-body table{color:#f1e6ec}
html[data-theme="dark"] .admin-body th{background:#322732;color:#f1e3ea;border-color:#4d3945}
html[data-theme="dark"] .admin-body td{background:#262029;border-color:#453943;color:#f2e5ec}
html[data-theme="dark"] .admin-body td small{color:#c4b0ba}
html[data-theme="dark"] .admin-body td code{background:#3d303c;color:#ffd5dd}
html[data-theme="dark"] .admin-body .table-action{background:#422e3d;color:#ffc7d1;border-color:#755062}
html[data-theme="dark"] .admin-body .danger-link{color:#ffa4b4}
html[data-theme="dark"] .admin-body .pipeline-row{border-color:#4a3944;color:#eddee5}
html[data-theme="dark"] .admin-body .form-section-heading{border-color:#4e3a48;color:#f7e8ef}
html[data-theme="dark"] .admin-body .existing-file{background:#302631;border-color:#54414e}
html[data-theme="dark"] .admin-body .files-list .file-row{background:#312733}
html[data-theme="dark"] .admin-menu-toggle{background:#3b2e3b;color:#fff;border-color:#66505b}
/* Admin login uses same saved theme as public pages */
html[data-theme="dark"] .login-body{background:radial-gradient(circle at 75% 20%,#55313f,#131117 62%)}
html[data-theme="dark"] .login-card{background:#28212b;border:1px solid #654a59;color:#f6eaf0}
html[data-theme="dark"] .login-card h1{color:#f6eaf0}
html[data-theme="dark"] .login-card>p{color:#c5b4bf}
html[data-theme="dark"] .login-logo img{background:#fff;border-radius:9px;padding:6px}
html[data-theme="dark"] .login-logo span{color:#dcc9d2}
html[data-theme="dark"] .login-return{color:#e4c6d1}
@media(prefers-reduced-motion:reduce){.theme-toggle{transition:none}}
