:root {
  --bg: #0f1218;
  --bg-soft: #141923;
  --panel: #171d28;
  --panel-2: #1b2230;
  --line: #273042;
  --line-soft: #20293a;
  --text: #e8edf5;
  --muted: #9aa5b5;
  --blue: #4f8cff;
  --blue-hover: #6aa0ff;
  --green: #1ec773;
  --red: #e06060;
  --shadow: 0 18px 48px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", Inter, Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(79,140,255,.12), transparent 22%),
    linear-gradient(180deg, #0d1117 0%, #10151e 100%);
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: rgba(14, 19, 28, .96);
  border-right: 1px solid var(--line);
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 20px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.sidebar-brand__logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue), #6ca9ff);
  color: white;
  font-size: 20px;
  box-shadow: 0 10px 26px rgba(79,140,255,.24);
}

.sidebar-brand__title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.sidebar-brand__sub {
  font-size: 12px;
  color: var(--muted);
  text-transform: lowercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav a {
  padding: 11px 14px;
  border-radius: 12px;
  color: #c8d2df;
  transition: .18s ease;
}

.sidebar-nav a:hover {
  background: #1a2230;
  color: #fff;
}

.sidebar-nav a.active {
  background: rgba(79,140,255,.15);
  border: 1px solid rgba(79,140,255,.2);
  color: #fff;
}

.content-shell {
  min-width: 0;
  padding: 22px 28px 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.page-title {
  font-size: 34px;
  font-weight: 750;
  letter-spacing: -.04em;
}

.page-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  text-transform: lowercase;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

.user-badge__avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(79,140,255,.16);
  color: #fff;
  font-weight: 700;
}

.user-badge__name { font-weight: 600; }
.user-badge__role { font-size: 12px; color: var(--muted); text-transform: lowercase; }
.page-body { display: flex; flex-direction: column; gap: 18px; }

.panel {
  background: linear-gradient(180deg, rgba(23,29,40,.98), rgba(23,29,40,.92));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.hero-panel h2,
.panel-head h2,
.panel h2 { font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
.hero-panel p,
.panel p { color: var(--muted); margin-top: 6px; }
.panel-head { margin-bottom: 14px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.stat-panel { min-height: 132px; display: flex; flex-direction: column; justify-content: center; }
.stat-label { color: var(--muted); margin-bottom: 8px; }
.stat-num { font-size: 42px; font-weight: 800; letter-spacing: -.04em; }

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 280px) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 120px minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 14px;
}
.compact-grid { grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) 140px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field-sm { max-width: 160px; }
.grow { min-width: 0; }
.inline-check label { display: inline-flex; align-items: center; gap: 8px; }
label { color: var(--muted); font-size: 12px; }

input, select, textarea, button {
  font: inherit;
}

input, select, textarea {
  width: 100%;
  background: #101724;
  border: 1px solid #2e394d;
  color: var(--text);
  border-radius: 12px;
  padding: 11px 13px;
  outline: none;
  transition: .18s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(79,140,255,.9);
  box-shadow: 0 0 0 3px rgba(79,140,255,.12);
}

textarea { resize: vertical; min-height: 110px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: .18s ease;
}

.btn-block { width: 100%; }
.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 12px 26px rgba(79,140,255,.2);
}
.btn-primary:hover { background: var(--blue-hover); }
.btn-secondary {
  background: #202a3c;
  color: #dce7f6;
  border-color: #34445d;
}
.btn-secondary:hover { background: #273248; }
.btn-play {
  background: rgba(30,199,115,.14);
  color: #90f0be;
  border-color: rgba(30,199,115,.24);
}
.btn-play.is-active {
  box-shadow: 0 0 0 3px rgba(30,199,115,.12), 0 0 22px rgba(30,199,115,.18);
}
.btn-stop {
  background: rgba(224,96,96,.12);
  color: #ffc0c0;
  border-color: rgba(224,96,96,.22);
}
.btn-stop.is-active { box-shadow: 0 0 0 3px rgba(224,96,96,.1); }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar-actions { display: flex; align-items: end; }

.notice, .alert {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
}
.notice.success { background: rgba(30,199,115,.12); color: #9decc0; }
.notice.danger, .alert { background: rgba(224,96,96,.12); color: #ffc6c6; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

thead th {
  text-align: left;
  padding: 14px 14px;
  color: #bcc7d5;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  background: #1a2130;
  border-bottom: 1px solid var(--line);
}

tbody td {
  padding: 14px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
}

tbody tr:hover { background: rgba(255,255,255,.018); }
.track-row.playing { background: rgba(79,140,255,.09); }
.col-lp { width: 64px; }
.col-actions { width: 188px; }
.track-title { font-weight: 600; }
.desc-cell { color: #cbd4df; }
.empty-state { text-align: center; color: var(--muted); padding: 28px 14px; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #202a39;
  border: 1px solid #324259;
  color: #d7e0ec;
  font-size: 12px;
}
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { min-width: 160px; }

.player-panel { gap: 14px; }
.player-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.player-label { color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.player-track { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.player-times { display: flex; align-items: center; gap: 18px; color: #d7e0ec; font-variant-numeric: tabular-nums; }
.progress-shell {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #101724;
  border: 1px solid #2e394d;
  overflow: hidden;
}
.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), #79acff);
  transition: width .15s linear;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-wrap { width: 100%; max-width: 460px; }
.login-panel {
  background: linear-gradient(180deg, rgba(23,29,40,.98), rgba(23,29,40,.92));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.login-brand { font-size: 34px; font-weight: 800; letter-spacing: -.04em; }
.login-brand-sub { margin-top: 2px; color: var(--muted); text-transform: lowercase; }
.login-copy { margin: 16px 0 18px; color: var(--muted); }
.login-form { display: flex; flex-direction: column; gap: 14px; }

@media (max-width: 1100px) {
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar-actions { grid-column: 1 / -1; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid, .compact-grid { grid-template-columns: 1fr; }
  .field-sm { max-width: none; }
}

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .content-shell { padding: 18px; }
  .topbar, .player-meta { flex-direction: column; align-items: flex-start; }
  .page-title { font-size: 28px; }
}
