/* Reseller workspace: the admin's layout (portal.css + admin.css) with a dashboard, a device table and
   a playlist panel. Only what the admin does not have yet is here. */
body.reseller.signed-out{display:block;height:auto;overflow:auto}
.login-lang{display:flex;justify-content:center;margin-top:18px}
.login-lang select{width:auto}

.nav-count{margin-left:auto;padding:0 7px;border-radius:999px;background:rgba(255,255,255,.08);font-size:11.5px;line-height:18px;color:var(--muted)}
.nav-count:empty{display:none}
body.reseller .nav button{position:relative}
body.reseller .nav button.active::after{display:none}  /* the active entry is already lit; its dot would sit on the count */


/* Top bar: the language list sits before the account icon (portal.css puts .compact last) */
body.reseller .top-lang{order:0;margin-left:0;width:auto;height:32px;font-size:12.5px;padding:0 28px 0 10px}  /* portal.css puts .compact last; here the account icon is last */

/* Key figures: four, the two that point at work act as filters */
.reseller-kpis{grid-template-columns:repeat(4,minmax(0,1fr))}
body.admin .kpi.link.on{border-color:rgba(120,215,255,.7);background:rgba(31,107,255,.12)}
body.reseller .tv-card .toolbar{flex-wrap:wrap}
body.reseller .data-table tr.clickable:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
body.reseller .data-table tbody tr.open{background:rgba(31,107,255,.12)}
body.reseller .data-table td .sub{display:block;color:var(--faint);font-size:11.5px;font-family:var(--font)}

/* Playlists in the side panel */
.playlist-row{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;padding:12px 0;border-bottom:1px solid var(--line)}
.playlist-title{display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:14px}
.playlist-main .sub{margin-top:3px;color:var(--faint);font-size:12.5px;overflow-wrap:anywhere}
.playlist-actions{display:flex;flex-wrap:wrap;gap:6px}
.playlist-row.locked .playlist-title strong{color:var(--muted)}
.drawer-empty{padding:18px;border:1px dashed var(--line-2);border-radius:var(--radius-sm);text-align:center}
.drawer-empty p{margin:0 0 10px;color:var(--muted)}
body.reseller .danger-text{color:var(--bad)}
body.reseller .drawer-body > .small{margin:0 0 4px}

/* Add TVs */
#pl-tv{margin:0 0 4px;color:var(--faint)}

@media (max-width:1000px){ .reseller-kpis{grid-template-columns:repeat(2,minmax(0,1fr))} }
/* Phone: the add button keeps only its plus, so the language and the account icon still fit beside it. */
@media (max-width:520px){
  body.reseller #top-add span:last-child{display:none}
  body.reseller #top-add{width:34px;padding:0;justify-content:center;font-size:18px}
  body.reseller #top-add span[aria-hidden]{margin:0}
}
@media (max-width:900px){
  body.reseller .topbar{height:auto;min-height:60px;flex-wrap:wrap;row-gap:10px;padding:10px 0}
}

.bundles-card{margin-top:12px}
.bundles-table .total-row td{font-weight:650;border-top:1px solid var(--line-2)}

/* Dashboard: two cards side by side; My devices: the table uses the full height of the page */
.dash-grid{margin-top:12px}
.dash-grid .card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.dash-grid .card-head .button{flex:none;text-decoration:none}
body.reseller .devices-card .table-wrap{max-height:none;overflow-x:auto}

@media (min-width:901px){
  body.sidebar-collapsed .nav-count{position:absolute;top:-5px;right:-7px;margin:0;padding:0 5px;min-width:18px;text-align:center;font-size:10px;line-height:16px;background:#1f6bff;color:#fff;box-shadow:0 0 0 2px var(--bg-2)}
}
/* Phone: the menu buttons take the width they need and wrap, so the device count never runs into the next one */
@media (max-width:900px){ body.reseller.workspace .nav button{flex:1 1 auto;min-width:0;white-space:nowrap} }
body.reseller .devices-card{margin-top:4px}
/* Taking a device off the list: at the bottom of its panel, apart from the rest */
.remove-row{margin-top:22px}
.transfer-layout{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:20px;align-items:start}
.transfer-layout>.card{margin:0}
.transfer-info p{color:var(--muted);line-height:1.6}
.transfer-limit{padding:16px 18px;border:1px solid #83daff66;border-radius:10px;background:#1f6bff12}
.transfer-limit strong{font-size:30px;line-height:1.2;font-weight:600;color:var(--text)}
.transfer-limit p{margin:6px 0 0;font-size:13px}
.transfer-rules{padding-top:16px;border-top:1px solid var(--line)}
@media (max-width:1000px){ .transfer-layout{grid-template-columns:1fr} }
/* Credit page: buying activations at tiered prices, then every bundle */
.dash-single{display:grid;grid-template-columns:minmax(0,1fr)}
.buy-card{margin-bottom:18px!important}
.buy-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,.7fr);gap:28px;align-items:stretch;margin-top:8px}
body.reseller #buy-qty{height:44px;font-size:18px;max-width:200px}
.tier-list{list-style:none;margin:14px 0 0;padding:0;display:grid;gap:6px}
.tier-list li{display:flex;justify-content:space-between;padding:8px 12px;border:1px solid var(--line);border-radius:8px;font-size:13px;color:var(--muted)}
.tier-list li.on{border-color:#1f6bff;background:rgba(92,206,255,.12);color:var(--text)}
.buy-summary{display:flex;flex-direction:column;justify-content:space-between;gap:24px;padding:24px;border:1px solid var(--line);border-radius:10px;background:var(--card-2);min-width:0}
.buy-summary strong{font-size:28px;font-weight:600;letter-spacing:-.02em}
.buy-off{margin:0 0 18px}
.request-box{display:grid;gap:8px;margin:0 0 18px}
.owed-box{margin:0 0 18px;padding:14px 18px;border:1px solid rgba(248,113,113,.45);border-left:4px solid #f87171;border-radius:10px;background:rgba(248,113,113,.08)}
.owed-box strong{color:#fca5a5}
.dash-owed{display:flex;justify-content:space-between;align-items:center;gap:16px}
.dash-owed .owed-text{min-width:0}
body.reseller .dash-owed .secondary{flex:none;border-color:rgba(248,113,113,.5);color:#fecaca}
.owed-box strong{display:block;font-size:16px}
.owed-box .sub{display:block;margin-top:4px;font-size:12.5px;color:var(--muted)}
.bundles-table .badge + .badge{margin-left:6px}
.request-line{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;border:1px solid rgba(250,204,21,.35);border-radius:10px;background:rgba(250,204,21,.06);font-size:13.5px}
.request-line .sub{display:block;margin-top:2px;font-size:12px;color:var(--muted)}
.ticket-page-head{display:flex;justify-content:space-between;align-items:center;gap:14px}
.ticket-page-head button{flex:none}
.ticket-dialog{width:min(680px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto}
.ticket-dialog .dialog-head{align-items:flex-start}
.ticket-dialog .dialog-body{display:grid;gap:12px}
.ticket-create-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(200px,.55fr);gap:12px}
.ticket-create-fields>div{min-width:0}
body.reseller .ticket-create input,body.reseller .ticket-create select,body.reseller .ticket-create textarea{width:100%}
body.reseller .ticket-create textarea{min-height:150px;padding:10px 12px;resize:vertical}
.ticket-dialog .dialog-foot{padding:12px 20px 16px}
.ticket-closed{padding:10px 12px;border-top:1px solid var(--line);color:var(--muted)}
@media(max-width:720px){.ticket-page-head{align-items:flex-start;flex-direction:column}.ticket-create-fields{grid-template-columns:minmax(0,1fr)}}
@media (max-width:720px){ .buy-grid{grid-template-columns:1fr} }
/* The Add device window: three numbered steps and a success confirmation. */
body.reseller #add-dialog{width:min(640px,calc(100vw - 32px))}
body.reseller #add-dialog .dialog-head{align-items:flex-start;padding:18px 24px}
body.reseller #add-dialog .dialog-head h2{font-size:18px}
body.reseller .add-steps{display:grid;gap:22px;padding:20px 24px 22px}
.add-step h3{margin:0 0 10px;font-size:15px;font-weight:600;letter-spacing:0;text-transform:none;color:var(--text)}
.add-success{display:flex;align-items:center;gap:10px}
.add-success svg{width:32px;height:32px;flex:none;fill:none;stroke:var(--ok);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.wizard-progress{display:flex;gap:6px;margin:12px 0 0}
body.reseller #add-button{margin-left:auto}
.wizard-progress span{flex:1;height:3px;border-radius:2px;background:var(--line-2)}
.wizard-progress span.on{background:#1f6bff}
body.reseller .badge.lock-mine{color:var(--warn);border-color:rgba(251,191,36,.42);background:rgba(251,191,36,.08)}
.step-hint{margin:6px 0 0;font-size:12px;color:var(--faint)}
body.reseller .option-row{display:flex;gap:12px;align-items:flex-start;margin:0 0 8px;padding:12px 14px;border:1px solid var(--line-2);border-radius:10px;background:var(--card-2);cursor:pointer;font-weight:400}
body.reseller .option-row:last-child{margin-bottom:0}
.option-row input{width:16px;height:16px;margin-top:2px;flex:none;accent-color:#1f6bff}
.option-row strong{display:block;font-size:13.5px}
.option-row .hint{display:block;margin-top:2px;font-size:12px;color:var(--muted)}
.add-foot{justify-content:space-between!important;align-items:center;padding:14px 24px!important}
.add-foot .small{margin:0;max-width:340px;color:var(--muted)}
@media (max-width:560px){ .add-foot{flex-direction:column;align-items:stretch} }
/* The playlist window: wider, the kind as three cards with a line each, larger fields, Test left and Save right. */
body.reseller #playlist-dialog{width:min(640px,calc(100vw - 32px))}
body.reseller #playlist-dialog .dialog-head{align-items:flex-start;padding:18px 24px}
body.reseller #playlist-dialog .dialog-head h2{font-size:18px}
.dialog-sub{margin:4px 0 0;font-size:13px;color:var(--muted)}
body.reseller #playlist-dialog .dialog-body{padding:18px 24px 20px}
body.reseller #playlist-dialog .dialog-body > label{margin-top:18px;font-weight:600}
body.reseller #playlist-dialog .dialog-body > label:first-of-type{margin-top:0}
body.reseller #playlist-dialog .dialog-body input{height:42px;font-size:14.5px}
body.reseller #playlist-dialog #auto-fields > label,body.reseller #playlist-dialog #xtream-fields label,body.reseller #playlist-dialog #m3u-fields > label{margin-top:16px;font-weight:600}
.kind-cards{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:6px;padding:0!important;background:none!important;border:0!important}
body.reseller .kind-cards label{display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin:0;padding:12px 14px;border:1px solid var(--line-2);border-radius:10px;background:var(--card-2);cursor:pointer;font-weight:400;height:auto;text-align:left}
body.reseller .kind-cards label.checked{border-color:#1f6bff;background:rgba(92,206,255,.12);box-shadow:0 0 0 1px #1f6bff inset}
.kind-cards input{position:absolute;opacity:0;pointer-events:none}
.kind-title{font-weight:600;font-size:14px;color:var(--text)}
.kind-desc{font-size:12px;line-height:1.4;color:var(--muted)}
body.reseller #playlist-dialog .check-result{margin-top:16px}
.playlist-foot{justify-content:space-between!important;padding:14px 24px!important}
@media (max-width:560px){ .kind-cards{grid-template-columns:1fr} }
/* One device: its own page. Calm: one primary action, the rest in a menu, facts in one strip, compact rows. */
.device-view{max-width:980px}
body.reseller .back-link{display:inline-flex;align-items:center;gap:4px;margin:0 0 18px;padding:0;height:auto;background:none;border:0;color:var(--muted);font-size:13px;font-weight:500;cursor:pointer}
body.reseller .back-link:hover{color:var(--text)}
.device-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}
.device-title{min-width:0}
.device-name-row{display:flex;align-items:center;gap:6px}
body.reseller .device-head h2{margin:0;font-size:24px;font-weight:600;letter-spacing:-.02em;line-height:1.25;overflow-wrap:anywhere}
body.reseller .icon-button{display:inline-grid;place-items:center;width:30px;height:30px;padding:0;background:none;border:0;border-radius:7px;color:var(--faint);cursor:pointer}
body.reseller .icon-button:hover,body.reseller .icon-button:focus-visible{background:var(--card-2);color:var(--text)}
.icon-button svg{width:16px;height:16px}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.device-name-edit{display:flex;gap:8px;align-items:center;max-width:520px}
body.reseller .device-name-edit input{flex:1;min-width:0;height:38px;font-size:16px}
.device-meta{margin:6px 0 0;font-family:var(--mono);font-size:12.5px;color:var(--muted)}
.device-actions{display:flex;gap:8px;align-items:center;flex:none}
.device-menu{position:absolute;top:calc(100% + 6px);right:0;width:250px;padding:6px}
body.reseller .device-menu button{display:flex;align-items:center;width:100%;height:34px;padding:0 10px;background:none;border:0;border-radius:6px;color:var(--text);font-weight:500;font-size:13.5px;text-align:left;justify-content:flex-start}
body.reseller .device-menu button:hover,body.reseller .device-menu button:focus-visible{background:rgba(255,255,255,.06)}
body.reseller .device-menu button.danger-text{color:var(--bad)}
.menu-divider{height:1px;margin:6px 4px;background:var(--line-2)}
.device-note{margin:14px 0 0;padding:10px 14px;border-radius:9px;background:rgba(92,206,255,.08);border:1px solid rgba(92,206,255,.22);font-size:13px;color:var(--text)}
.device-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:22px 0 0;padding:0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.device-facts > div{padding:14px 18px 14px 0}
.device-facts > div + div{padding-left:18px;border-left:1px solid var(--line)}
.device-facts dt{margin:0 0 6px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--faint);font-weight:600}
.device-facts dd{margin:0;font-size:13.5px;display:flex;flex-direction:column;align-items:flex-start;gap:4px}
.fact-sub{font-size:12.5px;color:var(--muted)}
.device-section{margin-top:28px}
.section-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-bottom:10px;border-bottom:1px solid var(--line)}
body.reseller .section-head h3{margin:0;font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--faint);font-weight:600}
.count-pill{display:inline-block;min-width:20px;margin-left:4px;padding:1px 7px;border-radius:999px;background:var(--card-2);color:var(--muted);font-size:11px;text-align:center;letter-spacing:0}
.device-view .playlist-row{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px;padding:14px 0}
.device-view .playlist-actions{flex-wrap:nowrap;gap:2px}
body.reseller .device-view .playlist-actions button{height:30px;padding:0 10px;background:none;border:0;border-radius:6px;color:var(--muted);font-size:13px;font-weight:500}
body.reseller .device-view .playlist-actions button:hover{background:var(--card-2);color:var(--text)}
body.reseller .device-view .playlist-actions button.danger-text{color:var(--bad)}
.device-view .drawer-empty{margin-top:14px}
.device-foot{margin:14px 0 0;font-size:12px;color:var(--faint)}
@media (max-width:720px){
  .device-head{flex-direction:column}
  .device-facts{grid-template-columns:1fr}
  .device-facts > div + div{padding-left:0;border-left:0;border-top:1px solid var(--line)}
  .device-view .playlist-row{grid-template-columns:1fr}
  .device-view .playlist-actions{flex-wrap:wrap}
  .device-menu{left:0;right:auto}
}
.pin-layout{display:grid;gap:16px;max-width:640px}
.pin-state-head{display:flex;gap:14px;align-items:flex-start}
.pin-state-head h2{margin:0 0 4px}
.pin-state-icon{flex:none;width:36px;height:36px;border-radius:50%;display:grid;place-items:center;font-weight:700;font-size:18px}
.pin-state.on .pin-state-icon{background:rgba(34,197,94,.16);color:#4ade80}
.pin-state.off .pin-state-icon{background:var(--card-2);color:var(--muted)}
.transfer-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.transfer-pair fieldset{margin:0;padding:14px 16px 6px;border:1px solid var(--line-2);border-radius:var(--radius-sm);min-width:0}
.transfer-pair legend{padding:0 6px;font-weight:600}
@media (max-width:640px){ .transfer-pair{grid-template-columns:1fr} }

/* Sign-in: the same store background as the admin (admin.css), the card on the right */
body.reseller .reseller-login{padding-top:96px;padding-bottom:80px}
body.reseller .reseller-login .admin-login-card{max-width:400px;width:100%;background:rgba(14,16,32,.34);border-color:rgba(200,239,255,.22);-webkit-backdrop-filter:blur(22px) saturate(140%);backdrop-filter:blur(22px) saturate(140%);box-shadow:0 30px 90px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.10)}
/* The fields and the language list are glass too, so the sky shows through the whole card */
body.reseller .reseller-login .admin-login-card input,body.reseller .reseller-login .admin-login-card select{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.16)}
body.reseller .reseller-login .admin-login-card input:focus{background:rgba(255,255,255,.10)}
.reseller-login .admin-login-card .brand small{color:#c9cfe0}
.reseller-login .admin-login-card h1{font-size:26px;letter-spacing:-.025em}
.login-photo-brand{position:absolute;top:32px;left:clamp(24px,4vw,56px);display:flex;align-items:center;gap:12px;font-size:20px;font-weight:750;letter-spacing:-.03em;color:#fff;text-shadow:0 2px 18px rgba(0,0,0,.5)}
.login-photo-brand img{width:40px;height:40px;border-radius:0;filter:drop-shadow(0 6px 18px rgba(0,0,0,.45))}
.login-photo-platforms{position:absolute;bottom:32px;left:clamp(24px,4vw,56px);display:flex;flex-wrap:wrap;gap:8px}
.login-photo-platforms span{padding:6px 12px;border:1px solid rgba(255,255,255,.16);border-radius:999px;background:rgba(10,12,24,.35);color:#dfe4f2;font-size:12.5px;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
/* The logo is in the background on wide screens; the small brand top left only where the card covers it */
@media (min-width:901px){.login-photo-brand{display:none}}
@media (max-width:900px){
  body.reseller .reseller-login{padding:96px 16px 32px}
  .login-photo-brand{left:50%;transform:translateX(-50%);top:28px}
  .login-photo-platforms{display:none}
}
/* The brand is already top left on the photo; the card starts with the welcome */
body.reseller .reseller-login .admin-login-card .brand{display:none}

/* Credit page, compact: the same tight look as the admin */
.credit-view .card{padding:14px 16px!important;margin-bottom:14px!important}
body.reseller .credit-view .section-title{margin:0 0 10px;font-size:11.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--faint);font-weight:600}
.credit-view .owed-box{padding:10px 14px;margin-bottom:14px}
.credit-view .owed-box strong{font-size:14px}
.credit-view .owed-box .sub{margin-top:2px;font-size:12px}
body.reseller .buy-field label{margin:0 0 6px;font-size:12px;color:var(--muted)}
body.reseller #buy-qty{width:100%}
.credit-view .tier-list{margin:16px 0 0;gap:6px}
.credit-view .tier-list li{gap:12px;padding:10px 12px;border-radius:8px;font-size:12px}
.credit-view .tier-list li span:last-child{text-align:right}
.buy-total-box{display:flex;flex-direction:column;align-items:flex-start;gap:6px;line-height:1.3}
.buy-total-box .small{font-size:12px;color:var(--muted)}
.buy-buttons{display:flex;flex-direction:column;gap:8px}
body.reseller .buy-buttons button{width:100%;height:auto;min-height:38px;white-space:normal}
.credit-view #buy-error{margin:8px 0 0}
.credit-view .buy-off{margin:0 0 14px}
.credit-view .request-line{padding:8px 14px}
.credit-view .bundles-table td,.credit-view .bundles-table th{padding:6px 10px}

.apk-view h2{font-size:22px;margin:0 0 12px}
.apk-view p{line-height:1.6}
.apk-address{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 14px;margin:4px 0 14px;padding:14px 16px;border:1px solid var(--line-2);border-radius:12px;background:var(--card-2)}
.apk-address code{font-size:20px;font-weight:600;color:var(--text);letter-spacing:.01em;overflow-wrap:anywhere}
.apk-address{align-items:center}
.apk-code{display:flex;flex-direction:column;gap:6px;margin-left:auto;padding:16px 24px;border:1px solid #83daff80;border-radius:10px;background:linear-gradient(135deg,#10233d,#1b233d)}
.apk-code>span{font-size:12px;color:var(--muted)}
.apk-code strong{font-family:ui-monospace,monospace;font-size:32px;letter-spacing:.12em;line-height:1.2;color:var(--text);user-select:all}
@media (max-width:600px){ .apk-code{width:100%;margin-left:0;padding:16px} }
.apk-switch{margin:16px 0;padding:14px 18px;border:1px solid #c6a35d55;border-left:3px solid #c6a35d;border-radius:8px;background:#c6a35d08}
.apk-switch p{margin:0;color:var(--muted);font-size:13px}
