@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');:root{--navy:#172b3a;--gold:#c1a875;--ink:#263b49;--muted:#78858b;--line:#e5e3dc;--paper:#f4f1e9}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font:14px 'DM Sans',sans-serif}.topbar{height:74px;background:var(--navy);color:white;padding:0 5vw;display:flex;justify-content:space-between;align-items:center}.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:white;font:800 14px Manrope;letter-spacing:2px}.brand>b{border:1px solid var(--gold);color:var(--gold);padding:11px;font-size:12px}.brand small{display:block;font:9px 'DM Sans';color:#b7c2d0;margin-top:4px}.topbar nav{display:flex;gap:22px;align-items:center}.topbar nav a{color:#e1c38d;text-decoration:none;font-size:12px}.topbar nav i{font-size:10px;color:#75d3a9;font-style:normal}.shell{max-width:1400px;margin:auto;padding:35px 5vw 22px}.heading,.table-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:23px}.eyebrow{font-size:9px;font-weight:700;letter-spacing:1.8px;color:#a48755;margin:0 0 8px}.heading h1{font:800 29px Manrope;margin:0;color:var(--navy)}.muted{color:var(--muted)}.heading .muted{margin:7px 0 0}.heading>div+div{font-size:11px}.heading small{display:block;margin-top:6px}.panel{background:#fff;border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 26px #14263e0a}.filters{padding:14px;display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin-bottom:17px}.filters label,.form-panel label,.login label{display:flex;flex-direction:column;gap:6px;font-size:11px;color:#58697d;font-weight:600;flex:1;min-width:120px}input,select{height:38px;border:1px solid #dce3eb;border-radius:5px;padding:0 9px;font:13px 'DM Sans';color:var(--ink);background:white;min-width:0}input:focus,select:focus{outline:2px solid #c6a66b55;border-color:var(--gold)}.btn{border:0;border-radius:5px;background:var(--navy);color:white;padding:11px 15px;font:600 11px 'DM Sans';cursor:pointer}.btn.light{background:#edf1f5;color:#4c5c70}.btn:disabled{opacity:.45}.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}.kpis article{padding:17px 18px;min-height:105px}.kpis small{display:block;font-size:9px;letter-spacing:1px;color:#8a96a5;font-weight:700}.kpis strong{display:block;font:800 25px Manrope;margin:9px 0 3px}.kpis em{font-size:10px;color:#96a1ae;font-style:normal}.kpis .revenue{background:var(--navy)}.revenue small,.revenue em{color:#b7c4d3}.revenue strong{color:#e3c58f}.charts{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:16px}.charts article{padding:19px}.charts h2,.table-head h2,.form-panel h2,.login h2{font:700 16px Manrope;margin:0 0 12px;color:var(--navy)}.chart{height:245px;position:relative}.table-panel{padding:19px 0 0;margin-bottom:22px}.table-head{padding:0 19px 14px;margin:0}.table-head small{color:var(--muted)}.scroll{overflow:auto}table{border-collapse:collapse;width:100%;white-space:nowrap}th{background:#f7f8fa;text-align:left;padding:12px;font-size:9px;letter-spacing:.6px;text-transform:uppercase;color:#7c899a}td{border-top:1px solid #edf0f4;padding:12px;font-size:11px;color:#405168}tbody tr:hover{background:#fafbfd}tbody td[colspan]{text-align:center;color:#96a1ae;padding:25px}.notice{padding:11px 13px;border-radius:5px;font-size:12px;margin:12px 0;background:#fff0ef;color:#a33f3f}.notice.success{background:#eaf7f1;color:#176c50}.hidden{display:none!important}footer{border-top:1px solid #e1e6ed;padding:17px 0;color:#8b97a5;font-size:9px;letter-spacing:1px;display:flex;justify-content:space-between}.secure{background:#e9f5ef;color:#237451;border-radius:30px;padding:8px 12px;font-size:10px}.login{max-width:430px;margin:45px auto;padding:26px}.login form{display:grid;gap:16px;margin-top:20px}.admin-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:15px;margin-bottom:18px}.form-panel{padding:21px}.form-panel>p.muted{font-size:12px;line-height:1.6}.form-panel form{display:grid;gap:12px}.fields{display:grid;grid-template-columns:1fr 1fr;gap:11px}.calc{background:#f4f6f8;padding:12px;border-radius:5px;font-size:11px;color:#758397}.calc b{color:var(--navy)}.upload{border:1px dashed #c7d1dd;background:#fafbfd;border-radius:7px;padding:25px 12px;display:flex;align-items:center;gap:9px;flex-direction:column;margin:20px 0;cursor:pointer;color:#a48755;font-size:24px}.upload b{font-size:12px;color:var(--navy)}.upload small,.tiny{font-size:10px;color:#8a97a7}.upload input{height:auto;border:0;max-width:220px}.form-panel>a{color:#9b7843;font-size:11px}.action{background:none;border:0;color:#8b6c3c;cursor:pointer;font-size:11px}.action.del{color:#b64e4e}@media(max-width:900px){.kpis{grid-template-columns:repeat(2,1fr)}.charts,.admin-grid{grid-template-columns:1fr}}@media(max-width:560px){.topbar{padding:0 15px}.shell{padding:25px 14px}.heading h1{font-size:24px}.filters label{min-width:100%}.kpis{gap:8px}.kpis article{padding:13px}.kpis strong{font-size:21px}.fields{grid-template-columns:1fr 1fr}footer{font-size:8px}}
/* Refined dark theme */
:root{color-scheme:light;--surface:#fff;--surface-soft:#f7f8fa;--field:#fff;--table-head:#f7f8fa;--text-soft:#58697d;--table-text:#405168}
body{background:var(--paper);color:var(--ink);transition:background .2s,color .2s}
.panel{background:var(--surface)}
input,select{background:var(--field);color:var(--ink)}
.filters label,.form-panel label,.login label{color:var(--text-soft)}
th{background:var(--table-head)}
td{color:var(--table-text)}
tbody tr:hover{background:var(--surface-soft)}
.calc{background:var(--surface-soft);color:var(--muted)}
.upload{background:var(--surface-soft)}
.theme-toggle{border:1px solid #ffffff45;border-radius:20px;background:transparent;color:#f2dfbd;padding:8px 12px;font:600 11px 'DM Sans';cursor:pointer;white-space:nowrap}
:root[data-theme="dark"]{color-scheme:dark;--navy:#0a1220;--ink:#e7edf5;--muted:#9aa9bb;--line:#29384b;--paper:#0d1726;--surface:#152235;--surface-soft:#1b2a3e;--field:#101d2e;--table-head:#1d2c40;--text-soft:#b6c2d1;--table-text:#d0d9e4}
:root[data-theme="dark"] .heading h1,:root[data-theme="dark"] .charts h2,:root[data-theme="dark"] .table-head h2,:root[data-theme="dark"] .form-panel h2,:root[data-theme="dark"] .login h2{color:#eef3f8}
:root[data-theme="dark"] input,:root[data-theme="dark"] select{border-color:#34465c}
:root[data-theme="dark"] .btn.light{background:#29394e;color:#dce5ef}
:root[data-theme="dark"] .calc{background:#1d2c40;color:#bac7d6}
:root[data-theme="dark"] .calc b{color:#f0d39e}
:root[data-theme="dark"] .upload{background:#17263a;border-color:#40536b}
:root[data-theme="dark"] .upload b{color:#e4ebf4}
:root[data-theme="dark"] .secure{background:#173b32;color:#8de0bc}
:root[data-theme="dark"] .notice{background:#482b30;color:#ffc2c2}
:root[data-theme="dark"] .notice.success{background:#173b32;color:#9be2c2}
:root[data-theme="dark"] td{border-top-color:#29384b}
:root[data-theme="dark"] tbody td[colspan]{color:#a7b4c4}
:root[data-theme="dark"] footer{border-color:#29384b}
:root[data-theme="dark"] .action{color:#e4c38c}
:root[data-theme="dark"] .action.del{color:#ff9696}
@media(max-width:560px){.topbar nav{gap:10px}.theme-toggle{padding:7px 9px;font-size:10px}}



/* Button and control interaction effects */
button,.btn,.action,.theme-toggle,input[type="button"],input[type="submit"],input[type="reset"],a.btn{
  -webkit-tap-highlight-color:transparent;
  transition:transform .16s ease,box-shadow .16s ease,background-color .16s ease,border-color .16s ease,color .16s ease,filter .16s ease;
}
button:not(:disabled),.btn:not(:disabled),.action:not(:disabled),.theme-toggle:not(:disabled),input[type="button"]:not(:disabled),input[type="submit"]:not(:disabled),input[type="reset"]:not(:disabled),a.btn{
  cursor:pointer;
}
button:not(:disabled):hover,.btn:not(:disabled):hover,.theme-toggle:not(:disabled):hover,input[type="button"]:not(:disabled):hover,input[type="submit"]:not(:disabled):hover,input[type="reset"]:not(:disabled):hover,a.btn:hover{
  transform:translateY(-2px);
  box-shadow:0 7px 16px #101b2d24;
  filter:brightness(1.07);
}
.action:not(:disabled):hover{transform:translateY(-1px);text-decoration:underline}
button:not(:disabled):active,.btn:not(:disabled):active,.action:not(:disabled):active,.theme-toggle:not(:disabled):active,input[type="button"]:not(:disabled):active,input[type="submit"]:not(:disabled):active,input[type="reset"]:not(:disabled):active,a.btn:active{
  transform:translateY(1px) scale(.98);
  box-shadow:none;
  filter:brightness(.96);
}
button:focus-visible,.btn:focus-visible,.action:focus-visible,.theme-toggle:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible{
  outline:3px solid #c6a66b99;
  outline-offset:3px;
}
.theme-toggle:hover{background:#ffffff18;border-color:#e1c38d}
.action.del:hover{color:#d33f3f}
.upload{transition:transform .18s ease,border-color .18s ease,background-color .18s ease,box-shadow .18s ease}
.upload:hover{transform:translateY(-2px);border-color:var(--gold);box-shadow:0 8px 20px #101b2d12}
button:disabled,.btn:disabled,.action:disabled,.theme-toggle:disabled,input:disabled{cursor:not-allowed;opacity:.55}
@media(prefers-reduced-motion:reduce){
  button,.btn,.action,.theme-toggle,input,select,a,.upload{transition:none!important}
  button:hover,.btn:hover,.action:hover,.theme-toggle:hover,a.btn:hover,.upload:hover,button:active,.btn:active,.action:active{transform:none!important}
}


/* Gold-accented interactive surfaces across dashboard and admin */
.panel,.kpis article,.charts article,.form-panel,.table-panel,.filters{
  position:relative;
  border:1px solid var(--line);
  transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease,background-color .2s ease;
}
.panel:hover,.kpis article:hover,.charts article:hover,.form-panel:hover,.table-panel:hover,.filters:hover{
  transform:translateY(-3px);
  border-color:var(--gold);
  box-shadow:0 12px 30px #101b2d16,0 0 0 1px #c6a66b22;
}
:root[data-theme="dark"] .panel:hover,
:root[data-theme="dark"] .kpis article:hover,
:root[data-theme="dark"] .charts article:hover,
:root[data-theme="dark"] .form-panel:hover,
:root[data-theme="dark"] .table-panel:hover,
:root[data-theme="dark"] .filters:hover{
  border-color:#d7b879;
  box-shadow:0 14px 32px #00000045,0 0 0 1px #c6a66b38;
}
.kpis article{cursor:default}
.kpis article:hover strong{color:#a98243}
.kpis article.revenue:hover strong{color:#f0d49d}
.topbar nav a{
  position:relative;
  padding:9px 2px;
  transition:color .18s ease,text-shadow .18s ease;
}
.topbar nav a:hover{
  color:#fff0c9;
  text-shadow:0 0 12px #c6a66b88;
}
.topbar nav a::after{
  content:"";
  position:absolute;
  left:0;right:100%;bottom:3px;
  height:1px;background:var(--gold);
  transition:right .2s ease;
}
.topbar nav a:hover::after{right:0}
.brand{transition:transform .18s ease,filter .18s ease}
.brand:hover{transform:translateY(-1px);filter:drop-shadow(0 0 8px #c6a66b55)}
input,select{
  transition:border-color .16s ease,box-shadow .16s ease,background-color .16s ease;
}
input:hover,select:hover{border-color:#c6a66b}
input:focus,select:focus{
  outline:0;
  border-color:var(--gold);
  box-shadow:0 0 0 3px #c6a66b35;
}
.btn,.theme-toggle,.action{
  transition:transform .16s ease,box-shadow .16s ease,background-color .16s ease,border-color .16s ease,color .16s ease,filter .16s ease;
}
.btn:not(:disabled):hover,.theme-toggle:not(:disabled):hover{
  transform:translateY(-2px);
  border-color:var(--gold);
  box-shadow:0 7px 18px #101b2d26,0 0 0 2px #c6a66b30;
}
.btn:not(:disabled):active,.theme-toggle:not(:disabled):active{
  transform:translateY(0) scale(.98);
  box-shadow:0 0 0 2px #c6a66b55;
}
.action:not(:disabled):hover{
  color:var(--gold);
  text-shadow:0 0 8px #c6a66b55;
}
.upload:hover{
  border-color:var(--gold);
  background:var(--surface-soft);
  box-shadow:0 0 0 3px #c6a66b25,0 10px 24px #101b2d12;
}
tbody tr{transition:background-color .15s ease,box-shadow .15s ease}
tbody tr:hover{box-shadow:inset 3px 0 0 var(--gold)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{
  outline:2px solid var(--gold);
  outline-offset:3px;
}
@media(prefers-reduced-motion:reduce){
  .panel,.kpis article,.charts article,.form-panel,.table-panel,.filters,.btn,.theme-toggle,.action,.topbar nav a,.brand,input,select,.upload,tbody tr{transition:none!important}
  .panel:hover,.kpis article:hover,.charts article:hover,.form-panel:hover,.table-panel:hover,.filters:hover,.btn:hover,.theme-toggle:hover,.brand:hover,.upload:hover{transform:none!important}
}


/* Nested surfaces glow independently when hovered */
.form-panel form>label,
.form-panel .fields>label,
.login form>label,
.filters>label,
.form-panel .calc,
.form-panel .upload,
.login .notice,
#adminMessage,
#importPreview{
  border:1px solid transparent;
  border-radius:7px;
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease,background-color .18s ease;
}
.form-panel form>label,
.form-panel .fields>label,
.login form>label,
.filters>label{
  padding:9px;
  margin:-2px;
  background:var(--surface-soft);
}
.form-panel form>label:hover,
.form-panel .fields>label:hover,
.login form>label:hover,
.filters>label:hover,
.form-panel .calc:hover,
.form-panel .upload:hover,
.login .notice:hover,
#adminMessage:hover,
#importPreview:hover{
  transform:translateY(-2px);
  border-color:var(--gold);
  box-shadow:0 7px 18px #101b2d18,0 0 0 2px #c6a66b24;
}
:root[data-theme="dark"] .form-panel form>label,
:root[data-theme="dark"] .form-panel .fields>label,
:root[data-theme="dark"] .login form>label,
:root[data-theme="dark"] .filters>label{
  background:#1b2a3e;
}
:root[data-theme="dark"] .form-panel form>label:hover,
:root[data-theme="dark"] .form-panel .fields>label:hover,
:root[data-theme="dark"] .login form>label:hover,
:root[data-theme="dark"] .filters>label:hover,
:root[data-theme="dark"] .form-panel .calc:hover,
:root[data-theme="dark"] .form-panel .upload:hover,
:root[data-theme="dark"] .login .notice:hover,
:root[data-theme="dark"] #adminMessage:hover,
:root[data-theme="dark"] #importPreview:hover{
  border-color:#d7b879;
  box-shadow:0 8px 20px #00000040,0 0 0 2px #c6a66b35;
}
@media(prefers-reduced-motion:reduce){
  .form-panel form>label,.form-panel .fields>label,.login form>label,.filters>label,.form-panel .calc,.form-panel .upload,.login .notice,#adminMessage,#importPreview{transition:none!important}
  .form-panel form>label:hover,.form-panel .fields>label:hover,.login form>label:hover,.filters>label:hover,.form-panel .calc:hover,.form-panel .upload:hover,.login .notice:hover,#adminMessage:hover,#importPreview:hover{transform:none!important}
}

/* BCD logo placement and theme-aware frame */
.topbar{position:relative}
.brand-logo{order:0;display:flex;align-items:center;justify-content:center;width:148px;height:54px;padding:7px 12px;margin-left:8px;border-radius:7px;background:#fff;border:1px solid #d9c49b;box-shadow:0 2px 12px #00000020;transition:transform .18s ease,box-shadow .18s ease,background-color .2s ease}
.brand-logo img{display:block;width:100%;height:100%;object-fit:contain}
.brand-logo:hover{transform:translateY(-2px);box-shadow:0 6px 18px #c6a66b55}
.topbar nav{order:1;margin-left:auto}
:root[data-theme="dark"] .brand-logo{background:#17263a;border-color:#b9975d;box-shadow:0 2px 14px #00000045}
@media(max-width:560px){
 .topbar{height:auto;min-height:74px;gap:8px;padding:10px 12px}
 .topbar nav{gap:9px;flex-wrap:wrap;justify-content:flex-end}
 .brand-logo{width:104px;height:42px;padding:5px 8px;margin-left:0;flex:0 0 auto}
 .topbar nav i{display:none}
}

/* Clearly disable edit actions while bulk-delete selection is active */
.action:disabled,.action:disabled:hover{opacity:.38!important;filter:grayscale(1);cursor:not-allowed!important;transform:none!important;box-shadow:none!important;border-color:var(--line)!important;color:var(--muted)!important;pointer-events:none}

/* Success confirmation popup for manual saves and workbook imports */
.success-popup{width:min(420px,calc(100% - 32px));padding:30px;border:1px solid var(--gold);border-radius:16px;background:var(--surface);color:var(--text);text-align:center;box-shadow:0 24px 80px #0007}
.success-popup::backdrop{background:#07111dcc;backdrop-filter:blur(4px)}
.success-popup .success-mark{width:58px;height:58px;margin:0 auto 16px;border-radius:50%;display:grid;place-items:center;background:#c6a66b24;border:1px solid var(--gold);color:var(--gold);font-size:30px;font-weight:800}
.success-popup h2{margin:0 0 9px;color:var(--text)}
.success-popup p{margin:0 0 22px;color:var(--muted);line-height:1.55}
.success-popup .btn{min-width:120px}

/* Excel import validation preview */
.import-table-wrap{max-height:420px;overflow:auto;margin:12px 0;border:1px solid var(--line);border-radius:7px;background:var(--surface)}
.import-table-wrap table{min-width:1050px;font-size:10px}
.import-table-wrap th{position:sticky;top:0;z-index:1;background:var(--table-head)}
.import-table-wrap td{max-width:220px;white-space:normal;overflow-wrap:anywhere;vertical-align:top}
.import-table-wrap .validation-ok{color:#18734f;font-weight:700;min-width:100px}
.import-table-wrap .validation-error{color:#b33b3b;font-weight:700;min-width:180px}
:root[data-theme="dark"] .import-table-wrap .validation-ok{color:#8de0bc}
:root[data-theme="dark"] .import-table-wrap .validation-error{color:#ffaaaa}

/* BCD Royale signature palette: Midnight & Champagne */
:root{
 --surface:#ffffff;
 --surface-soft:#f8f7f3;
 --field:#ffffff;
 --table-head:#f1efe8;
 --text-soft:#65747a;
 --table-text:#354b57;
}
.topbar{background:#172b3a}
.heading h1,.charts h2,.table-head h2,.form-panel h2,.login h2{color:#172b3a}
.eyebrow{color:#9b8356}
.btn{background:#203b4b}
.btn.light{background:#eeece5;color:#4f6068}
.kpis article.revenue{background:#203b4b}
.kpis article.revenue strong{color:#d9c69b}
.panel,.kpis article,.charts article,.form-panel,.table-panel,.filters{box-shadow:0 4px 18px #243a4510}
.panel:hover,.kpis article:hover,.charts article:hover,.form-panel:hover,.table-panel:hover,.filters:hover{border-color:#c1a875;box-shadow:0 8px 22px #243a4514,0 0 0 1px #c1a87518}
input:focus,select:focus{border-color:#b79d6a;box-shadow:0 0 0 3px #c1a87526}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline-color:#c1a875}
tbody tr:hover{background:#faf9f5;box-shadow:inset 2px 0 0 #c1a875}
.secure{background:#edf3ee;color:#486b58}
:root[data-theme="dark"]{--navy:#101e2a;--gold:#c7ad7c;--ink:#e7edf0;--muted:#a4b0b5;--line:#30414b;--paper:#101d27;--surface:#182a36;--surface-soft:#203541;--field:#142530;--table-head:#203541;--text-soft:#bac5c8;--table-text:#d4dfe1}
:root[data-theme="dark"] .topbar{background:#0e1b25}
:root[data-theme="dark"] .heading h1,:root[data-theme="dark"] .charts h2,:root[data-theme="dark"] .table-head h2,:root[data-theme="dark"] .form-panel h2,:root[data-theme="dark"] .login h2{color:#eaf0f1}
:root[data-theme="dark"] .btn{background:#294656}
:root[data-theme="dark"] .btn.light{background:#2b3d48;color:#dce5e6}
:root[data-theme="dark"] .kpis article.revenue{background:#142a37}
:root[data-theme="dark"] .kpis article.revenue strong{color:#d9c69b}


/* Per-visit palette rotation: selected once on each fresh page load */
:root[data-palette="midnight"]{--navy:#172b3a;--gold:#c1a875;--ink:#263b49;--muted:#78858b;--line:#e5e3dc;--paper:#f4f1e9;--surface:#fff;--surface-soft:#f8f7f3;--field:#fff;--table-head:#f1efe8;--text-soft:#65747a;--table-text:#354b57}
:root[data-palette="forest"]{--navy:#23483d;--gold:#b8a27a;--ink:#30443b;--muted:#78877e;--line:#e0e6df;--paper:#f1f4ef;--surface:#fff;--surface-soft:#f5f8f3;--field:#fff;--table-head:#eaf0e9;--text-soft:#5d7165;--table-text:#3e5548}
:root[data-palette="graphite"]{--navy:#34383d;--gold:#bd865c;--ink:#3d4145;--muted:#85898c;--line:#e5e2df;--paper:#f3f1ef;--surface:#fff;--surface-soft:#f8f6f4;--field:#fff;--table-head:#eeeae6;--text-soft:#686b6e;--table-text:#4b4e51}
:root[data-palette="midnight"] .topbar{background:#172b3a}
:root[data-palette="forest"] .topbar{background:#23483d}
:root[data-palette="graphite"] .topbar{background:#34383d}
:root[data-palette="midnight"] .btn{background:#203b4b}
:root[data-palette="forest"] .btn{background:#315d4e}
:root[data-palette="graphite"] .btn{background:#4a5055}
:root[data-palette="midnight"] .kpis article.revenue{background:#203b4b}
:root[data-palette="forest"] .kpis article.revenue{background:#315d4e}
:root[data-palette="graphite"] .kpis article.revenue{background:#4a5055}
:root[data-palette="midnight"] .kpis article.revenue strong{color:#d9c69b}
:root[data-palette="forest"] .kpis article.revenue strong{color:#d8d0ad}
:root[data-palette="graphite"] .kpis article.revenue strong{color:#e2b18a}
:root[data-palette="forest"] .eyebrow,:root[data-palette="forest"] .action{color:#718d72}
:root[data-palette="graphite"] .eyebrow,:root[data-palette="graphite"] .action{color:#a36f4d}
:root[data-palette="forest"] input:focus,:root[data-palette="forest"] select:focus{border-color:#91a98f;box-shadow:0 0 0 3px #91a98f35}
:root[data-palette="graphite"] input:focus,:root[data-palette="graphite"] select:focus{border-color:#bd865c;box-shadow:0 0 0 3px #bd865c35}
:root[data-palette="forest"] tbody tr:hover{background:#f4f8f3;box-shadow:inset 2px 0 0 #91a98f}
:root[data-palette="graphite"] tbody tr:hover{background:#faf7f4;box-shadow:inset 2px 0 0 #bd865c}


/* Dark mode must override the selected palette completely */
html:has(body){min-height:100%;background:#080d13}
body{min-height:100vh;background:var(--paper)}
:root[data-theme="dark"]{
 color-scheme:dark;
 --paper:#080d13;
 --surface:#111a24;
 --surface-soft:#172330;
 --field:#0d151e;
 --table-head:#1a2734;
 --ink:#e7edf3;
 --muted:#91a0af;
 --line:#283746;
 --text-soft:#b6c3cf;
 --table-text:#d3dde6;
 --gold:#c7ad7c;
}
:root[data-theme="dark"] body,
:root[data-theme="dark"] html{background:#080d13!important;color:#e7edf3}
:root[data-theme="dark"] .shell{background:transparent}
:root[data-theme="dark"] .topbar{background:#080d13!important;border-bottom:1px solid #263442}
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .kpis article,
:root[data-theme="dark"] .charts article,
:root[data-theme="dark"] .form-panel,
:root[data-theme="dark"] .table-panel,
:root[data-theme="dark"] .filters,
:root[data-theme="dark"] .login{background:#111a24!important;border-color:#283746;color:#e7edf3}
:root[data-theme="dark"] .kpis article.revenue{background:#172330!important}
:root[data-theme="dark"] .kpis article.revenue strong{color:#dfc99e}
:root[data-theme="dark"] input,
:root[data-theme="dark"] select{background:#0d151e!important;color:#e7edf3!important;border-color:#344555}
:root[data-theme="dark"] th{background:#1a2734!important;color:#b9c6d2}
:root[data-theme="dark"] td{background:transparent;color:#d3dde6;border-top-color:#283746}
:root[data-theme="dark"] tbody tr:hover{background:#1b2a38!important}
:root[data-theme="dark"] .calc,
:root[data-theme="dark"] .upload{background:#172330!important;color:#bdc9d4;border-color:#344555}
:root[data-theme="dark"] .upload b,
:root[data-theme="dark"] .heading h1,
:root[data-theme="dark"] .charts h2,
:root[data-theme="dark"] .table-head h2,
:root[data-theme="dark"] .form-panel h2,
:root[data-theme="dark"] .login h2{color:#edf2f6}
:root[data-theme="dark"] .btn{background:#294354;color:#f4f6f8}
:root[data-theme="dark"] .btn.light{background:#263543;color:#e0e7ed}
:root[data-theme="dark"] .notice{background:#3b2529;color:#ffc4c4}
:root[data-theme="dark"] .notice.success{background:#17382f;color:#a5e2c4}
:root[data-theme="dark"] .secure{background:#17382f;color:#a5e2c4}
:root[data-theme="dark"] .brand-logo{background:#111a24;border-color:#66583c}
:root[data-theme="dark"] footer{border-color:#283746;color:#81909e}
:root[data-theme="dark"] .form-panel form>label,
:root[data-theme="dark"] .form-panel .fields>label,
:root[data-theme="dark"] .login form>label,
:root[data-theme="dark"] .filters>label{background:#172330;color:#bdc9d4}
:root[data-theme="dark"] .import-table-wrap{background:#111a24;border-color:#344555}
:root[data-theme="dark"] .import-table-wrap th{background:#1a2734}


/* Palette-aware dark mode: keep each colour family recognisable, but muted and deep */
:root[data-theme="dark"][data-palette="midnight"]{
 --paper:#080f16;--surface:#111d28;--surface-soft:#192936;--field:#0c1721;--table-head:#1b2b38;
 --ink:#e4ebef;--muted:#91a2ad;--line:#2a3b47;--text-soft:#b5c2ca;--table-text:#d2dde2;
 --navy:#101f2b;--gold:#c7ad7c;
 --dark-top:#080f16;--dark-accent:#1a3040;--dark-hover:#203542;
}
:root[data-theme="dark"][data-palette="forest"]{
 --paper:#09130f;--surface:#12221b;--surface-soft:#1b3026;--field:#0d1a14;--table-head:#20372b;
 --ink:#e3ece5;--muted:#91a398;--line:#2b4436;--text-soft:#b6c8bb;--table-text:#d2e0d5;
 --navy:#14291e;--gold:#b8a27a;
 --dark-top:#09130f;--dark-accent:#1b3829;--dark-hover:#244332;
}
:root[data-theme="dark"][data-palette="graphite"]{
 --paper:#101112;--surface:#1b1d1f;--surface-soft:#282b2e;--field:#151719;--table-head:#2b2e31;
 --ink:#e8e9e9;--muted:#a0a3a5;--line:#3b3e41;--text-soft:#c1c3c4;--table-text:#dedfe0;
 --navy:#25292c;--gold:#bd916e;
 --dark-top:#101112;--dark-accent:#303438;--dark-hover:#383c40;
}
:root[data-theme="dark"] body,:root[data-theme="dark"] html{background:var(--paper)!important;color:var(--ink)}
:root[data-theme="dark"] .topbar{background:var(--dark-top)!important;border-bottom:1px solid var(--line)}
:root[data-theme="dark"] .panel,:root[data-theme="dark"] .kpis article,
:root[data-theme="dark"] .charts article,:root[data-theme="dark"] .form-panel,
:root[data-theme="dark"] .table-panel,:root[data-theme="dark"] .filters,
:root[data-theme="dark"] .login{background:var(--surface)!important;border-color:var(--line);color:var(--ink)}
:root[data-theme="dark"] .kpis article.revenue{background:var(--dark-accent)!important}
:root[data-theme="dark"] input,:root[data-theme="dark"] select{background:var(--field)!important;color:var(--ink)!important;border-color:var(--line)}
:root[data-theme="dark"] th{background:var(--table-head)!important;color:var(--text-soft)}
:root[data-theme="dark"] td{background:transparent;color:var(--table-text);border-top-color:var(--line)}
:root[data-theme="dark"] tbody tr:hover{background:var(--dark-hover)!important}
:root[data-theme="dark"] .calc,:root[data-theme="dark"] .upload,
:root[data-theme="dark"] .form-panel form>label,:root[data-theme="dark"] .form-panel .fields>label,
:root[data-theme="dark"] .login form>label,:root[data-theme="dark"] .filters>label{
 background:var(--surface-soft)!important;color:var(--text-soft);border-color:var(--line)
}
:root[data-theme="dark"] .upload b,:root[data-theme="dark"] .heading h1,
:root[data-theme="dark"] .charts h2,:root[data-theme="dark"] .table-head h2,
:root[data-theme="dark"] .form-panel h2,:root[data-theme="dark"] .login h2{color:var(--ink)}
:root[data-theme="dark"] .btn{background:var(--dark-accent);color:var(--ink)}
:root[data-theme="dark"] .btn.light{background:var(--surface-soft);color:var(--ink)}
:root[data-theme="dark"] .brand-logo{background:var(--surface);border-color:var(--line)}
:root[data-theme="dark"] .import-table-wrap{background:var(--surface);border-color:var(--line)}
:root[data-theme="dark"] .import-table-wrap th{background:var(--table-head)}
:root[data-theme="dark"] footer{border-color:var(--line);color:var(--muted)}


/* Main dashboard section tabs */
.topbar-brand-group{display:flex;align-items:center;min-width:0;gap:0}
.business-tabs{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:flex;align-items:center;gap:5px;padding:5px;border:1px solid #ffffff24;border-radius:11px;background:#00000018;z-index:2}
.business-tab{position:relative;border:1px solid transparent;border-radius:7px;padding:10px 19px;background:transparent;color:#e5e9e9;font:600 12px 'DM Sans',sans-serif;letter-spacing:.15px;white-space:nowrap;cursor:pointer;transition:background .18s ease,color .18s ease,border-color .18s ease,transform .18s ease,box-shadow .18s ease}
.business-tab:hover{background:#ffffff12;border-color:#ffffff20;transform:translateY(-1px)}
.business-tab.active{background:var(--surface);border-color:var(--gold);color:var(--navy);box-shadow:0 3px 12px #00000020,inset 0 0 0 1px #c1a87522}
.business-tab.active:hover{background:var(--surface);color:var(--navy)}
:root[data-theme="dark"] .business-tab.active{background:var(--surface);color:var(--ink);border-color:var(--gold)}
.tab-placeholder{max-width:760px;margin:58px auto;padding:48px 30px;text-align:center}
.tab-placeholder h1{margin:0 0 10px;color:var(--navy);font:800 27px Manrope}
.tab-placeholder p:last-child{margin:0}
:root[data-theme="dark"] .tab-placeholder h1{color:var(--ink)}
@media(max-width:760px){
 .topbar{height:auto;min-height:74px;gap:12px;padding:10px 3vw;flex-wrap:wrap}
 .topbar-brand-group{gap:0;flex:1 1 auto}
 .business-tabs{position:static;left:auto;top:auto;transform:none;gap:2px;padding:3px;margin:0 auto}
 .business-tab{padding:9px 12px;font-size:11px}
 .topbar nav{gap:10px}
}
@media(max-width:560px){
 .topbar-brand-group{width:100%;justify-content:space-between;gap:10px}
 .business-tabs{flex:1;justify-content:center}
 .business-tab{flex:1;padding:9px 7px;font-size:10px}
 .topbar nav{width:100%;justify-content:flex-end}
 .tab-placeholder{margin:30px auto;padding:34px 20px}
}


/* Full-dashboard email + password access gate */
body.dashboard-locked{overflow:hidden}body.auth-pending #authGate{visibility:hidden}
body.dashboard-locked>.topbar,body.dashboard-locked>.shell{visibility:hidden}
.auth-gate{position:fixed;inset:0;z-index:9999;display:grid;place-items:center;padding:24px;background:radial-gradient(ellipse at 50% 0%,#bca77a20,transparent 55%),var(--paper)}
.auth-gate.hidden{display:none}
.auth-card{width:min(430px,100%);padding:38px;border:1px solid var(--gold);border-radius:18px;background:var(--surface);box-shadow:0 24px 70px #0002;text-align:left}
.auth-logo{margin:0 auto 28px;width:164px;height:60px}
.auth-card>.eyebrow{text-align:center;letter-spacing:2px}
.auth-card h1{text-align:center;margin:8px 0;color:var(--ink);font:800 29px Manrope,sans-serif}
.auth-card>.muted{text-align:center;line-height:1.6;margin:0 0 25px}
.auth-card form{display:grid;gap:15px}
.auth-card label{display:grid;gap:7px;color:var(--text-soft);font-size:12px;font-weight:700}
.auth-card input{width:100%;box-sizing:border-box;padding:13px 14px;border:1px solid var(--line);border-radius:8px;background:var(--field);color:var(--ink);font:inherit}
.auth-card .btn{width:100%;margin-top:7px;padding:13px}
.auth-card>small{display:block;text-align:center;margin-top:22px;color:var(--muted);font-size:10px;letter-spacing:.5px}
@media(max-width:480px){.auth-card{padding:28px 22px}}


/* Minimal login theme switch, floating at the top-right and blended into the page */
.login-appearance{
  position:absolute;top:22px;right:28px;z-index:2;
  display:flex;align-items:center;justify-content:flex-end;gap:5px;
  margin:0;padding:0;border:0;border-radius:0;background:transparent;
}
.login-appearance>span{display:none}
.appearance-choice{
  border:0;border-radius:6px;padding:7px 9px;
  background:transparent;color:var(--text-soft);
  font:600 11px 'DM Sans',sans-serif;cursor:pointer;
  opacity:.78;transition:color .16s ease,opacity .16s ease,transform .16s ease;
}
.appearance-choice:hover{transform:translateY(-1px);color:var(--gold);opacity:1}
.appearance-choice.active{
  color:var(--ink);opacity:1;background:transparent;
  box-shadow:inset 0 -2px 0 var(--gold);border-radius:0;
}
:root[data-theme="dark"] .appearance-choice{color:#cbd4d9}
:root[data-theme="dark"] .appearance-choice.active{color:#f2dfbd}
@media(max-width:560px){.login-appearance{top:12px;right:12px}.appearance-choice{padding:7px;font-size:10px}}
