:root {
  --text: #f4ec4d;
  --text-dim: rgba(244, 236, 77, 0.72);
  --text-mute: rgba(244, 236, 77, 0.45);
  --panel: rgba(8, 6, 18, 0.72);
  --panel-solid: rgba(12, 10, 24, 0.88);
  --line: rgba(244, 236, 77, 0.22);
  --line-strong: rgba(244, 236, 77, 0.55);
  --danger: #ff4d8d;
  --ok: #4df4c8;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font: "Montserrat", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: #05040c url("/static/img/back.png") center / cover fixed no-repeat;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: #fff58a; }

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

.sidebar {
  padding: 28px 22px;
  background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(10,8,20,.35));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.brand img {
  width: 120px;
  height: auto;
  filter: drop-shadow(0 0 18px rgba(244, 236, 77, 0.25));
}

.brand span {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text-dim);
  transition: .2s ease;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
  border-color: var(--line);
  background: rgba(244, 236, 77, 0.08);
}

.main {
  padding: 28px 32px 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--text-dim);
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
}

.grid.two {
  grid-template-columns: 1.1fr 0.9fr;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  padding: 20px;
}

.card h2 {
  margin: 0 0 14px;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.stat-value {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 13px;
}

.table-wrap { overflow: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(244, 236, 77, 0.12);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--text-mute);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
}

.muted { color: var(--text-dim); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

.status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 12px;
}

.status.open { color: var(--ok); border-color: rgba(77, 244, 200, 0.4); }
.status.in_progress { color: #7ec8ff; border-color: rgba(126, 200, 255, 0.45); }
.status.done { color: var(--text-dim); border-color: var(--line); }
.status.cancelled { color: var(--danger); border-color: rgba(255, 77, 141, 0.4); }

.tiny {
  margin-top: 4px;
  color: var(--text-mute);
  font-size: 12px;
  line-height: 1.35;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(244, 236, 77, 0.08);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: .2s ease;
}

.btn:hover {
  background: rgba(244, 236, 77, 0.16);
  transform: translateY(-1px);
}

.btn.danger {
  border-color: rgba(255, 77, 141, 0.55);
  color: #ffd0e2;
}

.btn.ghost {
  background: transparent;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.flash {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.35);
}

.flash.ok { border-color: rgba(77, 244, 200, 0.45); }
.flash.error { border-color: rgba(255, 77, 141, 0.55); color: #ffd0e2; }

.empty {
  padding: 28px 10px;
  color: var(--text-dim);
  text-align: center;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  padding: 32px 28px 28px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-card img {
  width: 150px;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 20px rgba(244, 236, 77, 0.28));
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.login-card p {
  margin: 0 0 24px;
  color: var(--text-dim);
  font-size: 14px;
}

.field {
  text-align: left;
  margin-bottom: 14px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.field input {
  width: 100%;
  padding: 14px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.35);
  color: var(--text);
  font: inherit;
  outline: none;
}

.field input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(244, 236, 77, 0.12);
}

.login-card .btn {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
}

.version {
  margin-top: 18px;
  color: var(--text-mute);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.media-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
}

.media-card img,
.media-card video {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  background: #000;
}

.media-card video {
  object-fit: contain;
  min-height: 180px;
}

.media-card figcaption {
  padding: 10px 12px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-top: 1px solid rgba(244, 236, 77, 0.12);
}

.media-card .btn {
  margin: 18px;
}

.linkish {
  color: var(--text);
  border-bottom: 1px dashed rgba(244, 236, 77, 0.45);
}

.linkish:hover {
  color: #fff58a;
}

tr.click-row {
  cursor: pointer;
  transition: background .15s ease;
}

tr.click-row:hover {
  background: rgba(244, 236, 77, 0.06);
}

a.row-main-link {
  color: inherit;
  text-decoration: none;
  border: 0;
}

a.row-main-link:hover {
  color: #fff58a;
}

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

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .brand { grid-template-columns: auto 1fr; justify-items: start; align-items: center; }
  .brand img { width: 64px; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { padding: 20px 16px 40px; }
}
