/* ICON BNG themes. The whole portal is drawn from the colour variables of panel.css; a theme only changes them.
   Light themes: accent colours + sidebar. Dark theme (Midnight): also the surfaces and the pastel boxes. Chosen with data-theme on <html> (theme.js, themes.js). */
.nav a.on{background:linear-gradient(90deg,color-mix(in srgb,var(--red) 30%,transparent),color-mix(in srgb,var(--blue) 20%,transparent))}
.nav a.on i{color:color-mix(in srgb,var(--red) 55%,#fff)}
.mbox input:focus{border-color:var(--red);box-shadow:0 0 0 3px color-mix(in srgb,var(--red) 16%,transparent)}
.seg button.on{background:var(--blue)}
table tbody tr:nth-child(even) td{background:color-mix(in srgb,var(--blue) 5%,var(--card))}
table tbody tr:nth-child(odd) td{background:var(--card)}
table tbody tr:hover td,table tbody tr:nth-child(even):hover td,table tbody tr:nth-child(odd):hover td{background:color-mix(in srgb,var(--blue) 12%,var(--card))}
.tab:hover{background:color-mix(in srgb,var(--blue) 7%,var(--card))}
.tab.on{background:var(--card);color:var(--blue)}
.tab.on{border-bottom-color:var(--card)}

/* ---- one header colour per theme (default ICON blue = --blue) ---- */
[data-theme=ocean]{--thead:#0E7490}[data-theme=emerald]{--thead:#047857}[data-theme=violet]{--thead:#5B21B6}[data-theme=royal]{--thead:#1E3A8A}[data-theme=sunset]{--thead:#C2410C}[data-theme=midnight]{--thead:#25365A}
/* blue pills, small counters, info boxes: follow the theme accent in every theme except the default */
html[data-theme] .tag.blue,html[data-theme] .tab small,html[data-theme] .cat.c-pppoe,html[data-theme] .fl .S{background:color-mix(in srgb,var(--blue) 13%,var(--card));color:var(--blue-d)}
html[data-theme] [style*="background:#f6f8ff"],html[data-theme] [style*="background:#f0f7ff"],html[data-theme] [style*="background:#eef2ff"],html[data-theme] [style*="background:#e8f0fe"],html[data-theme] [style*="background:#f6f8fb"]{background:color-mix(in srgb,var(--blue) 9%,var(--card))!important;border-color:color-mix(in srgb,var(--blue) 25%,var(--line))!important}
html[data-theme] [style*="color:#2d3fa0"],html[data-theme] [style*="color:#1d3f8f"],html[data-theme] [style*="color:#1a56c4"]{color:var(--blue-d)!important}
html[data-theme] .eye:hover,html[data-theme] .bfoot,html[data-theme] a.lnk{color:var(--blue)}
/* ---- light themes ---- */
[data-theme=ocean]{--red:#0891B2;--red-d:#0e7490;--blue:#1D4ED8;--blue-d:#1e3a8a;--nav:#0b2545;--nav-2:#13315c;--bg:#F3F8FD;--grad:linear-gradient(135deg,#0891B2 0%,#1D4ED8 100%)}
[data-theme=emerald]{--red:#059669;--red-d:#047857;--blue:#0F766E;--blue-d:#115e59;--nav:#0b2a24;--nav-2:#123b33;--bg:#F2FAF7;--grad:linear-gradient(135deg,#10B981 0%,#0F766E 100%)}
[data-theme=violet]{--red:#9333EA;--red-d:#7e22ce;--blue:#4338CA;--blue-d:#3730a3;--nav:#1e1b3a;--nav-2:#2a2652;--bg:#F7F5FF;--grad:linear-gradient(135deg,#9333EA 0%,#4338CA 100%)}
[data-theme=royal]{--red:#D4A017;--red-d:#b8860b;--blue:#1E3A8A;--blue-d:#172a63;--nav:#0f1b3d;--nav-2:#18285a;--bg:#F8F7F1;--grad:linear-gradient(135deg,#D4A017 0%,#1E3A8A 100%)}
[data-theme=sunset]{--red:#EA580C;--red-d:#c2410c;--blue:#BE123C;--blue-d:#9f1239;--nav:#2b1a14;--nav-2:#3b241b;--bg:#FFF8F3;--grad:linear-gradient(135deg,#F97316 0%,#BE123C 100%)}

/* ---- dark theme ---- */
[data-theme=midnight]{color-scheme:dark;--red:#F2555F;--red-d:#d63f49;--blue:#5B9BFF;--blue-d:#3b7fe6;--ink:#E6EAF2;--muted:#9AA6BD;--line:#27334D;--bg:#0A101D;--card:#121B2E;--nav:#070C17;--nav-2:#0F1830;--grad:linear-gradient(135deg,#E11D48 0%,#2563EB 100%);--ok:#34D399;--warn:#FBBF24;--err:#F87171}
[data-theme=midnight] body,[data-theme=midnight] .app,[data-theme=midnight] .main{background:var(--bg);color:var(--ink)}
[data-theme=midnight] .top,[data-theme=midnight] .panel,[data-theme=midnight] .kpi,[data-theme=midnight] .login-card,[data-theme=midnight] .bellbox,[data-theme=midnight] .bellpop,[data-theme=midnight] .mbox,[data-theme=midnight] .tpop,[data-theme=midnight] .hd,[data-theme=midnight] .card{background:var(--card);color:var(--ink);border-color:var(--line)}
[data-theme=midnight] .btn,[data-theme=midnight] .ib,[data-theme=midnight] .rf select,[data-theme=midnight] .range button,[data-theme=midnight] .seg button,[data-theme=midnight] .pchip,[data-theme=midnight] .input input,[data-theme=midnight] .form-row input,[data-theme=midnight] .form-row select,[data-theme=midnight] .fcell input:not([type=checkbox]),[data-theme=midnight] .fcell select,[data-theme=midnight] .mbox input,[data-theme=midnight] select,[data-theme=midnight] textarea,[data-theme=midnight] input:not([type=checkbox]):not([type=radio]){background:#0E1626;color:var(--ink);border-color:var(--line)}
[data-theme=midnight] .btn:hover,[data-theme=midnight] .pchip:hover,[data-theme=midnight] .eye:hover,[data-theme=midnight] .bn:hover,[data-theme=midnight] .bitem:hover{background:#1A2640}
[data-theme=midnight] .btn.pri,[data-theme=midnight] a.btn.pri{color:#fff;background:var(--grad)}
[data-theme=midnight] .btn.danger{color:#FCA5A5;border-color:#5b2a2f}
[data-theme=midnight] .wbar,[data-theme=midnight] .bsec,[data-theme=midnight] .bfoot,[data-theme=midnight] .chip,[data-theme=midnight] .pager,[data-theme=midnight] .code,[data-theme=midnight] .hb code{background:#0E1626;color:var(--ink);border-color:var(--line)}
[data-theme=midnight] table thead th{background:var(--thead);color:#fff;border-color:var(--thead)}
[data-theme=midnight] table td{border-color:var(--line)}
[data-theme=midnight] .bar{background:#1A2640}
[data-theme=midnight] .tag.ok,[data-theme=midnight] .dl.up{background:rgba(52,211,153,.15);color:#6EE7B7}
[data-theme=midnight] .tag.warn,[data-theme=midnight] .fl .N,[data-theme=midnight] .note{background:rgba(251,191,36,.13);color:#FCD34D;border-color:rgba(251,191,36,.25)}
[data-theme=midnight] .tag.err,[data-theme=midnight] .dl.dn,[data-theme=midnight] .fl .X,[data-theme=midnight] .selbar,[data-theme=midnight] .login-err,[data-theme=midnight] #alertbar .al.err{background:rgba(248,113,113,.14);color:#FCA5A5;border-color:rgba(248,113,113,.3)}
html[data-theme=midnight] .tag.blue,html[data-theme=midnight] .tab small,html[data-theme=midnight] .fl .S,html[data-theme=midnight] .cat.c-pppoe,[data-theme=midnight] .c-search,[data-theme=midnight] .c-shop{background:rgba(91,155,255,.16);color:#93C5FD}
[data-theme=midnight] .tag.mute,[data-theme=midnight] .dl.fl{background:#1A2640;color:#B6C0D4}
[data-theme=midnight] .tag.purple,[data-theme=midnight] .cat.c-ipoe,[data-theme=midnight] .c-social{background:rgba(167,139,250,.16);color:#C4B5FD}
[data-theme=midnight] .c-video{background:rgba(248,113,113,.14);color:#FCA5A5}[data-theme=midnight] .c-cdn,[data-theme=midnight] .c-gov{background:rgba(52,211,153,.14);color:#6EE7B7}[data-theme=midnight] .c-ads{background:rgba(251,191,36,.13);color:#FCD34D}
[data-theme=midnight] #alertbar .al.warn{background:rgba(251,191,36,.13);color:#FCD34D;border-color:rgba(251,191,36,.25)}
[data-theme=midnight] .tab.on{background:var(--card);color:var(--blue);border-color:var(--line);border-bottom-color:var(--card)}
[data-theme=midnight] .toast{background:#E6EAF2;color:#0A101D}
[data-theme=midnight] a{color:var(--blue)}[data-theme=midnight] .nav a,[data-theme=midnight] .btn,[data-theme=midnight] .tab,[data-theme=midnight] a.btn,[data-theme=midnight] .bitem,[data-theme=midnight] .bfoot{color:inherit}[data-theme=midnight] a.btn.pri{color:#fff}
[data-theme=midnight] .tty{background:#05080F}
[data-theme=midnight] .kpi .v,[data-theme=midnight] h1,[data-theme=midnight] h3,[data-theme=midnight] .who{color:#F3F6FB}
/* inline pastel boxes written by the pages */
[data-theme=midnight] [style*="background:#fef3f2"]{background:rgba(248,113,113,.14)!important;color:#FCA5A5!important}
[data-theme=midnight] [style*="background:#fffaeb"],[data-theme=midnight] [style*="background:#fff1e0"]{background:rgba(251,191,36,.13)!important;color:#FCD34D!important}
[data-theme=midnight] [style*="background:#f6f8ff"],[data-theme=midnight] [style*="background:#f0f7ff"],[data-theme=midnight] [style*="background:#eef2ff"],[data-theme=midnight] [style*="background:#e8f0fe"],[data-theme=midnight] [style*="background:#f6f8fb"]{background:rgba(91,155,255,.12)!important;color:#BFD7FF!important}
[data-theme=midnight] [style*="background:#f0fbf5"],[data-theme=midnight] [style*="background:#ecfdf3"]{background:rgba(52,211,153,.13)!important;color:#6EE7B7!important}
[data-theme=midnight] [style*="color:#b42318"]{color:#FCA5A5!important}[data-theme=midnight] [style*="color:#2d3fa0"],[data-theme=midnight] [style*="color:#1d3f8f"],[data-theme=midnight] [style*="color:#1a56c4"]{color:#93C5FD!important}[data-theme=midnight] [style*="color:#067647"]{color:#6EE7B7!important}[data-theme=midnight] [style*="color:#7a4a05"],[data-theme=midnight] [style*="color:#b54708"],[data-theme=midnight] [style*="color:#b45309"]{color:#FCD34D!important}
[data-theme=midnight] iframe#xfr{background:#fff}

/* ---- the theme picker ---- */
#thmwrap{position:relative}
#thmbox{position:absolute;right:0;top:calc(100% + 8px);width:250px;background:var(--card);border:1px solid var(--line);border-radius:14px;box-shadow:0 14px 40px rgba(10,16,40,.22);padding:8px;z-index:50}
#thmbox h6{margin:6px 8px 8px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.thmopt{display:flex;align-items:center;gap:12px;width:100%;padding:8px 10px;border:0;background:none;border-radius:10px;cursor:pointer;color:var(--ink);font:inherit;text-align:left}
.thmopt:hover{background:color-mix(in srgb,var(--blue) 9%,var(--card))}.thmopt.on{background:color-mix(in srgb,var(--blue) 14%,var(--card));font-weight:700}
.thmsw{width:38px;height:26px;border-radius:8px;flex:none;border:1px solid rgba(0,0,0,.12);display:flex;overflow:hidden}.thmsw i{flex:1}.thmopt .ck{margin-left:auto;color:var(--blue);visibility:hidden}.thmopt.on .ck{visibility:visible}
