:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #a855f7;
  --success: #10b981;
  --danger: #ef4444;
  --text: #0f172a;
  --muted: #64748b;
  --panel: rgba(255, 255, 255, 0.75);
  --panel-dark: rgba(15, 23, 42, 0.75);
  --border: rgba(255, 255, 255, 0.25);
  --shadow: 0 20px 80px rgba(37, 99, 235, 0.18);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.12), transparent 30%),
              radial-gradient(circle at 80% 0%, rgba(168, 85, 247, 0.14), transparent 26%),
              #f6f7fb;
  min-height: 100vh;
}

.layout {
  display: flex;
  min-height: 100vh;
  background: linear-gradient(135deg, #eef2ff, #f7f8fb);
}

.sidebar {
  width: 280px;
  background: linear-gradient(180deg, #0f172a, #111827 45%, #0b1224);
  color: #e2e8f0;
  padding: 32px 24px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  min-height: 100vh;
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.5px;
}

.sidebar .brand .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #a855f7);
  color: #fff;
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.12);
}

.sidebar .nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.sidebar .nav a {
  text-decoration: none;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  backdrop-filter: blur(6px);
}

.sidebar .nav a i {
  width: 18px;
  text-align: center;
  color: #93c5fd;
}

.sidebar .nav a:hover {
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
  color: #fff;
}

.sidebar .nav a.active {
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.28), rgba(168, 85, 247, 0.24));
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.15);
}

.sidebar .nav a.active i {
  color: #fff;
}

.sidebar .secondary-actions {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.sidebar .ghost-link {
  color: #cbd5e1;
  text-decoration: none;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  transition: background 0.2s ease;
}

.sidebar .ghost-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.main {
  flex: 1;
  padding: 36px 42px;
  position: relative;
  overflow: hidden;
}

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

.page-header h1 {
  margin: 0;
  font-size: 2rem;
  color: #0f172a;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.screen-selector {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 640px;
  padding: 16px 18px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.screen-selector--sidebar {
  max-width: 100%;
  width: 100%;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.68), rgba(30, 41, 59, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
}

.screen-selector--sidebar .screen-selector__heading {
  flex-wrap: wrap;
  row-gap: 8px;
}

.screen-selector--sidebar .screen-selector__intro {
  min-width: 0;
}

.screen-selector--sidebar .screen-selector__heading p {
  white-space: normal;
  color: #f8fafc;
}

.screen-selector--sidebar .screen-selector__heading span {
  color: rgba(226, 232, 240, 0.72);
}

.screen-selector--sidebar .screen-selector__icon {
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
}

.screen-selector--sidebar .screen-selector__count {
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
}

.screen-selector--sidebar .screen-selector__list {
  grid-template-columns: 1fr;
}

.screen-selector--sidebar .screen-option {
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
  border-radius: 16px;
  padding: 12px 14px;
  align-items: flex-start;
  gap: 10px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.screen-selector--sidebar .screen-option__icon {
  background: rgba(30, 41, 59, 0.9);
  color: #93c5fd;
  border-color: rgba(148, 163, 184, 0.2);
}

.screen-selector--sidebar .screen-option__meta {
  color: rgba(226, 232, 240, 0.7);
}

.screen-selector--sidebar .screen-option__cta {
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
  font-size: 0.7rem;
  padding: 4px 8px;
  white-space: nowrap;
}

.screen-selector--sidebar .screen-option__text {
  min-width: 0;
}

.screen-selector--sidebar .screen-option__name {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.2;
  word-break: break-word;
}

.screen-selector--sidebar .screen-option:hover {
  transform: translateX(2px);
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(30, 41, 59, 0.9);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.35);
}

.screen-selector--sidebar .screen-option.is-active {
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.45), rgba(168, 85, 247, 0.35));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.4);
}

.screen-selector--sidebar .screen-option.is-active .screen-option__icon {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.screen-selector--sidebar .screen-option.is-active .screen-option__meta {
  color: rgba(255, 255, 255, 0.75);
}

.screen-selector--sidebar .screen-option.is-active .screen-option__cta {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.screen-selector__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.screen-selector__intro {
  display: flex;
  align-items: center;
  gap: 12px;
}

.screen-selector__icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 1.1rem;
}

.screen-selector__heading p {
  margin: 0;
  font-weight: 700;
  color: #0f172a;
}

.screen-selector__heading span {
  font-size: 0.85rem;
  color: #64748b;
}

.screen-selector__count {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  font-size: 0.75rem;
  font-weight: 700;
  color: #1d4ed8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.screen-selector__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.screen-option {
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #f8fafc;
  color: #0f172a;
  padding: 12px 14px;
  border-radius: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.screen-option__icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #2563eb;
  border: 1px solid rgba(148, 163, 184, 0.2);
  flex-shrink: 0;
}

.screen-option__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.screen-option__name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screen-option__meta {
  font-size: 0.78rem;
  color: #64748b;
}

.screen-option__cta {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.screen-option:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.35);
  background: #ffffff;
}

.screen-option.is-active {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.95), rgba(14, 116, 144, 0.9));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.25);
}

.screen-option.is-active .screen-option__icon {
  background: rgba(255, 255, 255, 0.18);
  border-color: transparent;
  color: #fff;
}

.screen-option.is-active .screen-option__meta {
  color: rgba(255, 255, 255, 0.7);
}

.screen-option.is-active .screen-option__cta {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.screen-option:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
}

.select {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
  color: #0f172a;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.stat-card {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.9), rgba(226, 234, 255, 0.95));
  border-radius: var(--radius);
  padding: 18px 18px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(168, 85, 247, 0.12), transparent 35%),
              radial-gradient(circle at 80% 0%, rgba(37, 99, 235, 0.2), transparent 30%);
  pointer-events: none;
}

.stat-card h3 {
  margin: 0 0 10px;
  color: #475569;
  font-weight: 600;
}

.stat-value {
  font-size: 2.3rem;
  font-weight: 800;
  color: #0f172a;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 247, 255, 0.95));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 22px;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.panel h2 {
  margin: 0 0 14px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel h2 i {
  color: #2563eb;
}

.table-container { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  color: #0f172a;
}

th, td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

th {
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 0.85rem;
  color: #475569;
  background: rgba(37, 99, 235, 0.04);
}

tr:hover td {
  background: rgba(37, 99, 235, 0.04);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.badge.video { background: rgba(37, 99, 235, 0.12); color: #1d4ed8; }
.badge.image { background: rgba(16, 185, 129, 0.14); color: #047857; }

.icon-button {
  border: none;
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-button:hover { background: rgba(239, 68, 68, 0.16); transform: translateY(-1px); }

.form-card {
  max-width: 980px;
  margin: 0 auto;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.94), rgba(226, 234, 255, 0.95));
  border-radius: 20px;
  padding: 26px 26px 28px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.form-card h1 {
  margin: 0 0 12px;
  font-size: 1.9rem;
}

.form-card p.subtitle {
  margin: 0 0 18px;
  color: #475569;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 700;
  color: #0f172a;
}

.input-shell {
  border: 1px solid #dfe3ea;
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
  display: flex;
  gap: 10px;
  align-items: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-shell:focus-within {
  border-color: #2563eb;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.12);
}

.input-shell input,
.input-shell select,
.input-shell textarea {
  border: none;
  width: 100%;
  font-size: 1rem;
  background: transparent;
  color: #0f172a;
}

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

.btn-primary {
  background: linear-gradient(120deg, #2563eb, #4338ca);
  color: #fff;
  border: none;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 16px 35px rgba(37, 99, 235, 0.3);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(37, 99, 235, 0.35); }

.btn-secondary {
  border: 1px solid #d7deeb;
  background: #fff;
  color: #0f172a;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.pager {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.pager button {
  border: 1px solid #d7deeb;
  background: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pager button[disabled] {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #fff;
  cursor: default;
}

.gallery-spot {
  border-radius: 16px;
  background: radial-gradient(circle at 30% 20%, rgba(37, 99, 235, 0.14), transparent 30%), #0b1224;
  color: #e2e8f0;
  padding: 24px;
  display: grid;
  place-items: center;
  min-height: 160px;
}

.media-viewer {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.media-viewer .close-viewer {
  position: absolute;
  top: 24px;
  right: 32px;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

.media-viewer img,
.media-viewer video {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.auth-wrapper {
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.16), transparent 28%),
              radial-gradient(circle at 80% 0%, rgba(168, 85, 247, 0.12), transparent 26%),
              linear-gradient(135deg, #0f172a 0%, #111827 40%, #111827 100%);
  display: grid;
  place-items: center;
  padding: 22px;
  color: #e2e8f0;
}

.auth-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 32px;
  width: min(420px, 100%);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
}

.auth-card h1 { margin: 0 0 10px; color: #fff; }

.auth-card .subtitle { color: #cbd5e1; margin-bottom: 18px; }

.auth-card form { display: grid; gap: 14px; }

.auth-card label { font-weight: 700; color: #e2e8f0; }

.auth-card input {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1rem;
}

.auth-card input:focus { outline: none; border-color: #60a5fa; }

.auth-card .error {
  background: rgba(239, 68, 68, 0.2);
  color: #fecdd3;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.auth-actions { margin-top: 6px; }

@media (max-width: 960px) {
  .sidebar { display: none; }
  .layout { flex-direction: column; }
  .main { padding: 24px 18px; }
}
