
/* BVPN layout repair v1 — load after assets/style.css */
:root{
  --bv-bg:#0b1530;--bv-panel:#142342;--bv-panel-2:#1a2c4d;--bv-border:#2a4067;
  --bv-text:#edf4ff;--bv-muted:#9eb5dd;--bv-blue:#3478ff;--bv-blue-2:#4b5cff;
  --bv-light-bg:#f3f7ff;--bv-light-panel:#fff;--bv-light-text:#14284a;--bv-light-muted:#637a9d;
}
*,*::before,*::after{box-sizing:border-box}
html{min-height:100%;scroll-behavior:smooth}
body{margin:0;min-height:100vh;font-family:Tahoma,"Segoe UI",Arial,sans-serif;line-height:1.65;overflow-x:hidden}
img,svg,video{max-width:100%;height:auto}
button,input,select,textarea{font:inherit;max-width:100%}
a{overflow-wrap:anywhere}
button,.button,input[type=submit]{cursor:pointer}
:focus-visible{outline:2px solid #5ea0ff;outline-offset:2px}

/* Admin dashboard */
body.admin-theme{background:var(--bv-bg)!important;color:var(--bv-text)!important}
.admin-layout{display:grid!important;grid-template-columns:minmax(0,1fr) 270px!important;direction:rtl!important;align-items:stretch!important;width:100%!important;min-height:100vh!important;margin:0!important;padding:0!important;gap:0!important}
.admin-sidebar{grid-column:2!important;grid-row:1!important;position:sticky!important;top:0!important;align-self:start!important;width:270px!important;min-width:0!important;height:100vh!important;overflow-y:auto!important;display:flex!important;flex-direction:column!important;gap:18px!important;padding:22px 16px!important;background:#14213d!important;border-left:1px solid var(--bv-border)!important;border-right:0!important;z-index:20!important}
.admin-brand{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:10px!important;padding:0 10px 18px!important;border-bottom:1px solid rgba(145,174,220,.16)!important;font-size:22px!important;font-weight:800!important}
.admin-brand a,.admin-brand .brand{display:inline-flex!important;align-items:center!important;gap:9px!important;color:#f5f8ff!important;text-decoration:none!important}
.admin-nav{display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;gap:5px!important;width:100%!important;white-space:normal!important}
.admin-nav>a{display:flex!important;align-items:center!important;gap:11px!important;width:100%!important;min-width:0!important;padding:11px 12px!important;border-radius:10px!important;color:#b5c9eb!important;text-decoration:none!important;font-size:13px!important;line-height:1.5!important;white-space:normal!important;transition:background .18s,color .18s!important}
.admin-nav>a:hover,.admin-nav>a.active{background:#243b65!important;color:#fff!important}
.admin-nav .nav-icon{display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 24px!important;width:24px!important;min-width:24px!important}
.nav-caption{margin:12px 10px 4px!important;color:#718dbb!important;font-size:11px!important}
.sidebar-bottom{margin-top:auto!important;padding-top:12px!important;border-top:1px solid rgba(145,174,220,.16)!important}
.sidebar-bottom>a{display:flex!important;width:100%!important;text-decoration:none!important}
.admin-main{grid-column:1!important;grid-row:1!important;min-width:0!important;width:100%!important;max-width:none!important;margin:0!important;padding:0!important;display:flex!important;flex-direction:column!important}
.admin-topbar{position:sticky!important;top:0!important;z-index:15!important;display:flex!important;align-items:center!important;gap:14px!important;min-height:70px!important;width:100%!important;padding:12px clamp(16px,2.2vw,30px)!important;background:rgba(23,37,65,.96)!important;border-bottom:1px solid rgba(145,174,220,.13)!important;backdrop-filter:blur(12px)!important}
.admin-search{flex:1 1 280px!important;min-width:0!important}
.admin-search input{width:100%!important;min-width:0!important;height:42px!important;border:1px solid var(--bv-border)!important;border-radius:10px!important;background:#101d37!important;color:var(--bv-text)!important;padding:9px 13px!important}
.admin-top-actions{display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:wrap!important}
.admin-user{display:flex!important;align-items:center!important;gap:10px!important;min-width:0!important}
.admin-content{display:block!important;width:100%!important;max-width:none!important;min-width:0!important;margin:0!important;padding:clamp(16px,2.3vw,32px)!important;overflow-wrap:anywhere!important}
.page-heading{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:16px!important;flex-wrap:wrap!important;margin:0 0 22px!important}
.page-heading h1,.page-heading h2{margin:0!important;color:#f5f8ff!important;line-height:1.35!important}
.actions{display:flex!important;align-items:center!important;gap:10px!important;flex-wrap:wrap!important}
.admin-content .card,.admin-content .panel,.admin-content .stat-card,.admin-content section{min-width:0}
.admin-content table{width:100%!important;max-width:100%!important;border-collapse:collapse!important}
.admin-content .table-wrap,.admin-content .table-responsive{max-width:100%!important;overflow-x:auto!important}
.admin-content input,.admin-content select,.admin-content textarea{min-width:0!important;max-width:100%!important}
.admin-content button,.admin-content .btn,.admin-content input[type=submit]{max-width:100%!important}
.admin-footer{display:flex!important;justify-content:space-between!important;gap:12px!important;flex-wrap:wrap!important;margin-top:auto!important;padding:16px clamp(16px,2.3vw,32px)!important;color:var(--bv-muted)!important;border-top:1px solid rgba(145,174,220,.13)!important;font-size:12px!important}
.mobile-nav-toggle{display:none!important;border:1px solid var(--bv-border)!important;background:#203657!important;color:#fff!important;border-radius:10px!important;padding:9px 12px!important}
.alert{max-width:100%!important;overflow-wrap:anywhere!important}

/* Landing page — clean white/blue responsive design */
body:not(.admin-theme):not(:has(.user-layout)){background:var(--bv-light-bg)!important;color:var(--bv-light-text)!important}
.shell{display:block!important;width:min(1160px,calc(100% - 36px))!important;max-width:1160px!important;margin:0 auto!important;padding:22px 0 32px!important}
.top{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:18px!important;flex-wrap:wrap!important;padding:8px 0 22px!important}
.brand{display:inline-flex!important;align-items:center!important;gap:10px!important;color:#1a3c70!important;font-size:24px!important;font-weight:900!important;text-decoration:none!important;white-space:nowrap!important}
.brand-mark{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:40px!important;height:40px!important;border-radius:13px!important;background:linear-gradient(135deg,#2674ff,#6455ff)!important;color:#fff!important;box-shadow:0 8px 22px rgba(52,120,255,.22)!important}
.top nav,.top .actions{display:flex!important;align-items:center!important;gap:10px!important;flex-wrap:wrap!important}
.top nav a{color:#45658f!important;text-decoration:none!important;padding:8px 10px!important;border-radius:9px!important}
.top nav a:hover{background:#e5efff!important;color:#225de5!important}
.hero{display:grid!important;grid-template-columns:minmax(0,1.2fr) minmax(260px,.8fr)!important;align-items:center!important;gap:24px!important;min-width:0!important;margin:0 0 22px!important;padding:clamp(24px,4vw,48px)!important;border:1px solid #dce8fb!important;border-radius:24px!important;background:linear-gradient(125deg,#fff 0%,#edf5ff 62%,#e6fbf7 100%)!important;box-shadow:0 16px 42px rgba(37,78,137,.07)!important}
.hero h1{margin:0 0 14px!important;color:#102d56!important;font-size:clamp(28px,4vw,44px)!important;line-height:1.4!important}
.hero p{color:#5a7194!important;font-size:15px!important;line-height:2!important}
.hero .actions{display:flex!important;gap:10px!important;flex-wrap:wrap!important}
.card{min-width:0!important;background:#fff!important;border:1px solid #dce7f7!important;border-radius:18px!important;padding:clamp(18px,2.5vw,26px)!important;box-shadow:0 10px 28px rgba(36,72,124,.045)!important}
.card h2,.card h3{margin-top:0!important;color:#17345e!important}
.grid{display:grid!important;gap:16px!important;min-width:0!important}
.grid.three{grid-template-columns:repeat(3,minmax(0,1fr))!important}
.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.form-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:15px!important;align-items:end!important}
.form-grid .span-2{grid-column:1/-1!important}
.form-grid label{display:block!important;margin:0 0 7px!important;color:#24456f!important;font-weight:700!important}
.form-grid input,.form-grid select,.form-grid textarea,.shell input,.shell select,.shell textarea{width:100%!important;min-width:0!important;max-width:100%!important;min-height:44px!important;border:1px solid #cbd9ed!important;border-radius:11px!important;background:#fff!important;color:#14284a!important;padding:10px 12px!important}
button,.button,.shell .btn,.shell input[type=submit]{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;min-height:42px!important;padding:10px 17px!important;border:1px solid transparent!important;border-radius:11px!important;background:linear-gradient(120deg,#2877ff,#4d59ff)!important;color:#fff!important;text-decoration:none!important;font-weight:700!important;line-height:1.4!important}
button:hover,.button:hover,.shell .btn:hover,.shell input[type=submit]:hover{filter:brightness(1.04)!important}
button.secondary,.button.secondary,.shell .secondary{background:#fff!important;color:#2b5fc7!important;border-color:#d2e0f4!important}
.shell .alert{margin:0 0 16px!important;padding:12px 15px!important;border-radius:12px!important}
.site-footer{display:flex!important;justify-content:space-between!important;gap:10px!important;flex-wrap:wrap!important;margin-top:24px!important;padding:18px 4px!important;color:#7185a4!important;border-top:1px solid #dce6f4!important;font-size:12px!important}
.shell section{margin-bottom:18px!important}
.shell .grid article{height:100%!important}

/* Keep the light user portal readable while fixing common overflow issues */
.user-layout{min-width:0!important;width:100%!important;overflow-x:clip!important}
.user-main{min-width:0!important;width:100%!important}
.user-topbar,.user-profile-chip,.user-top-actions{display:flex!important;align-items:center!important;gap:10px!important;flex-wrap:wrap!important;min-width:0!important}
.user-content-grid,.user-bottom-grid,.user-summary-grid,.user-credential-grid,.user-metric-grid{min-width:0!important}
.user-card,.user-info-card,.credential-card,.user-metric-card{min-width:0!important;overflow-wrap:anywhere!important}
.user-card table{width:100%!important}
.user-card input,.user-card select,.user-card textarea{max-width:100%!important;min-width:0!important}
@media(max-width:1050px){
 .admin-layout{grid-template-columns:minmax(0,1fr) 235px!important}
 .admin-sidebar{width:235px!important;padding:18px 12px!important}
 .hero{grid-template-columns:minmax(0,1fr)!important}
 .grid.three{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:760px){
 .admin-layout{display:block!important}
 .admin-sidebar{position:fixed!important;top:0!important;right:0!important;bottom:0!important;width:min(290px,86vw)!important;height:100dvh!important;transform:translateX(105%)!important;transition:transform .2s ease!important;box-shadow:none!important}
 .admin-layout.nav-open .admin-sidebar{transform:translateX(0)!important;box-shadow:0 0 0 100vw rgba(0,0,0,.45)!important}
 .admin-main{width:100%!important}
 .admin-topbar{min-height:60px!important;padding:10px 14px!important;gap:8px!important}
 .mobile-nav-toggle{display:inline-flex!important;align-items:center!important;justify-content:center!important}
 .admin-search{flex-basis:100%!important;order:3!important}
 .admin-top-actions{margin-inline-start:auto!important}
 .admin-content{padding:16px 12px!important}
 .page-heading{align-items:flex-start!important}
 .admin-content table{min-width:650px!important}
 .admin-footer{padding:14px 12px!important}
 .shell{width:calc(100% - 24px)!important;padding-top:12px!important}
 .top{align-items:flex-start!important}
 .top nav{width:100%!important}
 .top nav a{padding:7px 8px!important}
 .hero{padding:22px!important;border-radius:18px!important}
 .grid.three,.grid.two,.form-grid{grid-template-columns:minmax(0,1fr)!important}
 .form-grid .span-2{grid-column:auto!important}
}



/* BVPN dashboard visual recovery v2 — scoped, additive rules */
.admin-theme .admin-content{min-width:0;width:100%;box-sizing:border-box}
.admin-theme .page-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin:12px 0 26px}
.admin-theme .page-heading h1{margin:0 0 8px;font-size:clamp(1.35rem,2vw,2rem);line-height:1.5}
.admin-theme .page-heading p{margin:0;opacity:.78;line-height:1.9}
.admin-theme .stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:22px 0}
.admin-theme .stat-card{display:flex;align-items:center;gap:14px;min-width:0;padding:20px;border:1px solid #2c4165;border-radius:16px;background:linear-gradient(145deg,#1c2c4a,#17243e);box-shadow:0 8px 24px rgba(0,0,0,.12)}
.admin-theme .stat-icon{width:48px;height:48px;flex:0 0 48px;display:grid;place-items:center;border-radius:14px;background:#315caa;color:#fff;font-size:1.25rem}
.admin-theme .stat-icon.cyan{background:#0e948f}.admin-theme .stat-icon.green{background:#14805e}.admin-theme .stat-icon.red{background:#b83c5b}
.admin-theme .stat-copy{display:flex;flex-direction:column;gap:6px;min-width:0}
.admin-theme .stat-copy strong,.admin-theme .stat-copy b{font-size:1.35rem;line-height:1.35;overflow-wrap:anywhere}
.admin-theme .stat-copy span,.admin-theme .stat-copy small{font-size:.85rem;color:#a9bfdf;line-height:1.7}
.admin-theme .admin-chart-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin:22px 0}
.admin-theme .panel{min-width:0;margin:18px 0;padding:20px;border:1px solid #2b4064;border-radius:16px;background:#172642;color:#e8f0ff;box-shadow:0 8px 24px rgba(0,0,0,.10)}
.admin-theme .section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
.admin-theme .section-head h2,.admin-theme .section-head h3{margin:0;font-size:1.05rem}
.admin-theme .chart-legend{display:flex;flex-wrap:wrap;gap:14px;color:#b9c9e4;font-size:.82rem}
.admin-theme .legend-dot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-inline-end:5px;background:#3c7cff}
.admin-theme .chart-area{width:100%;min-height:180px;overflow:hidden}
.admin-theme .activity-list{display:flex;flex-direction:column;gap:0}
.admin-theme .activity-row{display:flex;gap:12px;padding:13px 0;border-bottom:1px solid rgba(151,177,219,.13)}
.admin-theme .activity-row:last-child{border-bottom:0}
.admin-theme .activity-dot{width:10px;height:10px;flex:0 0 10px;margin-top:7px;border-radius:50%;background:#4d7dff}
.admin-theme .activity-body{min-width:0;line-height:1.8;overflow-wrap:anywhere}
.admin-theme .table-wrap{width:100%;overflow-x:auto;border:1px solid #2b4064;border-radius:12px}
.admin-theme table{width:100%;border-collapse:collapse;min-width:620px}
.admin-theme th,.admin-theme td{padding:13px 15px;text-align:right;border-bottom:1px solid rgba(151,177,219,.15);vertical-align:middle}
.admin-theme th{background:#1d2e4c;color:#a9c8ff;font-weight:600;white-space:nowrap}
.admin-theme td{color:#e7efff}
.admin-theme .badge{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border-radius:999px;font-size:.78rem;white-space:nowrap}
.admin-theme .badge.green{background:#105647;color:#6ff0c6}.admin-theme .badge.red{background:#5c2939;color:#ffb4c5}.admin-theme .badge.blue{background:#253e70;color:#b8d0ff}
.admin-theme .actions,.admin-theme .table-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.admin-theme .button,.admin-theme .btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:10px 15px;border:1px solid #344c74;border-radius:10px;background:#213657;color:#edf4ff;text-decoration:none;cursor:pointer;font:inherit}
.admin-theme .button.primary,.admin-theme .button:not(.secondary){background:linear-gradient(120deg,#2879ff,#514bff);border-color:transparent;color:white}
.admin-theme .empty{padding:22px;border:1px dashed #395176;border-radius:12px;color:#a9bfdf;text-align:center;line-height:1.9}
.admin-theme form{max-width:100%}
.admin-theme input,.admin-theme select,.admin-theme textarea{max-width:100%;box-sizing:border-box}
@media(max-width:1050px){.admin-theme .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.admin-theme .admin-chart-grid{grid-template-columns:1fr}}
@media(max-width:600px){.admin-theme .stats-grid{grid-template-columns:1fr}.admin-theme .page-heading{flex-direction:column}.admin-theme .panel{padding:14px}}

/* BVPN v10 release override — must remain after assets/style.css */
html[dir="rtl"] { direction: rtl; }
body:not(.admin-theme) {
  direction: rtl; text-align: right; font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  line-height: 1.85; overflow-x: hidden;
}
body:not(.admin-theme) .shell {
  width: min(1120px, calc(100% - 32px)); max-width: 1120px;
  margin: 0 auto; padding: 20px 0 36px;
}
body:not(.admin-theme) .top {
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  flex-wrap:wrap; margin:0 0 22px; padding:14px 18px;
  border-radius:16px; background:#fff; box-shadow:0 8px 26px rgba(18,42,76,.08);
}
body:not(.admin-theme) .top nav,
body:not(.admin-theme) .actions {
  display:flex; align-items:center; justify-content:flex-start; gap:10px; flex-wrap:wrap;
}
body:not(.admin-theme) .brand { display:inline-flex; align-items:center; gap:10px; text-decoration:none; white-space:nowrap; }
body:not(.admin-theme) .hero, body:not(.admin-theme) .card {
  min-width:0; margin:0 0 18px; padding:clamp(18px,3vw,30px);
  border-radius:18px; overflow-wrap:anywhere;
}
body:not(.admin-theme) h1, body:not(.admin-theme) h2, body:not(.admin-theme) h3 {
  line-height:1.55; overflow-wrap:anywhere;
}
body:not(.admin-theme) p { line-height:1.95; overflow-wrap:anywhere; }
body:not(.admin-theme) .button, body:not(.admin-theme) button,
body:not(.admin-theme) input[type="submit"] {
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  min-height:42px; padding:9px 16px; border:1px solid #d4dfef; border-radius:10px;
  font:inherit; line-height:1.5; text-decoration:none; cursor:pointer; transition:.18s ease;
}
body:not(.admin-theme) .button.primary, body:not(.admin-theme) button.primary,
body:not(.admin-theme) input[type="submit"] {
  color:#fff; background:linear-gradient(120deg,#2879ff,#514bff); border-color:transparent;
}
body:not(.admin-theme) .button.danger { color:#a72e46; background:#fff4f5; border-color:#f0cbd1; }
body:not(.admin-theme) input, body:not(.admin-theme) select, body:not(.admin-theme) textarea {
  max-width:100%; min-width:0; padding:10px 12px; border:1px solid #cbd8e8;
  border-radius:9px; line-height:1.6;
}
body:not(.admin-theme) textarea { width:100%; min-height:120px; resize:vertical; }
body:not(.admin-theme) .form-grid { gap:14px; }
.user-layout { direction:rtl; text-align:right; }
.user-layout .user-main { min-width:0; }
.user-layout .user-content-grid, .user-layout .user-summary-grid,
.user-layout .user-metric-grid, .user-layout .user-credential-grid,
.user-layout .user-bottom-grid { min-width:0; }
.user-layout .user-topbar { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; }
.user-layout .user-top-actions { display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.user-layout .user-card, .user-layout .user-info-card, .user-layout .user-renew-card,
.user-layout .referral-code-panel, .user-layout .credential-card { min-width:0; overflow-wrap:anywhere; }
.admin-theme { direction:rtl; text-align:right; }
.admin-theme .admin-topbar, .admin-theme .admin-user { direction:rtl; }
.admin-theme .admin-content { margin-inline:auto; }
.admin-theme .page-heading { text-align:right; }
@media(max-width:720px) {
  body:not(.admin-theme) .shell { width:calc(100% - 24px); padding-top:12px; }
  body:not(.admin-theme) .top { align-items:flex-start; padding:12px; }
  body:not(.admin-theme) .top nav { width:100%; }
  body:not(.admin-theme) .top nav .button { flex:1 1 auto; }
  body:not(.admin-theme) .grid.three, body:not(.admin-theme) .grid.two,
  body:not(.admin-theme) .form-grid { grid-template-columns:minmax(0,1fr); }
  body:not(.admin-theme) .form-grid .span-2 { grid-column:auto; }
  .user-layout .user-topbar { align-items:flex-start; }
}
