:root{
  --bg:#0b1220;
  --panel:#111a2b;
  --card:#141f33;
  --text:#ffffff;
  --muted:rgba(255,255,255,.65);
  --muted2:rgba(255,255,255,.45);
  --border:rgba(255,255,255,.10);

  --accent:#ff7a00;
  --accent2:#ff9a3d;

  --good:#22c55e;
  --bad:#ef4444;
  --info:#60a5fa;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family:'Roboto', sans-serif;
  background:
    radial-gradient(1200px 800px at 20% 0%, rgba(255,122,0,.14), transparent 60%),
    radial-gradient(900px 700px at 80% 10%, rgba(96,165,250,.12), transparent 60%),
    var(--bg);
  color:var(--text);
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}

.dashboard{
  width:min(1320px, 100%);
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border:1px solid var(--border);
  border-radius:16px;
  overflow:hidden;
  box-shadow:0 30px 70px rgba(0,0,0,.55);
}

.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 20px;
  background:linear-gradient(90deg, rgba(255,122,0,.18), rgba(96,165,250,.10));
  border-bottom:1px solid var(--border);
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
}
.brand-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 0 6px rgba(255,122,0,.15);
}
.brand-text h1{
  margin:0;
  font-size:18px;
  letter-spacing:.2px;
}
.brand-text p{
  margin:2px 0 0 0;
  font-size:12px;
  color:var(--muted);
}

.pill{
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  color:var(--muted);
  background:rgba(0,0,0,.22);
  font-size:12px;
}

.content{
  display:grid;
  grid-template-columns: 1.25fr .75fr;
  gap:16px;
  padding:16px;
}

.card{
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.02));
  border:1px solid var(--border);
  border-radius:14px;
  padding:16px;
}

.card-title h2{
  margin:0;
  font-size:16px;
}
.card-title p{
  margin:6px 0 0 0;
  font-size:12px;
  color:var(--muted);
}

.form-grid{
  display:grid;
  gap:14px;
  margin-top:14px;
}

.field label{
  display:block;
  margin-bottom:8px;
  font-weight:600;
  font-size:13px;
}
.field small{
  display:block;
  margin-top:7px;
  color:var(--muted2);
  font-size:12px;
  line-height:1.35;
}

.row{
  display:flex;
  gap:10px;
  align-items:center;
}

input, select{
  width:100%;
  padding:12px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:rgba(0,0,0,.18);
  color:var(--text);
  outline:none;
  transition: border-color .18s, box-shadow .18s;
}

input:focus, select:focus{
  border-color: rgba(255,122,0,.55);
  box-shadow:0 0 0 4px rgba(255,122,0,.18);
}

.btn{
  border:none;
  padding:12px 14px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
  letter-spacing:.2px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  transition: transform .06s, opacity .15s, box-shadow .15s;
  width:100%;
}
.btn:active{ transform: scale(.99); }

.btn-primary{
  background:linear-gradient(90deg, var(--accent), var(--accent2));
  color:#0a0f1a;
  box-shadow:0 12px 25px rgba(255,122,0,.20);
}
.btn-secondary{
  background:rgba(96,165,250,.18);
  border:1px solid rgba(96,165,250,.32);
  color:var(--text);
}
.btn-ghost{
  background:rgba(255,255,255,.06);
  border:1px solid var(--border);
  color:var(--text);
}
.btn-danger{
  background:rgba(239,68,68,.16);
  border:1px solid rgba(239,68,68,.35);
  color:var(--text);
}

.btn:disabled{ opacity:.55; cursor:not-allowed; }

.btn-spinner{
  width:16px;
  height:16px;
  border-radius:50%;
  border:2px solid rgba(0,0,0,.25);
  border-top-color: rgba(0,0,0,.75);
  display:none;
  animation: spin .7s linear infinite;
}
.loading .btn-spinner{ display:block; }
@keyframes spin { to { transform: rotate(360deg); } }

.right-column{
  display:grid;
  gap:16px;
}

.preview-card{
  padding:0;
  overflow:hidden;
}

.preview-hero{
  position:relative;
  min-height:320px;
  background: linear-gradient(180deg, rgba(0,0,0,.2), rgba(0,0,0,.78));
}
.preview-hero.has-bg{
  background-size:cover;
  background-position:center;
}
.preview-overlay{
  position:absolute;
  inset:0;
  background:linear-gradient(90deg, rgba(0,0,0,.86), rgba(0,0,0,.55) 55%, rgba(0,0,0,.88));
}
.preview-content{
  position:relative;
  z-index:2;
  display:flex;
  gap:14px;
  padding:16px;
  align-items:flex-start;
}
.poster{
  width:120px;
  height:180px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  flex:0 0 auto;
  background-size:cover;
  background-position:center;
  box-shadow:0 12px 30px rgba(0,0,0,.5);
}
.meta h3{
  margin:0;
  font-size:16px;
}
.meta .sub{
  margin:6px 0 10px 0;
  color:var(--muted);
  font-size:12px;
}
.meta-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.badge{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
}
.overview{
  margin:0;
  color:rgba(255,255,255,.80);
  font-size:12.5px;
  line-height:1.45;
  max-height:120px;
  overflow:hidden;
}

.divider{
  height:1px;
  background:var(--border);
  margin:2px 0;
}

.full{ grid-column: 1 / -1; }

.section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.section-head h3{
  margin:0;
  font-size:14px;
}
.section-actions{
  display:flex;
  gap:10px;
}
.section-actions .btn{ width:auto; padding:10px 12px; border-radius:10px; font-size:12px; }

.season-bar{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:10px;
}
.season-bar select{
  max-width:220px;
}

.episodes-panel{
  margin-top:12px;
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
  background:rgba(0,0,0,.12);
}
.episodes-head{
  display:grid;
  grid-template-columns: 90px 1fr 110px;
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  color:var(--muted);
  font-size:12px;
}
.episodes-list{
  padding:12px;
  display:grid;
  gap:10px;
}
.episode-row{
  display:grid;
  grid-template-columns: 90px 1fr 110px;
  gap:10px;
  align-items:center;
}
.episode-row .ep-label{
  color:rgba(255,255,255,.88);
  font-size:12px;
}
.episode-row input{
  padding:10px 12px;
  border-radius:10px;
}
.episode-row .btn{
  width:110px;
  padding:10px 12px;
  border-radius:10px;
  font-size:12px;
}

.hint{
  padding:10px 12px;
  border-top:1px solid var(--border);
  color:var(--muted2);
  font-size:12px;
}

.message{
  margin-top:12px;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(0,0,0,.22);
  color:var(--muted);
  min-height:44px;
  display:flex;
  align-items:center;
}
.message.good{ border-color:rgba(34,197,94,.35); background:rgba(34,197,94,.10); color:#c8f7d8; }
.message.bad{ border-color:rgba(239,68,68,.35); background:rgba(239,68,68,.10); color:#ffd0d0; }
.message.info{ border-color:rgba(96,165,250,.35); background:rgba(96,165,250,.10); color:#d7ebff; }

.actions{
  display:grid;
  gap:10px;
  margin-top:12px;
}

.footer{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-top:1px solid var(--border);
  color:var(--muted);
  font-size:12px;
}
.dim{ color:var(--muted2); }

@media (max-width: 980px){
  .content{ grid-template-columns: 1fr; }
  .section-actions{ flex-wrap:wrap; }
}

@media (max-width: 520px){
  body{ padding:14px; }
  .footer{ flex-direction:column; }
  .episodes-head, .episode-row{
    grid-template-columns: 70px 1fr 90px;
  }
  .episode-row .btn{ width:90px; }
}
