/* PLAYR CMS Admin — custom styles */
:root {
  --playr-bg: #121212;
  --playr-card: #1e1e1e;
  --playr-elevated: #252525;
  --playr-border: #2a2a2a;
  --playr-teal: #13A99F;
  --playr-teal-dim: rgba(19, 169, 159, 0.15);
  --playr-text: #ffffff;
  --playr-muted: #a0a0a0;
  --sidebar-w: 260px;
  --sidebar-collapsed: 72px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--playr-bg);
  color: var(--playr-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #3a3a3a;
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: #4a4a4a;
}

/* Layout */
.app-shell {
  min-height: 100vh;
  display: flex;
  background: var(--playr-bg);
}

.sidebar {
  width: var(--sidebar-w);
  background: #0d0d0d;
  border-right: 1px solid var(--playr-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  transition: width 0.25s ease, transform 0.25s ease;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--playr-border);
  min-height: 56px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #13A99F, #95CCC7);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: 0 0 24px rgba(19, 169, 159, 0.35);
}

.brand-text {
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
}

.brand-text span {
  color: var(--playr-teal);
}

.nav-list {
  padding: 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--playr-muted);
  cursor: pointer;
  border: 1px solid transparent;
  font-size: 13.5px;
  transition: all 0.18s ease;
  user-select: none;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--playr-elevated);
  color: #fff;
}

.nav-item.active {
  background: var(--playr-teal-dim);
  color: #fff;
  border-color: rgba(19, 169, 159, 0.35);
}

.nav-item .nav-icon {
  width: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-item .nav-icon svg {
  width: 19px;
  height: 19px;
  display: block;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 8px 0;
}

.nav-item .nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--playr-teal, #13a99f);
  color: #04211f;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
}

.sidebar.collapsed .nav-badge {
  display: none;
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-footer-text {
  display: none;
}

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--playr-border);
  color: var(--playr-muted);
  font-size: 12px;
}

.sidebar-version {
  margin-top: 8px;
  text-align: center;
  font-size: 11px;
  opacity: 0.65;
  letter-spacing: 0.02em;
}

/* User menu (top-right pill dropdown) */
.user-chip {
  cursor: pointer;
  font: inherit;
}

.user-chip-caret {
  width: 14px;
  height: 14px;
  color: var(--playr-muted);
  transition: transform 0.15s ease;
}

.user-chip-caret.open {
  transform: rotate(180deg);
}

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  background: #1a1a1a;
  border: 1px solid var(--playr-border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 60;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--playr-text);
  font: inherit;
  font-size: 13px;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
}

.user-menu-item svg {
  width: 16px;
  height: 16px;
  color: var(--playr-muted);
  flex-shrink: 0;
}

.user-menu-item:hover {
  background: var(--playr-elevated);
}

.user-menu-item.danger {
  color: #ff8aa3;
}

.user-menu-item.danger svg {
  color: #ff8aa3;
}

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  transition: margin-left 0.25s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sidebar.collapsed ~ .main,
.app-shell.sidebar-collapsed .main {
  margin-left: var(--sidebar-collapsed);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(18, 18, 18, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--playr-border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-content {
  padding: 24px;
  flex: 1;
}

/* Cards */
.card {
  background: var(--playr-card);
  border: 1px solid var(--playr-border);
  border-radius: 14px;
  overflow: hidden;
}

.card-hover {
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.card-hover:hover {
  transform: translateY(-2px);
  border-color: rgba(19, 169, 159, 0.35);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.kpi-card {
  position: relative;
  overflow: hidden;
}
.kpi-card::after {
  content: '';
  position: absolute;
  right: -20px;
  top: -20px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(19, 169, 159, 0.18), transparent 70%);
  pointer-events: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1.2;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--playr-teal);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: #ff446a;
  box-shadow: 0 0 20px rgba(19, 169, 159, 0.35);
}
.btn-secondary {
  background: var(--playr-elevated);
  color: #fff;
  border-color: var(--playr-border);
}
.btn-secondary:hover:not(:disabled) {
  border-color: #444;
  background: #2c2c2c;
}
.btn-ghost {
  background: transparent;
  color: var(--playr-muted);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  color: #fff;
  background: var(--playr-elevated);
}
.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.28);
}
.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
}
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
}

/* Forms */
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--playr-muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: #161616;
  border: 1px solid var(--playr-border);
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: rgba(19, 169, 159, 0.6);
  box-shadow: 0 0 0 3px rgba(19, 169, 159, 0.12);
}
.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: #ef4444;
}
.form-textarea {
  min-height: 90px;
  resize: vertical;
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a0a0a0' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6l3.5 4 3.5-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.form-hint {
  font-size: 12px;
  color: #777;
  margin-top: 4px;
}
.form-error {
  font-size: 12px;
  color: #f87171;
  margin-top: 4px;
}
.form-grid {
  display: grid;
  gap: 14px;
}
.form-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 720px) {
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data-table th {
  text-align: left;
  padding: 12px 14px;
  color: var(--playr-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--playr-border);
  background: #1a1a1a;
  white-space: nowrap;
}
table.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(42, 42, 42, 0.7);
  vertical-align: middle;
}
table.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges / pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  border: 1px solid transparent;
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(19, 169, 159, 0.12);
  color: #fff;
  border: 1px solid rgba(19, 169, 159, 0.25);
  max-width: 100%;
}
.tag-pill .tag-x {
  cursor: pointer;
  opacity: 0.7;
  font-size: 14px;
  line-height: 1;
}
.tag-pill .tag-x:hover {
  opacity: 1;
  color: #95CCC7;
}

/* Tag type colors */
.tag-type-club { --tc: #3b82f6; }
.tag-type-team { --tc: #8b5cf6; }
.tag-type-player { --tc: #10b981; }
.tag-type-athlete { --tc: #14b8a6; }
.tag-type-sport { --tc: #2196f3; }
.tag-type-event { --tc: #f59e0b; }
.tag-type-sponsor { --tc: #ec4899; }
.tag-type-agency { --tc: #6366f1; }
.tag-type-hashtag { --tc: #13A99F; }
.tag-type-generic { --tc: #a0a0a0; }

.tag-colored {
  background: color-mix(in srgb, var(--tc) 18%, transparent);
  border-color: color-mix(in srgb, var(--tc) 40%, transparent);
  color: #fff;
}
.tag-colored .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tc);
  flex-shrink: 0;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal-panel {
  background: #1a1a1a;
  border: 1px solid var(--playr-border);
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  max-height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  animation: slideUp 0.2s ease;
}
.modal-panel.modal-sm {
  max-width: 440px;
}
.modal-panel.modal-lg {
  max-width: 900px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--playr-border);
}
.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--playr-border);
  background: #161616;
  border-radius: 0 0 16px 16px;
}

/* Toast */
.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #1f1f1f;
  border: 1px solid var(--playr-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  animation: toastIn 0.25s ease;
}
.toast.leaving {
  animation: toastOut 0.2s ease forwards;
}
.toast.success {
  border-color: rgba(16, 185, 129, 0.45);
}
.toast.error {
  border-color: rgba(239, 68, 68, 0.45);
}
.toast.info {
  border-color: rgba(59, 130, 246, 0.45);
}
.toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}
.toast.success .toast-icon {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}
.toast.error .toast-icon {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}
.toast.info .toast-icon {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}
.toast-body {
  flex: 1;
  min-width: 0;
}
.toast-title {
  font-size: 13px;
  font-weight: 700;
}
.toast-msg {
  font-size: 12px;
  color: var(--playr-muted);
  margin-top: 2px;
  word-break: break-word;
}

/* Page transitions */
.page-enter {
  animation: pageIn 0.22s ease;
}

/* Upload zone */
.dropzone {
  border: 2px dashed #3a3a3a;
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  transition: all 0.18s ease;
  background: #161616;
  cursor: pointer;
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--playr-teal);
  background: var(--playr-teal-dim);
}
.dropzone-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.85;
}

/* Progress */
.progress-track {
  height: 8px;
  background: #2a2a2a;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #13A99F, #95CCC7);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.progress-bar.indeterminate {
  width: 40% !important;
  animation: indeterminate 1.2s ease-in-out infinite;
}

/* Image preview */
.img-preview {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: #2a2a2a;
  border: 1px solid var(--playr-border);
}
.img-preview-lg {
  width: 96px;
  height: 96px;
}
.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #2a2a2a;
  flex-shrink: 0;
}
.avatar-md {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #2a2a2a;
  flex-shrink: 0;
}
.thumb-video {
  width: 100%;
  aspect-ratio: 9/12;
  object-fit: cover;
  background: #0a0a0a;
  display: block;
}

/* Tag picker */
.tag-picker {
  position: relative;
}
.tag-picker-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #1a1a1a;
  border: 1px solid var(--playr-border);
  border-radius: 12px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 20;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.tag-picker-group-label {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--playr-muted);
  position: sticky;
  top: 0;
  background: #1a1a1a;
}
.tag-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.tag-picker-item:hover {
  background: var(--playr-elevated);
}
/* Static (in-flow) version of .tag-picker-results for modals */
.tag-picker-results-static {
  background: #1a1a1a;
  border: 1px solid var(--playr-border);
  border-radius: 12px;
  max-height: 280px;
  overflow-y: auto;
}
.tag-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

/* Chips input (awards) */
.chip-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: #161616;
  border: 1px solid var(--playr-border);
  border-radius: 10px;
  min-height: 46px;
  align-items: center;
}
.chip-input-wrap:focus-within {
  border-color: rgba(19, 169, 159, 0.6);
  box-shadow: 0 0 0 3px rgba(19, 169, 159, 0.12);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--playr-teal-dim);
  border: 1px solid rgba(19, 169, 159, 0.3);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.chip button {
  background: none;
  border: none;
  color: #ff8aa3;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}
.chip-input {
  flex: 1;
  min-width: 120px;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
  padding: 4px;
}

/* Empty / loading */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--playr-muted);
}
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #333;
  border-top-color: var(--playr-teal);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.skeleton {
  background: linear-gradient(90deg, #1e1e1e 25%, #2a2a2a 50%, #1e1e1e 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 8px;
}

/* Status dots */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-ready { background: #34d399; box-shadow: 0 0 8px rgba(52, 211, 153, 0.5); }
.status-processing { background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.5); }
.status-queued { background: #60a5fa; }
.status-failed { background: #f87171; box-shadow: 0 0 8px rgba(248, 113, 113, 0.5); }

/* Color swatch */
.color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: inline-block;
  vertical-align: middle;
}

/* Toggle group */
.view-toggle {
  display: inline-flex;
  background: #161616;
  border: 1px solid var(--playr-border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.view-toggle button {
  border: none;
  background: transparent;
  color: var(--playr-muted);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.view-toggle button.active {
  background: var(--playr-elevated);
  color: #fff;
}

/* Mobile sidebar */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 35;
}
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .main {
    margin-left: 0 !important;
  }
  .mobile-overlay.show {
    display: block;
  }
  .page-content {
    padding: 16px;
  }
}

/* Utility bits */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.muted {
  color: var(--playr-muted);
}
.text-playr {
  color: var(--playr-teal);
}
.divider {
  height: 1px;
  background: var(--playr-border);
  margin: 16px 0;
}
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(24px); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
@keyframes countPop {
  0% { transform: scale(0.92); opacity: 0.5; }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); opacity: 1; }
}
.counter-anim {
  animation: countPop 0.45s ease;
}

/* Video preview player */
.video-preview-frame {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--playr-border);
  aspect-ratio: 16/9;
  max-height: 360px;
}
.video-preview-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Filter tabs */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-tab {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--playr-border);
  background: transparent;
  color: var(--playr-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-tab:hover {
  color: #fff;
  border-color: #444;
}
.filter-tab.active {
  background: var(--playr-teal-dim);
  border-color: rgba(19, 169, 159, 0.4);
  color: #fff;
}

/* Login */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(19, 169, 159, 0.18), transparent 55%),
    var(--playr-bg);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--playr-card);
  border: 1px solid var(--playr-border);
  border-radius: 18px;
  padding: 28px 26px 26px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.login-sub {
  color: var(--playr-muted);
  font-size: 13px;
  margin: 0 0 22px;
  line-height: 1.45;
}
.login-form {
  display: grid;
  gap: 14px;
}

/* Topbar user chip */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 12px;
  border-radius: 999px;
  background: #1a1a1a;
  border: 1px solid var(--playr-border);
  max-width: 220px;
}
.user-chip-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chip-role {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--playr-teal-dim);
  color: #ff8aa3;
  border: 1px solid rgba(19, 169, 159, 0.35);
  flex-shrink: 0;
}

/* Detail slide-over */
.detail-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 55;
  animation: fadeIn 0.15s ease;
}
.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100vw);
  background: #161616;
  border-left: 1px solid var(--playr-border);
  z-index: 60;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.22s ease;
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.detail-panel.open {
  transform: translateX(0);
  pointer-events: auto;
}
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--playr-border);
  background: #121212;
}
.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}
.detail-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--playr-border);
  background: #121212;
}
.detail-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.detail-hero {
  display: flex;
  gap: 14px;
  align-items: center;
}
.detail-logo {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  background: #2a2a2a;
  border: 1px solid var(--playr-border);
  flex-shrink: 0;
}
.detail-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: #2a2a2a;
  border: 1px solid var(--playr-border);
  flex-shrink: 0;
}
.detail-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  background: #0a0a0a;
  border: 1px solid var(--playr-border);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: #1a1a1a;
  border: 1px solid var(--playr-border);
  border-radius: 10px;
  min-width: 0;
}
.detail-field .k {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--playr-muted);
}
.detail-field .v {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  word-break: break-word;
}
@media (max-width: 520px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .detail-panel {
    width: 100vw;
  }
}

/* Initials avatars */
.avatar-slot {
  position: relative;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
}
.avatar-slot > * {
  grid-area: 1 / 1;
}
.initials-avatar {
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  user-select: none;
  background: #2a2a2a;
  border: 1px solid var(--playr-border);
}
.initials-avatar.hidden-init {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.initials-avatar.img-preview {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  font-size: 18px;
}
.initials-avatar.avatar-sm {
  width: 36px;
  height: 36px;
  font-size: 11px;
}
.initials-avatar.avatar-md {
  width: 56px;
  height: 56px;
  font-size: 16px;
  border-radius: 50%;
}
.initials-avatar.detail-logo {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  font-size: 18px;
}
.initials-avatar.detail-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  font-size: 22px;
}
.avatar-slot.round .initials-avatar {
  border-radius: 50%;
}

/* Clickable detail links */
button.linkish,
.linkish {
  background: none;
  border: none;
  padding: 0;
  color: #fff;
  cursor: pointer;
  font: inherit;
  text-align: inherit;
}
button.linkish:hover,
.linkish:hover {
  color: #95CCC7;
  text-decoration: underline;
}
.detail-video-frame {
  max-height: 280px;
  aspect-ratio: 9/16;
  width: 100%;
  background: #000;
}
.detail-video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Advertising */
.ad-card {
  display: flex;
  flex-direction: column;
}
.ad-banner-wrap {
  position: relative;
  background: #0a0a0a;
  border-bottom: 1px solid var(--playr-border);
  aspect-ratio: 1080 / 200;
  overflow: hidden;
}
/* News article cards: hero images are photos, not ad strips — use 16:9. */
.news-banner-wrap {
  position: relative;
  background: #0a0a0a;
  border-bottom: 1px solid var(--playr-border);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.ad-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #111;
}
.ad-type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}
.ad-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.ad-metric {
  background: #161616;
  border: 1px solid var(--playr-border);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
  min-width: 0;
}
.ad-metric .k {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--playr-muted);
  margin-bottom: 2px;
}
.ad-metric .v {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.ad-form-preview {
  width: 160px;
  height: 30px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--playr-border);
  background: #111;
  flex-shrink: 0;
}
/* News hero preview: show the full image (no crop) so aspect/height can be judged. */
.news-form-preview {
  max-width: 280px;
  max-height: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--playr-border);
  background: #111;
  flex-shrink: 0;
}
.chip-muted {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e5e5e5;
  font-weight: 600;
}
.chip-select-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip-select {
  border: 1px solid var(--playr-border);
  background: #161616;
  color: var(--playr-muted);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip-select:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}
.chip-select.active {
  background: var(--playr-teal-dim);
  border-color: rgba(19, 169, 159, 0.4);
  color: #fff;
}
.form-range {
  width: 100%;
  accent-color: var(--playr-teal);
  cursor: pointer;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #161616;
  border: 1px solid var(--playr-border);
  border-radius: 10px;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #2a2a2a;
  border: 1px solid var(--playr-border);
  border-radius: 999px;
  transition: all 0.18s ease;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border-radius: 50%;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.toggle-switch input:checked + .toggle-slider {
  background: rgba(19, 169, 159, 0.35);
  border-color: rgba(19, 169, 159, 0.55);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translate(18px, -50%);
  background: #13A99F;
}
