:root {
  --bg: #07090f;
  --panel: #10141e;
  --panel-2: #171d29;
  --line: #273043;
  --text: #f7f9ff;
  --muted: #97a1b5;
  --red: #ff3038;
  --red-dark: #bc1820;
  --blue: #00a8ff;
  --green: #41d98d;
  --yellow: #ffca3a;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% 0%, rgba(0,168,255,.12), transparent 30rem),
    radial-gradient(circle at 0% 30%, rgba(255,48,56,.1), transparent 28rem),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img, video { max-width: 100%; }
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  padding: 22px 16px; border-right: 1px solid var(--line);
  background: rgba(9,12,19,.92); backdrop-filter: blur(16px);
}
.brand { display: flex; gap: 11px; align-items: center; margin: 0 5px 28px; }
.brand img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid var(--red); }
.brand strong { display: block; letter-spacing: .04em; }
.brand small { color: var(--muted); text-transform: uppercase; font-size: 10px; letter-spacing: .14em; }
.nav { display: grid; gap: 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; min-height: 45px;
  padding: 10px 12px; border-radius: 12px; color: var(--muted);
}
.nav a:hover, .nav a.active { background: var(--panel-2); color: #fff; }
.nav a.active { box-shadow: inset 3px 0 var(--red); }
.sidebar-foot { position: absolute; bottom: 20px; left: 16px; right: 16px; }
.user { padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.user strong, .user small { display: block; }
.user small { color: var(--muted); }
.main { min-width: 0; padding: 28px clamp(16px, 4vw, 48px) 90px; }
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 25px; }
.top h1 { margin: 0; font-size: clamp(26px, 4vw, 40px); line-height: 1.1; }
.top p { margin: 6px 0 0; color: var(--muted); }
.mobile-head { display: none; }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat, .card {
  background: linear-gradient(145deg, rgba(23,29,41,.97), rgba(13,17,25,.97));
  border: 1px solid var(--line); border-radius: var(--radius);
}
.stat { padding: 20px; }
.stat span { color: var(--muted); }
.stat strong { display: block; font-size: 34px; margin-top: 5px; }
.stat:nth-child(1) strong { color: var(--red); }
.stat:nth-child(2) strong { color: var(--blue); }
.stat:nth-child(3) strong { color: var(--green); }
.stat:nth-child(4) strong { color: var(--yellow); }
.card { padding: 20px; margin-bottom: 16px; }
.card h2, .card h3 { margin-top: 0; }
.row { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 14px; }
.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
label { display: block; margin-bottom: 6px; color: #dce2ef; font-weight: 600; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 11px;
  background: #0a0e16; color: #fff; padding: 12px 13px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,168,255,.13); }
textarea { min-height: 110px; resize: vertical; }
.help { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-flex; justify-content: center; align-items: center; min-height: 42px;
  border: 0; border-radius: 11px; background: var(--red); color: #fff;
  padding: 10px 15px; font-weight: 700; cursor: pointer;
}
.btn:hover { background: var(--red-dark); }
.btn.secondary { background: var(--panel-2); border: 1px solid var(--line); }
.btn.blue { background: #087dba; }
.btn.green { background: #147e51; }
.btn.small { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 700; }
.badge.good { background: rgba(65,217,141,.13); color: var(--green); }
.badge.dim { background: rgba(151,161,181,.12); color: var(--muted); }
.badge.info { background: rgba(0,168,255,.14); color: #6bcfff; }
.flash { border-radius: 12px; padding: 13px 15px; margin-bottom: 18px; border: 1px solid; }
.flash.success { background: rgba(65,217,141,.1); border-color: rgba(65,217,141,.35); color: #9df0c5; }
.flash.error { background: rgba(255,48,56,.1); border-color: rgba(255,48,56,.35); color: #ff9ea3; }
.thumb { width: 62px; height: 48px; object-fit: cover; border-radius: 8px; background: #05070b; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 13px; }
.media-item { overflow: hidden; border-radius: 13px; border: 1px solid var(--line); background: #090d14; }
.media-item img, .media-item video { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.media-meta { padding: 10px; }
.drop {
  border: 2px dashed #35415a; border-radius: 15px; padding: 26px 15px;
  text-align: center; background: rgba(0,168,255,.04);
}
.empty { padding: 35px; text-align: center; color: var(--muted); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.login-logo { width: 88px; height: 88px; border: 3px solid var(--red); border-radius: 50%; object-fit: cover; margin: 0 auto 15px; }
.login-card h1 { text-align: center; margin: 0; }
.login-card > p { color: var(--muted); text-align: center; margin: 8px 0 24px; }
.login-card .field { margin-bottom: 15px; }
.login-card .btn { width: 100%; }
.bottom-nav { display: none; }

@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .main { padding: 76px 14px 92px; }
  .mobile-head {
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; inset: 0 0 auto; z-index: 50; height: 62px; padding: 8px 14px;
    background: rgba(7,9,15,.95); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
  }
  .mobile-head img { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--red); object-fit: cover; }
  .stats { grid-template-columns: 1fr 1fr; }
  .col-8, .col-6, .col-4, .col-3 { grid-column: span 12; }
  .top { align-items: stretch; flex-direction: column; }
  .top .btn { width: 100%; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; z-index: 60; inset: auto 0 0; background: rgba(7,9,15,.97);
    border-top: 1px solid var(--line); padding: 6px 5px max(6px, env(safe-area-inset-bottom));
  }
  .bottom-nav a { text-align: center; color: var(--muted); padding: 7px 2px; font-size: 10px; }
  .bottom-nav a b { display: block; color: #fff; font-size: 18px; line-height: 1.1; margin-bottom: 2px; }
}
