:root{
  --bg:#07070a;
  --panel:#101017;
  --panel2:#15151f;
  --red:#d91135;
  --red2:#7d0015;
  --text:#f5f7fb;
  --muted:#a7adba;
  --border:rgba(255,255,255,.08);
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:Inter,Arial,sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at 12% 8%,rgba(217,17,53,.16),transparent 28%),
    radial-gradient(circle at 85% 18%,rgba(125,0,21,.16),transparent 28%),
    linear-gradient(135deg,rgba(255,255,255,.025) 25%,transparent 25%) 0 0/34px 34px,
    var(--bg);
  min-height:100vh;
}
a{text-decoration:none;color:inherit}
button,input,select,textarea{font:inherit}

.landing,.guest-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns:1fr 430px;
  align-items:center;
  gap:42px;
  padding:56px;
  max-width:1280px;
  margin:0 auto;
}
.hero-card,.auth-card,.card{
  background:rgba(16,16,23,.9);
  border:1px solid var(--border);
  border-radius:26px;
  padding:28px;
  box-shadow:0 20px 55px rgba(0,0,0,.35);
}
.brand{display:flex;align-items:center;gap:14px;margin-bottom:28px}
.brand-icon,.brand-mark{
  width:50px;height:50px;border-radius:16px;
  background:linear-gradient(135deg,var(--red),var(--red2));
  display:grid;place-items:center;font-weight:900;font-size:22px;
}
.brand h1{margin:0;font-size:30px;letter-spacing:.2px}
.brand span{display:block;color:var(--muted);margin-top:4px;font-size:14px}
.hero h2{font-size:44px;line-height:1.12;margin:0 0 18px;max-width:760px}
.hero p{font-size:17px;line-height:1.7;color:var(--muted);max-width:720px;margin:0 0 28px}
.landing-buttons{display:flex;gap:12px;flex-wrap:wrap}
.btn,button{
  border:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  background:linear-gradient(135deg,var(--red),var(--red2));
  color:#fff;
  padding:12px 18px;
  border-radius:14px;
  font-weight:800;
  cursor:pointer;
}
.btn-outline{background:rgba(255,255,255,.04);border:1px solid rgba(217,17,53,.35)}
.btn-sm{padding:8px 11px;font-size:12px;border-radius:10px}
input,select,textarea{
  width:100%;
  background:#0b0b10;
  color:var(--text);
  border:1px solid var(--border);
  border-radius:14px;
  padding:13px 14px;
  outline:none;
  margin:8px 0 14px;
}
input:focus,select:focus,textarea:focus{border-color:rgba(217,17,53,.7);box-shadow:0 0 0 4px rgba(217,17,53,.08)}
label{font-weight:700;color:#d8dbe3;font-size:14px}

.sidebar-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.62);z-index:990}
.sidebar-overlay.active{display:block}
.sidebar{
  position:fixed;inset:0 auto 0 0;width:280px;
  background:#09090d;
  border-right:1px solid rgba(217,17,53,.18);
  padding:18px;
  z-index:1000;
  transform:translateX(-105%);
  transition:.25s;
}
.sidebar.active{transform:translateX(0)}
.sidebar-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}
.close-btn{width:40px;height:40px;padding:0;background:#161620}
.nav-section,.menu-title{font-size:11px;text-transform:uppercase;letter-spacing:.12em;color:#747b8b;margin:20px 10px 9px}
.sidebar a{
  display:flex;align-items:center;gap:12px;
  padding:12px 14px;border-radius:14px;color:#e5e7eb;margin-bottom:6px;
  background:rgba(255,255,255,.025);
}
.sidebar a:hover,.sidebar a.active{background:rgba(217,17,53,.14);color:#fff}

.main{
  min-height:100vh;
  padding:28px;
  max-width:1280px;
  margin:0 auto;
}
.topbar{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  background:rgba(16,16,23,.82);
  border:1px solid var(--border);
  border-radius:24px;
  padding:16px 18px;
  margin-bottom:24px;
}
.menu-btn{width:50px;height:50px;padding:0;border-radius:15px}
.top-title h2,.page-head h1{margin:0;font-size:28px}
.top-title p,.page-head p{margin:6px 0 0;color:var(--muted)}
.page-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:24px}
.stats-grid,.grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:18px;
  margin-bottom:24px;
}
.stat,.dashboard-card{
  background:rgba(16,16,23,.9);
  border:1px solid var(--border);
  border-radius:24px;
  padding:22px;
}
.stat b,.num{font-size:30px;color:#fff}
.stat span,.card h3{display:block;color:var(--muted);margin-top:7px}
.card{margin-bottom:20px}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;min-width:760px}
th,td{padding:14px;border-bottom:1px solid rgba(255,255,255,.07);text-align:left}
th{color:#ff7a92;background:rgba(217,17,53,.06)}
.alert{padding:14px 16px;border-radius:15px;margin-bottom:16px;border:1px solid var(--border);transition:.3s}
.alert.success{background:rgba(34,197,94,.10);color:#86efac}
.alert.error{background:rgba(217,17,53,.10);color:#ff9aad}

.platform-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:24px}
.platform-card{display:flex;align-items:center;gap:14px;text-align:left;background:rgba(16,16,23,.9);border:1px solid var(--border);border-radius:22px;padding:18px;color:#fff;cursor:pointer}
.platform-logo{width:48px;height:48px;border-radius:16px;background:rgba(217,17,53,.12);display:grid;place-items:center;color:#ff5b78;font-size:22px;font-weight:900;border:1px solid rgba(217,17,53,.22)}
.platform-card h3{margin:0 0 4px;font-size:18px}
.platform-card p{margin:0;color:var(--muted);font-size:13px}
.platform-section{display:none;margin-bottom:24px}
.platform-section.active{display:block}
.service-group{background:#0d0d13;border:1px solid var(--border);border-radius:18px;margin-bottom:12px;overflow:hidden}
.service-group-head{width:100%;justify-content:space-between;background:#14141d;box-shadow:none;border-radius:0}
.service-group-body{display:none;padding:14px}
.service-group.active .service-group-body{display:block}
.service-item{display:flex;justify-content:space-between;gap:15px;background:#09090d;border:1px solid var(--border);border-radius:15px;padding:14px;margin-bottom:10px}
.service-item h4{margin:0 0 5px}.service-item p{margin:0;color:var(--muted);font-size:12px}
.service-price{text-align:right;min-width:130px}.service-price strong{color:#ff5b78;display:block}
.order-layout{display:grid;grid-template-columns:1fr 340px;gap:20px}
.total-box{display:flex;justify-content:space-between;align-items:center;background:#0b0b10;border:1px solid rgba(217,17,53,.16);border-radius:16px;padding:15px;margin:12px 0}
.total-box strong{color:#ff5b78;font-size:22px}
.ticket-box,.ticket-admin-box{background:#0b0b10;border:1px solid var(--border);border-radius:16px;padding:16px;margin-bottom:14px}
.reply-box{background:rgba(217,17,53,.08);border:1px solid rgba(217,17,53,.16);border-radius:15px;padding:13px;margin-top:12px}

@media(min-width:1040px){
  .sidebar{transform:none}
  .main{margin-left:280px;max-width:none;padding:30px}
  .menu-btn,.close-btn,.sidebar-overlay{display:none!important}
}
@media(max-width:1000px){
  .landing,.guest-shell{grid-template-columns:1fr;padding:28px}
  .hero h2{font-size:34px}
  .stats-grid,.grid,.platform-grid{grid-template-columns:repeat(2,1fr)}
  .two-col,.order-layout{grid-template-columns:1fr}
}
@media(max-width:600px){
  .landing,.guest-shell{padding:18px}
  .hero h2{font-size:28px}
  .hero-card,.auth-card,.card{padding:20px;border-radius:22px}
  .stats-grid,.grid,.platform-grid{grid-template-columns:1fr}
  .main{padding:16px}
  .topbar,.page-head{align-items:flex-start;flex-direction:column}
  .service-item{flex-direction:column}
  .service-price{text-align:left}
}
.lang-switch{
display:flex;
align-items:center;
gap:8px;
flex-wrap:wrap;
}

.lang-item{
display:inline-flex;
align-items:center;
gap:6px;
padding:7px 10px;
border-radius:10px;
background:rgba(255,255,255,.05);
border:1px solid rgba(255,255,255,.08);
color:#fff;
font-size:12px;
font-weight:700;
text-decoration:none;
}

.lang-item img{
width:20px;
height:14px;
object-fit:cover;
border-radius:2px;
display:block;
}

.lang-item.active{
background:rgba(217,17,53,.18);
border-color:rgba(217,17,53,.35);
}
/* PanelSMM logo */
.logo-img{
height:42px;
width:auto;
display:block;
}

.brand-logo-img{
height:48px;
width:auto;
display:block;
}

@media(max-width:768px){
.logo-img{
height:36px;
}
.brand-logo-img{
height:40px;
}
/* Mobile sidebar scroll + no horizontal overflow fix */
html,
body{
max-width:100%;
overflow-x:hidden;
}

.sidebar{
overflow-y:auto !important;
overflow-x:hidden !important;
-webkit-overflow-scrolling:touch;
}

@media(max-width:1039px){
.sidebar{
height:100vh !important;
max-height:100vh !important;
padding-bottom:90px !important;
}

.sidebar a{
min-height:46px;
padding:11px 13px;
}

.nav-section{
margin-top:14px;
margin-bottom:7px;
}

.main,
.content,
.topbar,
.card,
.table-wrap,
.two-col,
.order-layout{
max-width:100% !important;
overflow-x:hidden !important;
}

.table-wrap{
overflow-x:auto !important;
-webkit-overflow-scrolling:touch;
}

table{
min-width:0 !important;
width:100% !important;
}

/* Admin users balance form compact */
td form,
.balance-form,
form[method="POST"]{
max-width:100%;
}

.admin-balance-form,
td form[method="POST"]{
display:flex !important;
align-items:center !important;
gap:6px !important;
flex-wrap:nowrap !important;
}

td form[method="POST"] input[type="number"]{
width:82px !important;
min-width:82px !important;
padding:8px 9px !important;
font-size:13px !important;
}

td form[method="POST"] button{
padding:8px 10px !important;
min-width:38px !important;
font-size:13px !important;
border-radius:10px !important;
}

/* Cards and forms less wide on mobile */
.card{
padding:16px !important;
}

input,
select,
textarea{
max-width:100%;
}

.page-head{
gap:10px !important;
}

.balance-chip,
.balance-pill{
white-space:nowrap;
}

/* If a table still causes overflow, make user/admin rows readable */
@media(max-width:700px){
.table-wrap table{
font-size:13px;
}

.table-wrap th,
.table-wrap td{
padding:10px 8px;
}

td form[method="POST"]{
gap:5px !important;
}

td form[method="POST"] input[type="number"]{
width:70px !important;
min-width:70px !important;
}

td form[method="POST"] button{
padding:7px 8px !important;
min-width:34px !important;

}

/* Landing logo fix */
.landing-logo-wrap{
display:flex;
align-items:center;
justify-content:flex-start;
text-decoration:none;
}

.landing-logo-img{
height:58px;
width:auto;
display:block;
filter:drop-shadow(0 0 16px rgba(255,45,85,.35));
}

.brand .landing-logo-img{
height:58px;
}

@media(max-width:768px){
.landing-logo-img,
.brand .landing-logo-img{
height:46px;
}
}
/* Real platform logo cards */
.platform-logo{
width:58px !important;
height:58px !important;
border-radius:18px !important;
display:flex !important;
align-items:center !important;
justify-content:center !important;
background:#0b0b10 !important;
border:1px solid rgba(255,255,255,.08) !important;
box-shadow:inset 0 0 18px rgba(255,255,255,.035);
}

.platform-logo-img{
width:38px !important;
height:38px !important;
object-fit:contain !important;
display:block !important;
}

.platform-card{
transition:.2s ease !important;
}

.platform-card:hover{
transform:translateY(-3px) !important;
box-shadow:0 0 22px rgba(255,45,85,.16) !important;
}
/* Final production polish */
body.loading *{
cursor:wait;
}

.btn, button, .platform-card, .card{
transition:.2s ease;
}

.btn:hover, button:hover{
transform:translateY(-1px);
}

.content{
padding-bottom:40px;
}

.footer-links{
display:flex;
gap:12px;
flex-wrap:wrap;
justify-content:center;
margin-top:20px;
color:#9ca3af;
font-size:13px;
}

.footer-links a:hover{
color:#fff;
}