:root{--blue:#2487f7;--blue-dark:#1675df;--nav:#0e1015;--nav-soft:#171b24;--bg:#f4f6f9;--card:#fff;--text:#273247;--muted:#8e9ab0;--line:#e3e8f0;--green:#15c86f;--purple:#7b46f2;--gold:#c9a000}
html{zoom:1.4}
.xtream-box{display:none!important}
.content>section{display:none}.content>section.route-active{display:block}
#novo .auto-note,#novo .targets-head,#novo .providers{display:none}
.action-square svg{width:12px;height:12px;display:block;fill:currentColor}
.top-winner{display:flex;align-items:center;gap:7px;margin-left:auto;margin-right:18px;padding:3px 10px;border-radius:4px;background:#edf7ff}.top-winner span{font-size:7px;color:#7890aa;text-transform:uppercase}.top-winner strong{font-size:8px;color:var(--blue)}.top-winner small{font-size:7px;color:#7d899b}
.client-actions button.action-square{border:0;padding:0;cursor:pointer}.client-actions button.action-square:disabled{opacity:.55}.m3u-dialog{width:min(560px,90vw);border:0;border-radius:8px;padding:18px;box-shadow:0 18px 60px #0d172b55}.m3u-dialog::backdrop{background:#07101e99}.m3u-dialog-head{display:flex;align-items:flex-start;justify-content:space-between}.m3u-dialog-head span{font-size:7px;font-weight:900;color:var(--blue);letter-spacing:.12em}.m3u-dialog-head h2{margin:4px 0;font-size:14px}.m3u-dialog-head button{border:0;background:transparent;font-size:20px;color:#8290a5;cursor:pointer}.m3u-dialog p{color:#718097;font-size:8px}.m3u-dialog input{width:100%;height:36px;border:1px solid var(--line);border-radius:4px;padding:0 10px;margin:8px 0 12px;color:#26344c;font-size:8px}
.action-square.off{background:#e2465b}.status-active.disabled{border-color:#e2465b;color:#e2465b}.edit-client-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.edit-client-dialog label{display:block;color:#718097;font-size:8px}.edit-client-dialog select{width:100%;height:36px;margin:8px 0 12px;border:1px solid var(--line);border-radius:4px;padding:0 10px;background:#fff;color:#26344c}.edit-client-dialog .add-button{width:100%}
.m3u-loading{margin:10px 0;padding:9px;border-radius:5px;background:#eef6ff}.m3u-loading span{display:block;height:4px;border-radius:4px;background:linear-gradient(90deg,#178bff 0 35%,#a7d5ff 50%,#178bff 65% 100%);background-size:200% 100%;animation:m3u-progress 1s linear infinite}.m3u-loading small{display:block;margin-top:6px;color:#3979bd;font-size:8px}.m3u-feedback{color:#d33!important}.m3u-loading[hidden]{display:none}@keyframes m3u-progress{to{background-position:-200% 0}}
.xtream-box{margin-top:16px;padding-top:14px;border-top:1px solid var(--line);display:grid;grid-template-columns:1fr 1fr;gap:8px}.xtream-box>strong,.xtream-box>button{grid-column:1/-1}.xtream-box strong{font-size:9px;color:#26344c}.xtream-box label{font-size:7px;color:#718097}.xtream-box label:first-of-type{grid-column:1/-1}.xtream-box input{margin:4px 0 0}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--text);font:12px Inter,Segoe UI,Arial,sans-serif;touch-action:manipulation}.sidebar{position:fixed;inset:0 auto 0 0;width:178px;background:var(--nav);color:#fff;padding:9px 8px;display:flex;flex-direction:column;z-index:10}.mini-brand{display:flex;align-items:center;gap:8px;height:28px;padding:0 7px}.mini-brand>span{display:grid;place-items:center;width:24px;height:24px;border-radius:6px;background:linear-gradient(135deg,#3aa9ff,#51d7e8);font-size:9px;font-weight:900}.mini-brand b{font-family:Georgia,serif;font-size:11px}.account-block{display:grid;gap:3px;padding:25px 7px 12px}.account-block strong{font-size:9px}.account-block span{font-size:8px}.account-block em{font-size:8px;color:#20e180;font-style:normal}.account-block small{width:max-content;padding:2px 5px;border-radius:3px;background:#f8f8f8;color:#e22755;font-size:7px}.quick-search{display:flex;align-items:center;gap:7px;width:100%;height:29px;border:0;border-radius:5px;background:#1b2030;color:#6f7d99;padding:0 8px;font-size:8px}.quick-search span{flex:1;text-align:left}.quick-search kbd{font:7px inherit}.nav-label{margin:15px 7px 6px;color:#7890bd;text-transform:uppercase;letter-spacing:.12em;font-size:7px}.sidebar nav{display:grid;gap:3px}.sidebar nav a{padding:8px;border-radius:5px;color:#9ba9c1;text-decoration:none;font-size:8px;font-weight:600}.sidebar nav a:hover,.sidebar nav a.active{background:var(--blue);color:#fff}.sidebar-spacer{flex:1}.bottom-nav{border-top:1px solid #202632;padding-top:8px}.workspace{margin-left:178px;min-height:100vh}.topbar{height:36px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 20px;position:sticky;top:0;z-index:8}.topbar h1{font-size:12px;margin:0;color:#101827}.top-actions{display:flex;gap:12px}.top-actions button{border:0;background:transparent;color:#a9b5c8;font-size:9px}.content{padding:10px 8px 28px}.panel{background:#fff;border:1px solid var(--line);border-radius:7px;padding:13px;margin-bottom:14px;box-shadow:0 2px 7px #1c2d4a08}.filter-grid{display:grid;grid-template-columns:1.1fr 1.1fr 1.1fr .38fr .68fr;gap:7px}.filter-grid label,.form-grid label,.test-controls label{font-size:8px;color:#6e7d96}.filter-grid input,.filter-grid select,.form-grid input,.form-grid select,.test-controls select{width:100%;height:28px;border:1px solid #dce2eb;border-radius:3px;background:#fff;color:#78869c;padding:0 10px;outline:none;font-size:8px}.filter-grid input:focus,.filter-grid select:focus,.form-grid input:focus,.form-grid select:focus{border-color:var(--blue)}.search-field{display:flex;align-items:center;gap:7px;padding-left:10px;border-radius:3px;background:#f7f8fa}.search-field input{border:0;background:transparent;padding-left:0}.date-filter{display:grid;grid-template-columns:1fr auto 1fr;align-items:center}.date-filter span{margin:0 6px;color:#a5afbf}.muted-button,.cards-button,.add-button{display:inline-flex;align-items:center;justify-content:center;height:28px;border:0;border-radius:3px;padding:0 12px;font-size:8px;font-weight:700;text-decoration:none;cursor:pointer}.muted-button{background:#e3e7ef;color:#738099}.add-button,.cards-button{background:var(--blue);color:#fff}.add-button:hover,.cards-button:hover{background:var(--blue-dark)}.cards-button{grid-column:4/6}.list-head{display:flex;align-items:center;justify-content:space-between;margin:12px 0 5px}.list-head select{height:26px;border:0;background:#f7f8fa;color:#51617b;font-size:8px}.list-head span{font-size:8px;color:#121b2b}.client-columns{display:grid;grid-template-columns:1.1fr 1fr .42fr 1.75fr 1.35fr;padding:6px 0;border-bottom:1px dashed var(--line);color:#b1bdd1;font-size:7px;font-weight:800}.client-columns span:last-child{text-align:right}.client-folder{display:grid}.client-card{display:grid;grid-template-columns:1.1fr 1fr .42fr 1.75fr 1.35fr;align-items:center;min-height:72px;padding:8px 0;border-bottom:1px solid #edf0f5}.client-card:last-child{border-bottom:0}.client-main h3{font-size:9px;color:var(--blue);margin:0 0 5px}.client-main span{display:block;font-size:7px;color:#6e7e98;margin-top:3px}.client-date b,.client-date span{display:block}.client-date b{font-size:8px;font-weight:500}.client-date span{font-size:6px;color:#9aa6b8;margin-top:6px}.status-stack{display:grid;justify-items:start;gap:3px}.status-active,.status-type{border:1px solid var(--green);color:var(--green);border-radius:4px;padding:2px 4px;font-size:7px}.status-type{border-color:var(--purple);color:var(--purple)}.client-details span{display:block;margin:3px 0;color:#6f7c92;font-size:7px}.client-actions{display:flex;gap:4px;justify-content:flex-end;flex-wrap:wrap}.action-square{display:grid;place-items:center;width:23px;height:23px;border-radius:4px;background:#182334;color:#fff;font-size:8px}.action-square.blue{background:var(--blue)}.action-square.gold{background:var(--gold)}.action-square.purple{background:var(--purple)}.action-square.green{background:var(--green)}.action-more{height:23px;border:0;border-radius:4px;background:var(--blue);color:#fff;font-size:7px;padding:0 10px}.client-card details{grid-column:1/-1;margin-top:5px}.client-card summary{cursor:pointer;color:var(--blue);font-size:7px;font-weight:700}.variants-wrap{overflow:auto;margin:8px 0 3px;padding:8px;background:#f8fafc;border-radius:5px}.variants-wrap table{width:100%;border-collapse:collapse}.variants-wrap th,.variants-wrap td{text-align:left;padding:6px;border-bottom:1px solid var(--line);font-size:7px}.variants-wrap th{color:#9aa8bc}.variant-ok{color:var(--green)}.dashboard-block{margin:14px 0}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.cards article{background:#fff;border:1px solid var(--line);border-radius:6px;padding:12px}.cards article span,.cards article small{display:block;color:var(--muted);font-size:7px}.cards article strong{display:block;margin:5px 0;font-size:18px}.winner-banner{display:flex;justify-content:space-between;align-items:center;margin-top:8px;padding:14px;border-radius:6px;background:linear-gradient(135deg,#192b49,#214570);color:#fff}.winner-banner h2{margin:3px 0;font-size:13px}.winner-banner p{margin:0;color:#a8bbd4;font-size:7px}.winner-banner>span{padding:5px 8px;border-radius:12px;background:#ffffff14;color:#a8bbd4;font-size:7px}.winner-banner>span.active{background:#18c66c2d;color:#6ce8a8}.eyebrow{margin:0;color:var(--blue);font-size:7px;font-weight:900;letter-spacing:.12em}.panel-title{display:flex;align-items:center;justify-content:space-between;padding-bottom:10px;border-bottom:1px solid var(--line);margin-bottom:12px}.panel-title h2{margin:3px 0 0;font-size:13px}.pill{padding:4px 7px;border-radius:10px;background:#eaf4ff;color:var(--blue);font-size:7px;font-weight:800}.form-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}.form-grid label,.test-controls label{font-weight:700}.form-grid input,.form-grid select,.test-controls select{display:block;margin-top:6px}.auto-note{margin:10px 0;padding:8px;border-radius:4px;background:#eff7ff;color:#3979bd;font-size:7px}.targets-head,.submit-row{display:flex;align-items:center;justify-content:space-between;margin-top:14px}.targets-head h3{margin:0;font-size:9px}.targets-head p,.submit-row p{margin:3px 0 0;color:var(--muted);font-size:7px}.providers{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-top:8px}.provider{display:flex;align-items:center;gap:7px;border:1px solid var(--line);border-radius:4px;padding:8px;background:#fbfcfe;cursor:pointer}.provider input{display:none}.check{display:grid;place-items:center;width:15px;height:15px;border:1px solid #cbd4e1;border-radius:3px;color:transparent}.provider input:checked+.check{background:var(--blue);border-color:var(--blue);color:#fff}.provider-copy{flex:1}.provider-copy b,.provider-copy small{display:block}.provider-copy b{font-size:7px}.provider-copy small{font-size:6px;color:var(--muted);margin-top:2px}.provider i{width:5px;height:5px;border-radius:50%;background:#f0a330}.provider.ready i{background:var(--green)}.test-controls{display:grid;grid-template-columns:1.4fr 1fr auto;gap:12px;align-items:end}.test-controls>div b,.test-controls>div span{display:block;font-size:8px}.test-controls>div span{color:var(--muted);font-size:7px;margin-top:5px}.round-progress{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-top:10px}.round-progress>div{padding:8px;border:1px solid var(--line);border-radius:4px}.round-progress b,.round-progress span{display:block;font-size:7px}.round-progress span{color:var(--muted);margin-top:3px}.round-progress .testing{border-color:var(--blue);background:#eef7ff}.round-progress .tested{border-color:#a8e6c3;background:#f0fbf5}.round-ranking{margin-top:12px}.round-ranking h3{font-size:9px}.round-ranking>div{display:grid;grid-template-columns:35px 1fr auto auto;gap:10px;padding:7px;border-bottom:1px solid var(--line);font-size:7px}.server-table>div,.history>div{display:grid;grid-template-columns:30px 1fr 2fr auto;align-items:center;padding:8px;border-bottom:1px solid var(--line);font-size:8px}.server-table em{font-style:normal;border-radius:8px;padding:3px 6px;font-size:7px}.server-table em.ok{background:#e8f9f0;color:#159957}.server-table em.wait{background:#fff4e5;color:#b96d15}.history .history-item{grid-template-columns:1fr auto}.history-item details{grid-column:1/-1}.history-item summary{color:var(--blue);cursor:pointer}.credential-list{display:grid;grid-template-columns:repeat(2,1fr);gap:5px;list-style:none;padding:0}.credential-list li{display:grid;grid-template-columns:1fr auto auto;gap:8px;padding:7px;background:#f8fafc}.login-page{min-height:100vh;display:grid;place-items:center;background:#101319}.login-shell{margin:0;width:min(380px,92%)}.login-card{background:#fff;border-radius:8px;padding:28px}.login-logo{display:block;width:92px;height:auto;border-radius:7px;object-fit:cover;box-shadow:0 5px 16px #0b1e3d33}.login-card h1{font-size:18px}.login-intro{color:var(--muted)}.login-card form{display:grid;gap:12px}.login-card input{width:100%;height:36px;border:1px solid var(--line);border-radius:4px;margin-top:5px;padding:0 10px}.login-card .primary{height:36px;border:0;border-radius:4px;background:var(--blue);color:#fff}.login-card #loginFeedback{color:#d33}
@media(max-width:900px){.sidebar{width:150px}.workspace{margin-left:150px}.filter-grid{grid-template-columns:repeat(2,1fr)}.cards-button{grid-column:auto}.client-columns{display:none}.client-card{grid-template-columns:1fr auto;gap:7px}.client-date,.client-details{display:none}.status-stack{justify-self:end}.client-actions{grid-column:1/-1;justify-content:flex-start}.providers,.round-progress{grid-template-columns:repeat(2,1fr)}.form-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:620px){.sidebar{position:static;width:auto;min-height:auto}.account-block,.quick-search,.nav-label,.sidebar-spacer,.bottom-nav{display:none}.sidebar nav{display:flex;overflow:auto}.workspace{margin:0}.topbar{position:static}.content{padding:6px}.filter-grid,.form-grid,.test-controls,.cards{grid-template-columns:1fr}.providers,.round-progress{grid-template-columns:1fr}.client-card{padding:10px}.winner-banner{align-items:flex-start;gap:10px}.credential-list{grid-template-columns:1fr}}
.family-toggle{width:23px;height:23px;border:1px solid #cbd5e1;border-radius:4px;background:#e2e8f0;color:#64748b;font-size:7px;font-weight:800;cursor:pointer}.family-toggle.enabled{background:#16c76b;border-color:#16c76b;color:#fff}
.client-name-title{display:inline-block;padding:3px 7px!important;border-radius:5px;background:#eaf5ff;color:#0878ed!important;box-shadow:inset 3px 0 #238df5}.client-login b{color:#17243a;font-size:1.08em}
.client-main .expiry-highlight{display:inline-flex;align-items:center;width:max-content;margin-top:6px;padding:4px 7px;border-radius:5px;background:#fff3d6;color:#9a5b00;font-weight:700;border:1px solid #ffd77a}.client-main .expiry-highlight b{margin-left:4px;font-size:1.12em}.client-main .expiry-highlight.expired{background:#ffe5e8;color:#c41e3a;border-color:#ff9bab}
[data-theme="dark"]{color-scheme:dark;--bg:#090d14;--card:#111827;--text:#e5edf9;--muted:#8fa0b8;--line:#263247;--nav:#070a0f;--nav-soft:#111827}
[data-theme="dark"] body{background:#090d14;color:var(--text)}
[data-theme="dark"] .topbar,[data-theme="dark"] .panel,[data-theme="dark"] .cards article,[data-theme="dark"] .m3u-dialog{background:#111827;color:#e5edf9;border-color:#263247}
[data-theme="dark"] .topbar h1,[data-theme="dark"] .list-head span,[data-theme="dark"] .m3u-dialog-head h2,[data-theme="dark"] .xtream-box strong{color:#f5f8ff}
[data-theme="dark"] .filter-grid input,[data-theme="dark"] .filter-grid select,[data-theme="dark"] .form-grid input,[data-theme="dark"] .form-grid select,[data-theme="dark"] .test-controls select,[data-theme="dark"] .m3u-dialog input{background:#0b1220;color:#dce7f7;border-color:#344158}
[data-theme="dark"] .edit-client-dialog select{background:#0b1220;color:#dce7f7;border-color:#344158}
[data-theme="dark"] .search-field,[data-theme="dark"] .list-head select,[data-theme="dark"] .variants-wrap,[data-theme="dark"] .credential-list li{background:#0b1220;color:#cbd8ea}
[data-theme="dark"] .client-card{border-color:#263247}
[data-theme="dark"] .client-main span,[data-theme="dark"] .client-details span,[data-theme="dark"] .client-date span{color:#9aacbf}
[data-theme="dark"] .client-login b{color:#f3f7ff}
[data-theme="dark"] .client-name-title{background:linear-gradient(90deg,#103256,#14243b);color:#62b8ff!important;box-shadow:inset 3px 0 #33a2ff}
[data-theme="dark"] .client-main .expiry-highlight{background:#3b2b0c;color:#ffd36b;border-color:#73571f}
[data-theme="dark"] .client-main .expiry-highlight.expired{background:#421722;color:#ff9cad;border-color:#7b2a3b}
[data-theme="dark"] .top-winner{background:#142238;border-color:#2a3b54}
[data-theme="dark"] .winner-cluster .family-active{background:linear-gradient(135deg,#12314f,#17263a);border-color:#37cfff}
[data-theme="dark"] .muted-button{background:#273247;color:#c0cce0}
[data-theme="dark"] .provider{background:#0d1523;border-color:#2a3549}
[data-theme="dark"] .m3u-loading{background:#102844}
[data-theme="dark"] .xtream-box{border-color:#2a3549}
.winner-cluster{display:flex;align-items:center;gap:5px;margin-left:auto;margin-right:12px}.winner-cluster .top-winner{margin:0;padding:4px 8px;border:1px solid #dce9f7;transition:.2s}.winner-cluster .family-card{min-width:105px}.winner-cluster .global-card{min-width:145px}.winner-cluster .family-active{border-color:#37cfff;background:linear-gradient(135deg,#e8f8ff,#fff);box-shadow:0 0 12px #28baff88,0 0 2px #178bff inset}.winner-cluster .family-active strong{color:#0878ed;text-shadow:0 0 8px #4acfff99}.family-toggle.serving{background:#fff;color:#0a8bf0;border-color:#45cfff;box-shadow:0 0 10px #20bfff,0 0 0 2px #c6f3ff;font-size:8px}
.family-master{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px;margin:0 0 10px;border:1px solid var(--line);border-radius:5px;background:#f8fafc}.family-master b,.family-master small{display:block}.family-master b{font-size:9px}.family-master small{margin-top:3px;font-size:7px;color:var(--muted)}#globalFamilyControls{display:flex;gap:5px;flex-wrap:wrap}.global-family-toggle{border:0;border-radius:4px;padding:7px 9px;font-size:8px;font-weight:800;cursor:pointer}.global-family-toggle.on{background:#17bd68;color:#fff}.global-family-toggle.off{background:#e64c60;color:#fff}.global-family-toggle:disabled{opacity:.55}
.roulette-diagnostic{margin-top:18px;padding-top:14px;border-top:1px solid var(--line)}.roulette-diagnostic-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.roulette-diagnostic-head h3{margin:3px 0;font-size:11px}.roulette-diagnostic-head small{color:var(--muted);font-size:7px}.roulette-actions{display:flex;gap:6px}.roulette-actions .roulette-enabled{background:#14b866;color:#fff}.roulette-config{display:grid;grid-template-columns:1fr 1.5fr auto;align-items:end;gap:7px;margin:8px 0 10px}.roulette-config label{font-size:7px;color:var(--muted)}.roulette-config input{display:block;width:100%;height:30px;margin-top:4px;padding:0 9px;border:1px solid var(--line);border-radius:4px;background:var(--card);color:var(--text);font-size:8px}.roulette-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:7px}.roulette-summary article{min-height:72px;padding:10px;border:1px solid var(--line);border-radius:5px;background:#f8fafc}.roulette-summary span,.roulette-summary small{display:block;color:var(--muted);font-size:7px}.roulette-summary strong{display:block;margin:6px 0;font-size:13px;color:var(--text)}.roulette-summary .roulette-alert{border-color:#ef7184;background:#fff1f3}.roulette-summary .roulette-alert strong{color:#cb2840}
[data-theme="dark"] .family-master{background:#101a2a;border-color:#2c3a50}
[data-theme="dark"] .roulette-config input{background:#0b1220;border-color:#344158;color:#dce7f7}[data-theme="dark"] .roulette-summary article{background:#0d1625;border-color:#2e3d54}[data-theme="dark"] .roulette-summary span,[data-theme="dark"] .roulette-summary small{color:#aebed3}[data-theme="dark"] .roulette-summary strong{color:#f5f8ff}[data-theme="dark"] .roulette-summary .roulette-alert{background:#3b1720;border-color:#a63d50}[data-theme="dark"] .roulette-summary .roulette-alert strong{color:#ff8fa2}
[data-theme="dark"] .round-progress>div{background:#162238;border-color:#314460;color:#f4f8ff}
[data-theme="dark"] .round-progress>div.testing{background:#102d4c;border-color:#38a8ff;box-shadow:0 0 0 1px #1a75ba inset}
[data-theme="dark"] .round-progress>div.tested{background:#123b2b;border-color:#2aab73}
[data-theme="dark"] .round-progress>div.degraded{background:#3d3010;border-color:#d9a52b}
[data-theme="dark"] .round-progress>div.offline{background:#421923;border-color:#d45a6c}
[data-theme="dark"] .round-progress>div.quarantined{background:#421923;border-color:#ff5c70;box-shadow:0 0 0 1px #7d2938 inset}
[data-theme="dark"] .round-progress b{color:#ffffff;font-size:9px}
[data-theme="dark"] .round-progress span{color:#c0d2e9;font-size:8px}
[data-theme="dark"] .round-ranking h3{color:#f4f8ff}
[data-theme="dark"] .round-ranking>div{color:#d6e2f2;border-color:#2b3a51}
[data-theme="dark"] .round-ranking>div b,[data-theme="dark"] .round-ranking>div strong{color:#ffffff}
[data-theme="dark"] .auto-note{background:#172941;border:1px solid #315073;color:#d4e9ff}
[data-theme="dark"] .media-health i{font-size:7px;font-weight:700}
[data-theme="dark"] .media-ok{background:#07552f;color:#d8ffe8}
[data-theme="dark"] .media-fail{background:#691d2b;color:#ffe2e7}
[data-theme="dark"] .media-wait{background:#27364b;color:#e0eaf7}
.round-progress>div.offline{border-color:#ff9ca8;background:#fff0f2}.round-progress>div.degraded{border-color:#f2cc72;background:#fff9e9}.media-health{display:flex;gap:3px;flex-wrap:wrap;margin-top:6px}.media-health i{padding:2px 4px;border-radius:3px;font-size:6px;font-style:normal}.media-ok{background:#dff8ea;color:#12864a}.media-fail{background:#ffe1e5;color:#c5233c}.media-wait{background:#edf1f6;color:#78869a}
[data-theme="dark"] .round-progress>div.offline{background:#35151d;border-color:#7d2c3c}[data-theme="dark"] .round-progress>div.degraded{background:#382d12;border-color:#755c20}[data-theme="dark"] .media-ok{background:#123824;color:#65dda0}[data-theme="dark"] .media-fail{background:#421923;color:#ff95a6}[data-theme="dark"] .media-wait{background:#202a39;color:#a9b7ca}

@media(max-width:620px){
  html{zoom:1!important;width:100%;overflow-x:hidden}
  body{width:100%;min-width:0;overflow-x:hidden;font-size:14px}
  .sidebar{display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;overflow:hidden}
  .mini-brand{flex:0 0 auto;padding:0}
  .mini-brand>span{width:32px;height:32px;font-size:11px}
  .mini-brand b{font-size:15px}
  .sidebar>nav:first-of-type{display:flex;flex:1;gap:6px;overflow-x:auto;scrollbar-width:none}
  .sidebar>nav:first-of-type::-webkit-scrollbar{display:none}
  .sidebar nav a{flex:0 0 auto;padding:9px 11px;font-size:11px;white-space:nowrap}
  .workspace{width:100%;max-width:100%;margin:0;overflow:hidden}
  .topbar{display:grid;grid-template-columns:1fr auto;height:auto;min-height:52px;padding:9px 10px;gap:8px;position:sticky;top:0}
  .topbar h1{font-size:17px}
  .top-actions{gap:6px}
  .top-actions button{display:none}
  .top-actions #themeToggle{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#eaf2fb;color:#26344c;font-size:17px}
  [data-theme="dark"] .top-actions #themeToggle{background:#223149;color:#ffd76b}
  .top-actions .status{font-size:11px;white-space:nowrap}
  .winner-cluster{grid-column:1/-1;display:flex;width:100%;margin:0;padding:3px 1px 6px;gap:7px;overflow-x:auto;scroll-snap-type:x proximity;scrollbar-width:none}
  .winner-cluster::-webkit-scrollbar{display:none}
  .winner-cluster .top-winner{flex:0 0 145px;min-width:145px;min-height:46px;padding:7px 9px;display:grid;align-content:center;gap:3px;scroll-snap-align:start}
  .winner-cluster .global-card{flex-basis:180px;min-width:180px}
  .winner-cluster .top-winner span,.winner-cluster .top-winner small{font-size:9px}
  .winner-cluster .top-winner strong{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .content{width:100%;padding:8px}
  .panel{width:100%;padding:12px;margin-bottom:10px;border-radius:9px}
  .filter-grid{display:grid;grid-template-columns:1fr!important;gap:8px}
  .filter-grid input,.filter-grid select,.form-grid input,.form-grid select,.test-controls select{height:42px;font-size:13px}
  .filter-grid label,.form-grid label,.test-controls label{font-size:11px}
  .date-filter{grid-template-columns:1fr auto 1fr}
  .muted-button,.cards-button,.add-button{width:100%;height:42px;font-size:12px}
  .cards-button{grid-column:auto}
  .list-head{margin:12px 0 6px}
  .list-head select{height:36px;font-size:12px}
  .list-head span{font-size:11px}
  .client-card{grid-template-columns:minmax(0,1fr) auto;gap:8px;min-height:0;padding:14px 2px}
  .client-main{min-width:0}
  .client-main h3{font-size:15px;margin-bottom:8px;max-width:100%;line-height:1.35}
  .client-name-title{display:block;padding:7px 9px!important;background:linear-gradient(90deg,#dff1ff,#f4faff);box-shadow:inset 4px 0 #238df5}
  .client-login{font-size:12px!important;margin:7px 0 5px!important}
  .client-main .expiry-highlight{margin-top:8px;padding:6px 9px;font-size:12px}
  .client-main span{font-size:10px;line-height:1.45;overflow-wrap:anywhere}
  .status-active,.status-type{padding:3px 5px;font-size:9px}
  .client-actions{grid-column:1/-1;display:flex;justify-content:flex-start;gap:7px}
  .action-square,.family-toggle{width:35px;height:35px;border-radius:7px;font-size:11px}
  .action-square svg{width:17px;height:17px}
  .action-more{height:35px;padding:0 14px;font-size:11px}
  .client-card details{margin-top:7px}
  .client-card summary{font-size:11px;line-height:1.4}
  .variants-wrap{max-width:calc(100vw - 44px);padding:6px}
  .variants-wrap th,.variants-wrap td{padding:8px 6px;font-size:10px;white-space:nowrap}
  .cards article span,.cards article small,.winner-banner p,.eyebrow{font-size:10px}
  .winner-banner{flex-direction:column;padding:15px}
  .winner-banner h2{font-size:17px}
  .panel-title h2{font-size:17px}
  .pill{font-size:10px}
  .m3u-dialog{width:calc(100vw - 24px);max-width:none;max-height:86dvh;margin:auto;padding:16px;overflow:auto}
  .m3u-dialog-head span,.m3u-dialog p,.xtream-box label{font-size:10px}
  .m3u-dialog-head h2{font-size:17px}
  .m3u-dialog input{height:44px;font-size:12px}
  .edit-client-grid{grid-template-columns:1fr}
  .edit-client-dialog label{font-size:11px}
  .edit-client-dialog select{height:44px;font-size:12px}
  .xtream-box{grid-template-columns:1fr}
  .xtream-box>*{grid-column:1!important}
  .roulette-diagnostic-head{align-items:flex-start;flex-direction:column}.roulette-actions{width:100%;flex-direction:column}.roulette-config{grid-template-columns:1fr}.roulette-config label{font-size:10px}.roulette-config input{height:42px;font-size:12px}.roulette-summary{grid-template-columns:1fr 1fr}.roulette-summary article{min-height:86px}.roulette-diagnostic-head h3{font-size:15px}.roulette-diagnostic-head small,.roulette-summary span,.roulette-summary small{font-size:10px}.roulette-summary strong{font-size:17px}
}

.section-copy{margin:5px 0 0;color:var(--muted);font-size:8px}.reseller-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:12px}.reseller-summary article{padding:12px;border:1px solid var(--line);border-radius:6px;background:linear-gradient(145deg,#fbfdff,#f4f8fd)}.reseller-summary span,.reseller-summary small{display:block;color:var(--muted);font-size:7px}.reseller-summary strong{display:block;margin:5px 0;font-size:17px;color:var(--text)}.reseller-create-form{padding:12px;border:1px solid var(--line);border-radius:6px;background:#f8fafc}.reseller-form-head h3,.reseller-list-head h3{margin:0;font-size:10px}.reseller-form-head p,.reseller-list-head p{margin:4px 0 0;color:var(--muted);font-size:7px}.reseller-form-grid{grid-template-columns:1.2fr 1.2fr 1fr .7fr .7fr 1fr;margin-top:10px}.check-option{display:flex!important;align-items:center;gap:7px;padding-top:16px}.check-option input{width:14px!important;height:14px!important;margin:0!important}.reseller-list-head{display:flex;align-items:center;justify-content:space-between;margin:16px 0 8px}.reseller-table-wrap{overflow:auto;border:1px solid var(--line);border-radius:6px}.reseller-columns,.reseller-row{display:grid;grid-template-columns:1.5fr .55fr .8fr .55fr 1.35fr;align-items:center;gap:8px;padding:8px 10px}.reseller-columns{background:#f6f8fb;color:#a2aec1;font-size:7px;font-weight:800}.reseller-row{min-height:56px;border-top:1px solid var(--line)}.reseller-identity{padding-left:calc(var(--depth,0) * 14px);min-width:0}.reseller-identity b,.reseller-identity span,.reseller-wallet b,.reseller-wallet span,.reseller-portfolio b,.reseller-portfolio span{display:block}.reseller-identity b{font-size:9px;color:var(--text)}.reseller-identity span,.reseller-wallet span,.reseller-portfolio span{margin-top:3px;color:var(--muted);font-size:7px}.reseller-wallet b{color:var(--blue);font-size:10px}.reseller-status{width:max-content;padding:3px 6px;border-radius:10px;font-size:7px;font-weight:800}.reseller-status.active{background:#e2f8ec;color:#11864a}.reseller-status.suspended{background:#ffe6ea;color:#c32742}.reseller-actions{display:flex;justify-content:flex-end;gap:4px;flex-wrap:wrap}.reseller-actions button{height:24px;border:0;border-radius:4px;padding:0 8px;background:#e9eef5;color:#53637b;font-size:7px;font-weight:800;cursor:pointer}.reseller-actions .reseller-block{background:#fff0d7;color:#9a6204}.reseller-actions .reseller-takeover{background:#ffe4e8;color:#bf2841}.reseller-table .empty{padding:18px;text-align:center;color:var(--muted)}.reseller-audit{margin-top:14px;border-top:1px solid var(--line);padding-top:10px}.reseller-audit summary{cursor:pointer;color:var(--blue);font-size:8px;font-weight:800}.reseller-audit .history{margin-top:8px}.credit-dialog small{display:block;color:var(--muted);font-size:7px;margin-top:-6px}.role-hidden{display:none!important}
[data-theme="dark"] .reseller-summary article,[data-theme="dark"] .reseller-create-form,[data-theme="dark"] .reseller-columns{background:#0d1624;border-color:#2b394f}[data-theme="dark"] .reseller-summary strong,[data-theme="dark"] .reseller-identity b{color:#f3f7ff}[data-theme="dark"] .reseller-row{border-color:#27354a}[data-theme="dark"] .reseller-status.active{background:#123b29;color:#68dfa2}[data-theme="dark"] .reseller-status.suspended{background:#421923;color:#ff9aac}[data-theme="dark"] .reseller-actions button{background:#253247;color:#c7d4e7}[data-theme="dark"] .reseller-actions .reseller-block{background:#3d300e;color:#ffd676}[data-theme="dark"] .reseller-actions .reseller-takeover{background:#421923;color:#ff9aac}
@media(max-width:900px){.reseller-form-grid{grid-template-columns:repeat(2,1fr)}.reseller-columns,.reseller-row{grid-template-columns:1.3fr .55fr .7fr .5fr 1.2fr}}
@media(max-width:620px){.section-copy{font-size:11px}.reseller-summary{grid-template-columns:1fr 1fr}.reseller-summary span,.reseller-summary small{font-size:10px}.reseller-summary strong{font-size:20px}.reseller-create-form{padding:10px}.reseller-form-grid{grid-template-columns:1fr}.check-option{padding:5px 0}.check-option input{width:20px!important;height:20px!important}.reseller-form-head h3,.reseller-list-head h3{font-size:14px}.reseller-form-head p,.reseller-list-head p{font-size:10px;line-height:1.4}.reseller-columns{display:none}.reseller-table-wrap{border:0;overflow:visible}.reseller-row{grid-template-columns:1fr auto;gap:10px;padding:14px 4px}.reseller-identity{padding-left:calc(var(--depth,0) * 10px)}.reseller-identity b{font-size:14px}.reseller-identity span,.reseller-wallet span,.reseller-portfolio span{font-size:10px}.reseller-wallet b{font-size:15px}.reseller-portfolio{grid-column:1}.reseller-status{grid-column:2;grid-row:1;padding:5px 7px;font-size:10px}.reseller-actions{grid-column:1/-1;justify-content:flex-start}.reseller-actions button{height:36px;padding:0 12px;font-size:10px}.reseller-audit summary{font-size:12px}.credit-dialog small{font-size:10px}}
.integration-cards{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.integration-card{padding:12px;border:1px solid var(--line);border-radius:6px;background:#fbfcfe}.integration-card-head{display:flex;justify-content:space-between;gap:7px}.integration-card h3{margin:0;font-size:10px}.integration-state{padding:3px 6px;border-radius:10px;background:#e6eaf0;color:#69778c;font-size:7px;font-weight:800}.integration-state.active{background:#e2f8ec;color:#11864a}.integration-state.warning{background:#fff1d8;color:#a66b07}.integration-state.error{background:#ffe5e9;color:#c12741}.integration-card p{min-height:22px;margin:8px 0;color:var(--muted);font-size:7px;line-height:1.45}.integration-card small{display:block;color:var(--muted);font-size:7px}.integration-card button{width:100%;margin-top:9px}.integration-panel-link{display:flex;align-items:center;justify-content:center;width:100%;min-height:29px;margin-top:6px;border:1px solid #2789f5;border-radius:4px;background:rgba(39,137,245,.1);color:#2789f5;font-size:8px;font-weight:800;text-decoration:none;transition:.15s ease}.integration-panel-link:hover{background:#2789f5;color:#fff;box-shadow:0 0 14px rgba(39,137,245,.3)}.integration-import-form{margin-top:12px;padding:12px;border:1px solid var(--line);border-radius:6px;background:#f8fafc}.integration-form-head h3{margin:0;font-size:10px}.integration-form-head p{margin:4px 0 0;color:var(--muted);font-size:7px}.integration-import-grid{display:grid;grid-template-columns:.65fr 2.35fr;gap:8px;margin-top:10px}.integration-import-grid label{color:#6e7d96;font-size:8px;font-weight:700}.integration-import-grid select,.integration-import-grid textarea{display:block;width:100%;margin-top:6px;border:1px solid var(--line);border-radius:4px;background:var(--card);color:var(--text);font:8px Inter,Segoe UI,Arial,sans-serif}.integration-import-grid select{height:34px;padding:0 9px}.integration-import-grid textarea{min-height:120px;padding:10px;resize:vertical;line-height:1.5}.integration-events{margin-top:14px;border-top:1px solid var(--line);padding-top:10px}.integration-events summary{cursor:pointer;color:var(--blue);font-size:8px;font-weight:800}.integration-events .history{margin-top:8px}[data-theme="dark"] .integration-card,[data-theme="dark"] .integration-import-form{background:#0d1624;border-color:#2b394f}[data-theme="dark"] .integration-card h3{color:#f4f8ff}[data-theme="dark"] .integration-import-grid select,[data-theme="dark"] .integration-import-grid textarea{background:#0a111e;border-color:#344158;color:#dce7f7}[data-theme="dark"] .integration-state.active{background:#123b29;color:#68dfa2}[data-theme="dark"] .integration-state.warning{background:#3d300e;color:#ffd676}[data-theme="dark"] .integration-state.error{background:#421923;color:#ff9aac}[data-theme="dark"] .integration-panel-link{background:#0a1d34;border-color:#3194ff;color:#68b7ff}@media(max-width:900px){.integration-cards{grid-template-columns:1fr 1fr}}@media(max-width:620px){.integration-cards{grid-template-columns:1fr}.integration-card{padding:14px}.integration-card h3{font-size:14px}.integration-card p,.integration-card small{font-size:10px}.integration-state{font-size:10px}.integration-panel-link{min-height:42px;font-size:11px}.integration-import-grid{grid-template-columns:1fr}.integration-form-head h3{font-size:14px}.integration-form-head p,.integration-import-grid label{font-size:10px}.integration-import-grid select{height:42px;font-size:12px}.integration-import-grid textarea{min-height:180px;font-size:11px}.integration-events summary{font-size:12px}}

/* Desktop: keep every menu option reachable on short screens/high zoom. */
@media(min-width:621px){
  html,body{max-width:100%;overflow-x:clip}
  .sidebar{bottom:auto;height:calc(100dvh / 1.4);overflow-x:hidden;overflow-y:scroll;overscroll-behavior-y:contain;scrollbar-gutter:auto;scrollbar-width:thin;scrollbar-color:#53647d #090d14}
  .sidebar>*,.sidebar nav{flex-shrink:0}
  .sidebar-spacer{flex:1 0 12px}
  .sidebar::-webkit-scrollbar{width:8px}
  .sidebar::-webkit-scrollbar-track{background:#090d14}
  .sidebar::-webkit-scrollbar-thumb{background:#53647d;border:2px solid #090d14;border-radius:999px}
  .sidebar::-webkit-scrollbar-thumb:hover{background:#71819a}
}

.mini-brand>img.sidebar-logo{width:30px;height:20px;flex:0 0 auto;border-radius:5px;object-fit:cover;box-shadow:0 2px 8px #0aaeff35}
.top-actions .theme-switch{display:inline-flex;align-items:center;justify-content:center;min-width:82px;height:25px;padding:0 10px;border:1px solid #8ca2c4;border-radius:5px;background:#eef5ff;color:#176ec9;font-size:8px;font-weight:800;white-space:nowrap;cursor:pointer;box-shadow:0 2px 7px #1268c522}
.top-actions .theme-switch:hover{border-color:#2589ef;background:#e2f0ff;color:#075daf}
[data-theme="dark"] .top-actions .theme-switch{border-color:#3b82d0;background:#17314f;color:#8dc7ff;box-shadow:0 0 10px #1f8cff33}
[data-theme="dark"] .top-actions .theme-switch:hover{background:#20466f;color:#c2e3ff}
.top-actions .status{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;font-weight:700}
.top-actions .status::before{content:"";width:7px;height:7px;flex:0 0 7px;border-radius:50%;background:#d7a51d;box-shadow:0 0 0 2px #d7a51d22}
.top-actions .status.online::before{background:#19c96b;box-shadow:0 0 8px #19c96b99}
.top-actions .status.offline{color:#e34a5f}
.top-actions .status.offline::before{background:#e34a5f;box-shadow:0 0 8px #e34a5f99}
