:root{
  --bg:#f7f7fb;
  --surface:#ffffff;
  --surface-2:#f0f1f6;
  --text:#11121a;
  --muted:#6d6f7a;
  --line:rgba(18,18,26,.09);
  --brand:#FF6B35;
  --brand-2:#FFD200;
  --green:#16a34a;
  --red:#ef4444;
  --shadow:0 18px 45px rgba(18,18,26,.08);
  --sidebar:#ffffff;
  --player:#ffffff;
}

html[data-theme="dark"]{
  --bg:#090910;
  --surface:#14141f;
  --surface-2:#1d1d2a;
  --text:#ffffff;
  --muted:#a4a5b4;
  --line:rgba(255,255,255,.09);
  --shadow:0 18px 45px rgba(0,0,0,.35);
  --sidebar:#12121a;
  --player:#1A1A26;
}

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
  -webkit-tap-highlight-color:transparent;
}

html,body{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
}

body{
  font-family:Inter,sans-serif;
  background:var(--bg);
  color:var(--text);
}

a{text-decoration:none;color:inherit}
button,input,textarea,select{font-family:inherit}

.app,.portal-shell{
  display:flex;
  min-height:100vh;
}

.sidebar{
  width:260px;
  height:100vh;
  position:fixed;
  left:0;
  top:0;
  background:var(--sidebar);
  border-right:1px solid var(--line);
  z-index:1000;
  transition:.3s ease;
  padding-bottom:112px;
  overflow-y:auto;
}

.sidebar-header{
  padding:24px 20px;
  border-bottom:1px solid var(--line);
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:900;
  font-size:20px;
}

.brand-icon{
  width:42px;
  height:42px;
  border-radius:14px;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  display:grid;
  place-items:center;
  color:#111;
  flex:0 0 42px;
}
.brand-icon img{
  width:100%;
  height:100%;
  object-fit:contain;
  padding:6px;
  display:block;
}

.brand span span{color:var(--brand)}

.nav{
  padding:20px 14px;
}

.nav a{
  display:flex;
  align-items:center;
  gap:12px;
  padding:13px 15px;
  border-radius:15px;
  color:var(--muted);
  margin-bottom:8px;
  font-weight:700;
  font-size:14px;
}

.nav a.active,.nav a:hover{
  background:rgba(255,107,53,.12);
  color:var(--brand);
}

.sidebar-profile{
  position:absolute;
  left:14px;
  right:14px;
  bottom:18px;
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:20px;
  padding:13px;
  display:flex;
  align-items:center;
  gap:11px;
}

.sidebar-profile img{
  width:42px;
  height:42px;
  border-radius:14px;
  object-fit:cover;
}

.sidebar-profile strong{
  display:block;
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.sidebar-profile span{
  color:var(--muted);
  font-size:11px;
  font-weight:700;
}

.main,.portal-main{
  flex:1;
  margin-left:260px;
  min-height:100vh;
  overflow-x:hidden;
  padding-bottom:110px;
}

.topbar{
  position:sticky;
  top:0;
  z-index:900;
  background:color-mix(in srgb,var(--bg) 88%,transparent);
  backdrop-filter:blur(18px);
  border-bottom:1px solid var(--line);
  padding:16px 24px;
}

.topbar-inner{
  max-width:1180px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.mobile-left,.top-actions{
  display:flex;
  align-items:center;
  gap:12px;
}

.menu-btn,.icon-btn{
  border:0;
  width:42px;
  height:42px;
  border-radius:15px;
  background:var(--surface);
  color:var(--text);
  box-shadow:0 8px 25px rgba(0,0,0,.05);
  display:grid;
  place-items:center;
  cursor:pointer;
  border:1px solid var(--line);
  flex:0 0 42px;
}

.menu-btn{display:none}

.page-title{
  font-size:17px;
  font-weight:900;
}

.search-top{
  width:min(420px,40vw);
  display:flex;
  align-items:center;
  gap:10px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:16px;
  padding:11px 13px;
}

.search-top i{color:var(--brand)}
.search-top input{
  width:100%;
  border:0;
  outline:0;
  background:transparent;
  color:var(--text);
}

.content,.portal-content{
  max-width:1180px;
  margin:0 auto;
  padding:24px;
  width:100%;
}

.portal-top{
  max-width:1180px;
  margin:24px auto 22px;
  border-radius:34px;
  padding:30px;
  background:
    radial-gradient(circle at 85% 0%,rgba(255,210,0,.25),transparent 34%),
    linear-gradient(135deg,rgba(255,107,53,.18),rgba(255,210,0,.08)),
    var(--surface);
  border:1px solid var(--line);
  box-shadow:var(--shadow);
  display:flex;
  justify-content:space-between;
  gap:24px;
  align-items:center;
  min-width:0;
}

.portal-title h1{
  font-size:clamp(30px,4vw,54px);
  line-height:1;
  letter-spacing:-1.8px;
  font-weight:900;
  margin-bottom:10px;
}

.portal-title p{
  color:var(--muted);
  line-height:1.65;
  font-size:14px;
  max-width:620px;
}

.quick-actions,.top-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.primary-btn,.soft-btn,.btn{
  border:0;
  border-radius:999px;
  padding:13px 18px;
  font-weight:900;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:9px;
}

.primary-btn,.btn-primary{
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  color:#111;
  box-shadow:0 12px 30px rgba(255,107,53,.24);
}

.soft-btn,.btn-soft{
  background:var(--surface-2);
  color:var(--text);
  border:1px solid var(--line);
}

.stats-grid{
  max-width:1180px;
  margin:0 auto 22px;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}

.grid{
  max-width:1180px;
  margin-left:auto;
  margin-right:auto;
  display:grid;
  gap:16px;
}

.stat-card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:24px;
  padding:18px;
  box-shadow:0 10px 30px rgba(0,0,0,.04);
  min-width:0;
}

.stat-card i{
  color:var(--brand);
  font-size:20px;
  margin-bottom:12px;
}

.stat-card strong,.stat-value{
  display:block;
  font-size:24px;
  font-weight:900;
  letter-spacing:-.6px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.stat-card span,.stat-label{
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  margin-top:5px;
  display:block;
}

.trend{
  display:inline-flex;
  align-items:center;
  gap:4px;
  margin-top:12px;
  font-size:12px;
  font-weight:900;
  color:var(--green);
  background:rgba(22,163,74,.1);
  padding:6px 9px;
  border-radius:999px;
}

.layout,.upload-layout{
  max-width:1180px;
  margin:0 auto;
  display:grid;
  grid-template-columns:minmax(0,1.45fr) 360px;
  gap:20px;
  align-items:start;
}

.panel{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:28px;
  padding:22px;
  box-shadow:0 12px 34px rgba(0,0,0,.04);
  margin:0 auto 20px;
  min-width:0;
  max-width:1180px;
}

.upload-layout .panel,.layout .panel{
  margin:0 0 20px;
  max-width:none;
}

.panel-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:18px;
}

.panel-header h2,.panel h2{
  font-size:20px;
  font-weight:900;
  display:flex;
  align-items:center;
  gap:9px;
  margin-bottom:16px;
}

.panel-header h2{margin-bottom:0}
.panel-header h2 i,.panel h2 i{color:var(--brand)}

.see-all{
  color:var(--brand);
  font-weight:900;
  font-size:13px;
}

.chart{
  height:250px;
  display:flex;
  align-items:end;
  gap:12px;
  padding:18px;
  background:var(--surface-2);
  border-radius:22px;
  overflow:hidden;
}

.bar-wrap{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  min-width:0;
}

.bar{
  width:100%;
  border-radius:14px 14px 6px 6px;
  background:linear-gradient(180deg,var(--brand-2),var(--brand));
  min-height:28px;
}

.bar-label{
  font-size:11px;
  color:var(--muted);
  font-weight:800;
}

.track-row{
  display:grid;
  grid-template-columns:48px minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  padding:12px;
  border-radius:18px;
  cursor:pointer;
}

.track-row:hover{background:var(--surface-2)}
.track-row img{
  width:48px;
  height:48px;
  border-radius:14px;
  object-fit:cover;
}

.track-row strong{
  display:block;
  font-size:14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.track-row span{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-top:3px;
}

.track-meta{
  color:var(--green);
  font-weight:900;
  font-size:13px;
  white-space:nowrap;
}

.activity{
  display:grid;
  gap:13px;
}

.activity-item{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:13px;
  border-radius:18px;
  background:var(--surface-2);
}

.activity-icon{
  width:38px;
  height:38px;
  border-radius:14px;
  background:rgba(255,107,53,.14);
  color:var(--brand);
  display:grid;
  place-items:center;
  flex:0 0 auto;
}

.activity-item strong{
  display:block;
  font-size:13px;
  margin-bottom:3px;
}

.activity-item span{
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
}

.wallet-box{
  background:linear-gradient(135deg,rgba(255,107,53,.15),rgba(255,210,0,.12));
  border:1px solid rgba(255,107,53,.22);
  border-radius:24px;
  padding:20px;
  margin-bottom:16px;
}

.wallet-box span{
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}

.wallet-box strong{
  display:block;
  font-size:31px;
  font-weight:900;
  margin:7px 0 14px;
}

.full-btn{
  width:100%;
  border:0;
  border-radius:16px;
  padding:13px;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  color:#111;
  font-weight:900;
  cursor:pointer;
  display:block;
  text-align:center;
}

.mini-card{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:13px;
  border-radius:18px;
  background:var(--surface-2);
  margin-bottom:10px;
}

.mini-card span{
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}

.mini-card strong{
  font-size:14px;
  text-align:right;
  overflow-wrap:anywhere;
}

.upload-box{
  border:1px dashed rgba(255,107,53,.45);
  background:rgba(255,107,53,.08);
  border-radius:24px;
  padding:20px;
  text-align:center;
}

.upload-box i{
  font-size:28px;
  color:var(--brand);
  margin-bottom:12px;
}

.upload-box h3{
  font-size:17px;
  margin-bottom:6px;
}

.upload-box p{
  color:var(--muted);
  font-size:13px;
  line-height:1.6;
  margin-bottom:14px;
}

.overlay,.portal-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  z-index:999;
}

.overlay.active,.portal-overlay.active{display:block}

.form-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.field{
  display:grid;
  gap:7px;
  margin-bottom:15px;
}

.field.full{grid-column:1/-1}
.field label{
  color:var(--muted);
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.06em;
}

.field input,.field textarea,.field select{
  width:100%;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--surface-2);
  color:var(--text);
  padding:13px 14px;
  outline:0;
}

.field textarea{
  min-height:112px;
  resize:vertical;
}

.field input:focus,.field textarea:focus,.field select:focus{
  border-color:rgba(255,107,53,.55);
  box-shadow:0 0 0 4px rgba(255,107,53,.08);
}

.table-wrap{overflow-x:auto}
table{
  width:100%;
  border-collapse:collapse;
  min-width:720px;
}

th,td{
  padding:13px 10px;
  border-bottom:1px solid var(--line);
  text-align:left;
  font-size:14px;
}

th{
  color:var(--muted);
  text-transform:uppercase;
  font-size:11px;
  letter-spacing:.08em;
}

.song-cell{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:240px;
}

.song-cell img{
  width:48px;
  height:48px;
  border-radius:14px;
  object-fit:cover;
  background:var(--surface-2);
}

.song-cell span{color:var(--muted)}

.badge{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:900;
  background:rgba(255,107,53,.13);
  color:var(--brand);
}

.alert{
  max-width:1180px;
  margin:0 auto 18px;
  padding:13px 15px;
  border-radius:16px;
  font-weight:800;
  line-height:1.5;
}

.alert-error{
  background:rgba(239,68,68,.13);
  color:#fecaca;
  border:1px solid rgba(239,68,68,.24);
}

.alert-success{
  background:rgba(22,163,74,.12);
  color:var(--green);
  border:1px solid rgba(22,163,74,.24);
}

.empty{
  padding:24px;
  border-radius:20px;
  background:var(--surface-2);
  color:var(--muted);
  line-height:1.7;
  text-align:center;
}

.hint-list{
  display:grid;
  gap:12px;
  color:var(--muted);
  line-height:1.6;
}

.auth-page{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;
  background:radial-gradient(circle at 80% 0%,rgba(255,210,0,.22),transparent 35%),var(--bg);
}

.auth-card{
  width:min(980px,100%);
  display:grid;
  grid-template-columns:.95fr 1.05fr;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:28px;
  overflow:hidden;
  box-shadow:var(--shadow);
}

.auth-art{
  padding:36px;
  background:linear-gradient(135deg,rgba(255,107,53,.24),rgba(255,210,0,.16));
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  min-height:520px;
}

.auth-art h1{
  font-size:clamp(36px,6vw,66px);
  line-height:.92;
  margin-bottom:14px;
}

.auth-art p{
  color:var(--muted);
  line-height:1.7;
}

.auth-form{padding:34px}
.auth-form h2{font-size:28px;margin-bottom:8px}
.auth-form>p{color:var(--muted);margin-bottom:24px}
.auth-footer{margin-top:16px;color:var(--muted)}
.auth-footer a{color:var(--brand);font-weight:900}

@media(max-width:1100px){
  .layout,.upload-layout{grid-template-columns:1fr}
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:1024px){
  .sidebar{
    transform:translateX(-100%);
    width:min(280px,86vw);
  }

  .sidebar.open{
    transform:translateX(0);
  }

  .main,.portal-main{
    margin-left:0;
  }

  .menu-btn{
    display:grid;
  }

  .topbar{
    padding:14px 18px;
  }

  .content,.portal-content{
    padding:18px;
  }

  .search-top{
    display:none;
  }
}

@media(max-width:760px){
  .portal-top{
    flex-direction:column;
    align-items:flex-start;
    padding:22px;
    border-radius:28px;
  }

  .portal-title h1{
    font-size:34px;
    letter-spacing:-1px;
  }

  .quick-actions,.top-actions{
    width:100%;
  }

  .primary-btn,.soft-btn,.btn{
    flex:1;
    justify-content:center;
  }

  .stats-grid{
    grid-template-columns:1fr;
  }

  .panel{
    padding:17px;
    border-radius:23px;
  }

  .panel-header{
    align-items:flex-start;
    flex-direction:column;
  }

  .chart{
    height:210px;
    gap:7px;
    padding:12px;
  }

  .track-row{
    grid-template-columns:44px minmax(0,1fr);
  }

  .track-meta{
    grid-column:2;
  }

  .auth-card,.form-grid{
    grid-template-columns:1fr;
  }

  .auth-art{
    min-height:280px;
  }
}

@media(max-width:520px){
  .content,.portal-content{
    padding:14px;
  }

  .page-title{
    display:none;
  }

  .portal-top{
    padding:18px;
    border-radius:24px;
  }

  .portal-title h1{
    font-size:30px;
  }

  .primary-btn,.soft-btn,.btn{
    width:100%;
    flex:none;
  }

  .auth-form,.auth-art{
    padding:24px;
  }
}
