/* FindTrack.ru — Enterprise UI (2026) */

:root {
  --bg-base: #09090b;
  --bg-elevated: #101014;
  --bg-surface: #16161a;
  --bg-muted: #1c1c21;
  --bg-hover: #222228;

  --border: #2a2a30;
  --border-strong: #3f3f46;

  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-muted: rgba(59, 130, 246, 0.12);

  --success: #22c55e;
  --success-muted: rgba(34, 197, 94, 0.12);
  --warning: #eab308;
  --warning-muted: rgba(234, 179, 8, 0.12);
  --error: #ef4444;
  --error-muted: rgba(239, 68, 68, 0.12);
  --info: #38bdf8;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.22s ease;
  --nav-height: 64px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* legacy aliases for JS / old tokens */
  --primary-bg: var(--bg-base);
  --secondary-bg: var(--bg-elevated);
  --tertiary-bg: var(--bg-muted);
  --card-bg: var(--bg-surface);
  --card-border: var(--border);
  --primary-purple: var(--accent);
  --secondary-purple: var(--accent-hover);
  --accent-primary: var(--accent);
  --accent-secondary: var(--accent-hover);
  --accent-blue: var(--info);
  --accent-pink: var(--error);
  --accent-green: var(--success);
  --accent-orange: var(--warning);
  --gradient-primary: linear-gradient(180deg, var(--accent) 0%, var(--accent-hover) 100%);
  --gradient-secondary: linear-gradient(180deg, var(--info) 0%, var(--accent) 100%);
  --gradient-card: var(--bg-muted);
  --gradient-hero: var(--bg-base);
  --shadow-glow: var(--shadow-sm);
  --shadow-xl: var(--shadow-lg);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

#main-content {
  flex: 1 0 auto;
}

/* Background */
.bg-effects {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 70%);
  opacity: 0.35;
}

.bg-gradient,
.bg-particles,
.floating-shapes,
.shape,
.logo-pulse,
.shield-pulse,
.shield-rings,
.upload-ripple {
  display: none !important;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-shell {
  padding: calc(var(--nav-height) + 2.5rem) 0 4rem;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(9, 9, 11, 0.96);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  overflow: hidden;
  flex-shrink: 0;
}

.logo-icon i {
  color: var(--accent);
  font-size: 1rem;
}

.logo-mark {
  width: 36px;
  height: 36px;
  display: block;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.logo-text h1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-muted);
}

.nav-link::after {
  display: none;
}

.nav-auth,
.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-balance {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
}

.user-menu {
  position: relative;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 200px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.35rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: var(--transition-fast);
  z-index: 200;
}

.user-dropdown::before {
  content: '';
  position: absolute;
  top: -0.5rem;
  left: 0;
  right: 0;
  height: 0.5rem;
}

.user-dropdown a {
  display: block;
  padding: 0.6rem 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.user-dropdown a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.user-menu.open .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-large {
  padding: 0.8rem 1.35rem;
  font-size: 0.95rem;
}

.btn-sm {
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
  min-height: calc(100vh - var(--nav-height));
  padding: calc(var(--nav-height) + 3rem) 1.5rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--accent-muted);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(2.2rem, 4vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.gradient-text {
  color: var(--accent);
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 540px;
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.stat-item {
  min-width: 100px;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-logo-stage {
  position: relative;
  width: min(360px, 78vw);
  height: min(360px, 78vw);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo-orbit {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  border: 1px dashed rgba(59, 130, 246, 0.28);
  animation: hero-orbit-spin 14s linear infinite;
}

.hero-logo-orbit::before,
.hero-logo-orbit::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.8);
}

.hero-logo-orbit::before {
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
}

.hero-logo-orbit::after {
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.55;
}

.hero-logo-orbit--slow {
  inset: 0;
  border-style: solid;
  border-color: rgba(59, 130, 246, 0.12);
  animation-duration: 22s;
  animation-direction: reverse;
}

.hero-logo-orbit--slow::before,
.hero-logo-orbit--slow::after {
  width: 6px;
  height: 6px;
  opacity: 0.45;
}

.hero-logo-core {
  position: relative;
  z-index: 2;
  width: 58%;
  height: 58%;
  border-radius: 22%;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.25),
    0 18px 50px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(59, 130, 246, 0.2);
  animation: hero-logo-breathe 4.5s ease-in-out infinite;
}

.hero-logo-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.hero-logo-scan {
  position: absolute;
  left: -10%;
  right: -10%;
  height: 28%;
  top: -30%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(96, 165, 250, 0.08) 35%,
    rgba(147, 197, 253, 0.45) 50%,
    rgba(96, 165, 250, 0.08) 65%,
    transparent 100%
  );
  mix-blend-mode: screen;
  animation: hero-logo-scan 2.8s ease-in-out infinite;
  pointer-events: none;
}

.hero-logo-ping {
  position: absolute;
  z-index: 1;
  width: 58%;
  height: 58%;
  border-radius: 50%;
  border: 2px solid rgba(59, 130, 246, 0.45);
  animation: hero-logo-ping 2.8s ease-out infinite;
  pointer-events: none;
}

@keyframes hero-orbit-spin {
  to { transform: rotate(360deg); }
}

@keyframes hero-logo-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

@keyframes hero-logo-scan {
  0% { top: -30%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: 105%; opacity: 0; }
}

@keyframes hero-logo-ping {
  0% { transform: scale(0.92); opacity: 0.55; }
  70% { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo-orbit,
  .hero-logo-orbit--slow,
  .hero-logo-core,
  .hero-logo-scan,
  .hero-logo-ping {
    animation: none !important;
  }

  .hero-logo-scan {
    display: none;
  }
}

.protection-shield {
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shield-inner {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-lg);
  background: var(--accent-muted);
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.shield-inner i {
  font-size: 2.25rem;
  color: var(--accent);
}

/* Sections */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-header p {
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto;
}

.how-it-works,
.features-section,
.pricing-section,
.about-section {
  padding: 5rem 0;
}

.how-it-works,
.pricing-section,
.about-section {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.steps-grid,
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.step-card,
.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: var(--transition-fast);
}

.step-card:hover,
.feature-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-muted);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  position: static;
  transform: none;
  box-shadow: none;
}

.step-icon,
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.step-icon i,
.feature-icon i {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.step-card h3,
.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.step-card p,
.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Pricing */
.pricing-simple {
  display: flex;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.pricing-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
}

.pricing-card.featured {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: var(--shadow-sm);
  transform: none;
}

.plan-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.plan-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
}

.plan-price-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.3rem;
}

.currency {
  color: var(--text-muted);
  font-size: 1.15rem;
  font-weight: 600;
}

.amount {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  background: none;
  -webkit-text-fill-color: unset;
}

.period {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.2;
}

.plan-features {
  list-style: none;
  text-align: left;
  margin-bottom: 1.5rem;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.plan-features i {
  color: var(--success);
  width: 14px;
}

.pricing-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.benefit-item {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.benefit-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.benefit-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.benefit-content p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.about-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.about-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.about-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Page headers */
.dashboard-header,
.admin-header,
.page-header {
  margin-bottom: 2rem;
}

.dashboard-header h1,
.admin-header h1,
.page-header h1 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  background: none;
  -webkit-text-fill-color: unset;
  color: var(--text-primary);
}

.dashboard-header p,
.admin-header p,
.page-header p {
  color: var(--text-secondary);
}

.dashboard-stats,
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-card:hover {
  border-color: var(--border-strong);
  transform: none;
  box-shadow: none;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.stat-icon i {
  color: var(--text-secondary);
  font-size: 1rem;
}

.stat-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  background: none;
  -webkit-text-fill-color: unset;
  margin-bottom: 0.15rem;
}

.stat-content p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Upload */
.upload-section,
.profile-card,
.billing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.upload-section h2,
.beats-section h2,
.violations-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.upload-area {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--bg-muted);
  transition: var(--transition-fast);
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.upload-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-icon i {
  color: var(--text-secondary);
  font-size: 1.25rem;
}

.upload-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.upload-content p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

#beatInfo.beat-info {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-group input:invalid {
  border-color: var(--error);
}

.form-group input:valid:not(:placeholder-shown) {
  border-color: rgba(34, 197, 94, 0.45);
}

/* Beats & violations */
.beats-section,
.violations-section {
  margin-bottom: 2rem;
}

.beats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.beat-card,
.violation-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.beat-card:hover,
.violation-item:hover {
  border-color: var(--border-strong);
  transform: none;
  box-shadow: none;
}

.beat-header,
.violation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.beat-header h4,
.violation-header h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.beat-status,
.violation-status {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
}

.beat-status.active,
.violation-status.resolved {
  color: var(--success);
  background: var(--success-muted);
  border-color: rgba(34, 197, 94, 0.25);
}

.beat-status.pending {
  color: var(--warning);
  background: var(--warning-muted);
  border-color: rgba(234, 179, 8, 0.25);
}

.violation-status.detected {
  color: var(--error);
  background: var(--error-muted);
  border-color: rgba(239, 68, 68, 0.25);
}

.beat-card .beat-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.beat-genre,
.beat-bpm,
.beat-key {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
}

.beat-actions,
.violation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.violation-details p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0.35rem 0;
}

.violations-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.empty-icon i {
  color: var(--text-muted);
  font-size: 1.25rem;
}

.empty-state h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Admin */
.charts-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.chart-card,
.recent-activity {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.chart-card h3,
.recent-activity h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.recent-activity-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.recent-activity-header h3 {
  margin-bottom: 0;
}

.activity-load-more {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.activity-load-more .btn:disabled {
  opacity: 0.6;
}

.chart-placeholder {
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.chart-canvas-wrap {
  position: relative;
  height: 220px;
  width: 100%;
}

.chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-placeholder i {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.activity-content h4 {
  font-size: 0.875rem;
  font-weight: 600;
}

.activity-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Profile & billing */
.profile-card h2,
.billing-card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.profile-grid,
.billing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.billing-transactions {
  margin-top: 1rem;
}

.billing-transactions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.billing-transactions-header h2 {
  margin-bottom: 0;
}

.billing-transactions .matches-pagination {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.transactions-table-wrap {
  overflow-x: auto;
}

.transactions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.transactions-table th,
.transactions-table td {
  padding: 0.75rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.transactions-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.transactions-table td {
  color: var(--text-primary);
}

.transactions-empty-row td {
  color: var(--text-muted);
  text-align: center;
  padding: 1.5rem 0.75rem;
}

.tx-amount {
  font-weight: 600;
  white-space: nowrap;
}

.tx-amount.credit {
  color: var(--success, #22c55e);
}

.tx-status {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text-secondary);
  white-space: nowrap;
}

.tx-status.completed {
  color: var(--success, #22c55e);
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
}

.tx-status.awaiting_payment,
.tx-status.pending,
.tx-status.authorized,
.tx-status.new {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}

.tx-status.failed {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-row span {
  color: var(--text-muted);
}

.info-row strong {
  font-weight: 600;
  text-align: right;
}

.billing-highlight {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 1rem;
}

/* Footer */
.footer {
  flex-shrink: 0;
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 2.5rem 0 1.25rem;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

.footer-brand-block {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.footer-brand .logo-icon {
  width: 32px;
  height: 32px;
}

.footer-brand .logo-mark {
  width: 32px;
  height: 32px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.footer-social-link:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background: var(--bg-primary);
}

.footer-social-link i {
  font-size: 1.15rem;
  line-height: 1;
}

.footer-bottom {
  text-align: center;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer-bottom > p {
  margin: 0;
}

.footer-legal-entity {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.25rem;
  line-height: 1.45;
  font-size: 0.75rem;
}

.footer-legal-entity p {
  margin: 0;
}

.footer-legal-entity a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-legal-entity a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.legal-content {
  max-width: 48rem;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.975rem;
}

.legal-content h2 {
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.01em;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content p {
  margin: 0 0 0.85rem;
}

.legal-content ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.legal-content li {
  margin-bottom: 0.4rem;
}

.admin-legal-card {
  margin-top: 1.5rem;
}

#adminLegalHtml,
.admin-legal-html {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  min-height: 280px;
  resize: vertical;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 1.25rem;
  padding-right: 2.25rem;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close,
.close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 5;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.modal-close:hover,
.close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-hint {
  margin: -0.25rem 0 0;
  text-align: right;
}

.form-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: -0.15rem 0 0;
}

.remember-me {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.remember-me input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.register-legal-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.15rem 0 0.35rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.45;
  cursor: pointer;
  user-select: none;
}

.register-legal-consent input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.register-legal-consent .form-link {
  font-size: inherit;
}

.form-description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.form-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}

.form-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.modal-auth-switch {
  margin: 0.25rem 0 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.4;
}

.modal-auth-switch .form-link {
  font-size: inherit;
}

.balance-info {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.balance-info p {
  margin: 0.25rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.topup-amounts h4,
.custom-amount h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.amount-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.amount-btn {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
}

.amount-btn:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.custom-amount .form-group {
  flex-direction: row;
  align-items: stretch;
}

/* Notifications */
.notification {
  position: fixed;
  top: calc(var(--nav-height) + 0.75rem);
  right: 1rem;
  max-width: 360px;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.notification.success {
  background: #14532d;
  border-color: rgba(34, 197, 94, 0.35);
  color: #dcfce7;
}

.notification.error {
  background: #450a0a;
  border-color: rgba(239, 68, 68, 0.35);
  color: #fee2e2;
}

/* File info */
.file-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.file-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.file-details h4 {
  font-size: 0.9rem;
  font-weight: 600;
}

.file-details p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.fade-in-up {
  animation: fadeInUp 0.4s ease-out;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-elevated);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

::selection {
  background: var(--accent-muted);
  color: var(--text-primary);
}

/* Focus */
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: calc(var(--nav-height) + 2rem);
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions,
  .hero-stats {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
    margin-bottom: 0.5rem;
  }

  .hero-logo-stage {
    width: min(240px, 64vw);
    height: min(240px, 64vw);
  }
}

@media (max-width: 768px) {
  .nav-container {
    gap: 0.65rem;
  }

  .nav-brand {
    flex: 1;
    min-width: 0;
  }

  .nav-user {
    margin-left: auto;
    flex-shrink: 0;
  }

  .user-balance {
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    font-size: 0.8rem;
    padding: 0.35rem 0.55rem;
  }

  .user-avatar {
    flex-shrink: 0;
  }

  .nav-menu {
    position: fixed;
    top: calc(var(--nav-height) + 0.5rem);
    left: 1rem;
    right: auto;
    width: min(280px, calc(100vw - 2rem));
    height: auto;
    max-height: calc(100dvh - var(--nav-height) - 1.5rem);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0.5rem;
    gap: 0.25rem;
    transform: translateY(-6px) scale(0.96);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.18s ease, opacity 0.18s ease, visibility 0.18s ease;
    z-index: 1001;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--shadow-md), 0 16px 48px rgba(0, 0, 0, 0.45);
    pointer-events: none;
  }

  .nav-menu.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-menu .nav-link {
    padding: 0.85rem 0.95rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    font-size: 0.95rem;
  }

  .nav-menu .nav-link:hover,
  .nav-menu .nav-link:active {
    background: var(--bg-muted);
  }

  .nav-menu .nav-link.active {
    background: var(--accent-muted);
    border-color: rgba(59, 130, 246, 0.35);
    color: var(--accent);
  }

  .nav-menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    top: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 999;
  }

  body.nav-open .nav-menu-backdrop {
    display: block;
  }

  body.nav-open {
    overflow: hidden;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    order: 0;
    flex-shrink: 0;
  }

  .nav-auth {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    flex-shrink: 0;
  }

  .nav-auth .btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
  }

  .nav-auth .btn-outline {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .amount-buttons {
    grid-template-columns: 1fr;
  }

  .custom-amount .form-group {
    flex-direction: column;
  }

  .dashboard-stats,
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .dashboard-stats,
  .admin-stats {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== Catalog (Beatlock-inspired) ========== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.catalog-container {
  max-width: 1100px;
}

.catalog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.catalog-header h1 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.catalog-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.catalog-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.catalog-dashboard-stats {
  margin-bottom: 1.25rem;
}

.catalog-dashboard-stats .stat-icon {
  background: var(--accent-muted);
  border-color: rgba(59, 130, 246, 0.2);
}

.catalog-dashboard-stats .stat-icon i {
  color: var(--accent);
}

.catalog-filters-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.catalog-search {
  position: relative;
  flex: 1 1 16rem;
  min-width: 0;
  margin-bottom: 0;
  align-self: stretch;
}

.catalog-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 1;
  line-height: 1;
}

.catalog-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  min-height: 2.85rem;
}

.catalog-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.catalog-date-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 1 auto;
  padding: 0.45rem 0.65rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-sizing: border-box;
}

.catalog-date-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  padding-right: 0.15rem;
  flex-shrink: 0;
}

.catalog-date-field {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 0;
}

.catalog-date-field input[type="date"] {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.5rem;
  font-family: inherit;
  font-size: 0.82rem;
  color-scheme: dark;
  max-width: 9.75rem;
  min-width: 0;
  box-sizing: border-box;
}

.catalog-date-field input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
  color: var(--text-primary);
}

.catalog-date-clear {
  flex-shrink: 0;
  color: var(--text-muted);
}

.catalog-date-clear:hover {
  color: var(--text-primary);
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.catalog-tabs {
  display: flex;
  gap: 0.25rem;
}

.catalog-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
}

.catalog-tab:hover {
  color: var(--text-primary);
}

.catalog-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.catalog-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.catalog-meta {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.7rem;
}

.catalog-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  background: var(--warning-muted);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-md);
}

.catalog-alert-body {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #fde68a;
  font-size: 0.875rem;
}

.catalog-table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: visible;
  position: relative;
  z-index: 1;
}

.catalog-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border-radius: var(--radius-lg);
}

.catalog-table thead tr:first-child th:first-child {
  border-top-left-radius: var(--radius-lg);
}

.catalog-table thead tr:first-child th:last-child {
  border-top-right-radius: var(--radius-lg);
}

.catalog-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.catalog-table th:nth-child(1),
.catalog-table td:nth-child(1) {
  width: 38%;
}

.catalog-table th:nth-child(2),
.catalog-table td:nth-child(2) {
  width: 16%;
}

.catalog-table th:nth-child(3),
.catalog-table td:nth-child(3) {
  width: 16%;
}

.catalog-table th:nth-child(4),
.catalog-table td:nth-child(4) {
  width: 30%;
}

.catalog-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.catalog-table tr:last-child td {
  border-bottom: none;
}

.catalog-table tbody tr {
  transition: background var(--transition-fast);
}

.catalog-table tbody tr:hover {
  background: var(--bg-hover);
}

.catalog-table tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.beat-cell {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.beat-thumb {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.beat-thumb:hover,
.beat-thumb.is-playing {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.12);
}

.beat-thumb .beat-thumb-icon {
  font-size: 1rem;
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

.beat-thumb .beat-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text);
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.beat-thumb:hover .beat-thumb-play,
.beat-thumb.is-playing .beat-thumb-play {
  opacity: 1;
}

.beat-thumb:hover .beat-thumb-icon,
.beat-thumb.is-playing .beat-thumb-icon {
  opacity: 0.2;
}

.beat-thumb.is-playing .beat-thumb-play {
  color: var(--accent);
}

.beat-thumb .thumb-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--success);
  color: #052e16;
  font-size: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-surface);
}

.beat-thumb .thumb-badge-paused {
  background: var(--text-muted);
  color: var(--bg-surface);
}

.beat-player-bar {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: min(520px, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
}

.beat-player-toggle {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.beat-player-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.beat-player-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.beat-player-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.beat-player-meta strong {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.beat-player-time {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.beat-player-time-sep {
  margin: 0 0.15rem;
  opacity: 0.6;
}

.beat-player-loading {
  flex-shrink: 0;
  font-size: 0.75rem;
}

.beat-player-seek {
  width: 100%;
  height: 4px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

.beat-player-seek:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.beat-player-seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) var(--seek-progress, 0%),
    var(--bg-muted) var(--seek-progress, 0%),
    var(--bg-muted) 100%
  );
}

.beat-player-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  transition: transform 0.1s ease;
}

.beat-player-seek:not(:disabled):hover::-webkit-slider-thumb,
.beat-player-seek:not(:disabled):active::-webkit-slider-thumb {
  transform: scale(1.1);
}

.beat-player-seek::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--bg-muted);
}

.beat-player-seek::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
}

.beat-player-seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.beat-player-close {
  flex-shrink: 0;
}

.beat-cell-text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.beat-cell-text strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.beat-title-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.beat-title-row strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.beat-rename-btn {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  opacity: 0.55;
  color: var(--text-muted);
}

.beat-title-row:hover .beat-rename-btn,
.beat-rename-btn:focus-visible {
  opacity: 1;
  color: var(--accent);
}

.beat-cell-text span {
  display: block;
  font-size: 0.8rem;
  color: var(--accent);
  margin-top: 0.15rem;
}

.beat-cell-text span.muted-match {
  color: var(--text-muted);
}

.match-source-tag {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 0;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #c084fc;
  background: rgba(192, 132, 252, 0.12);
  border: 1px solid rgba(192, 132, 252, 0.28);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  max-width: none;
}

.match-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
}

.match-title-row strong {
  flex: 1 1 auto;
  min-width: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-pill.protected {
  color: var(--success);
  background: var(--success-muted);
  border-color: rgba(34, 197, 94, 0.25);
}

.status-pill.status-added {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.28);
}

.status-pill.status-verified {
  color: var(--success);
  background: var(--success-muted);
  border-color: rgba(34, 197, 94, 0.25);
}

.status-pill.status-deleted {
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.25);
}

.matches-status-cell {
  white-space: nowrap;
  vertical-align: middle;
}

.match-status-menu {
  display: inline-block;
  position: relative;
  text-align: left;
}

.match-status-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 8.5rem;
  justify-content: flex-start;
  font-weight: 600;
}

.match-status-trigger .match-status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}

.match-status-trigger.status-added {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.08);
}

.match-status-trigger.status-verified {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.08);
}

.match-status-trigger.status-deleted {
  color: var(--text-muted);
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(148, 163, 184, 0.08);
}

.match-status-caret {
  margin-left: auto;
  font-size: 0.7rem;
  opacity: 0.75;
}

.match-status-menu.open .match-status-caret {
  transform: rotate(180deg);
}

.match-status-dropdown {
  min-width: 11rem;
}

.match-status-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.match-status-item i {
  width: 1rem;
  text-align: center;
  opacity: 0.9;
}

.match-status-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.match-status-item.active {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.match-status-item.status-added.active,
.match-status-item.status-added:hover {
  color: #38bdf8;
}

.match-status-item.status-verified.active,
.match-status-item.status-verified:hover {
  color: var(--success);
}

.match-status-item.status-deleted.active,
.match-status-item.status-deleted:hover {
  color: var(--text-muted);
}

.matches-table-wrap tbody tr:has(.match-status-menu.open),
.matches-table-wrap tbody tr:has(.match-links-menu.open) {
  position: relative;
  z-index: 100;
}

.matches-link-cell,
.matches-status-cell {
  overflow: visible;
}

.status-pill.paused {
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.25);
}

.status-pill.unprotected,
.status-pill.pending,
.status-pill.scanning {
  color: #fbbf24;
  background: var(--warning-muted);
  border-color: rgba(234, 179, 8, 0.3);
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.date-cell {
  color: var(--text-secondary);
  font-size: 0.875rem;
  white-space: nowrap;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.row-menu {
  position: relative;
  z-index: 1;
}

.row-menu.open {
  z-index: 100;
}

.catalog-table tbody tr:has(.row-menu.open) {
  position: relative;
  z-index: 100;
}

.row-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.35rem;
  z-index: 200;
  display: none;
}

.row-menu.open .row-menu-dropdown {
  display: block;
}

.row-menu-dropdown button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.row-menu-dropdown button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.row-menu-dropdown button.danger {
  color: var(--error);
}

.catalog-footer {
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 0.25rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.conflicts-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.conflicts-header {
  margin-bottom: 1rem;
}

.empty-state.compact {
  padding: 2.5rem 1rem;
  border: none;
  background: transparent;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.text-link {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
}

.text-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.text-link.accent {
  color: var(--accent);
}

.muted {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.modal-lg {
  max-width: 560px;
}

.modal-xl {
  max-width: 820px;
}

.catalog-modal {
  position: relative;
  padding-top: 1.75rem;
}

.catalog-modal > .modal-close {
  top: 0.85rem;
  right: 0.85rem;
}

.matches-page-header {
  align-items: flex-end;
  gap: 1rem;
}

.matches-back {
  margin-bottom: 0.85rem;
}

.matches-page-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.matches-filters {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding: 0.95rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.matches-filters-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.matches-filters-row-secondary {
  padding-top: 0.15rem;
}

.matches-search {
  flex: 1 1 240px;
  min-width: 220px;
  margin-bottom: 0;
}

.matches-search input {
  background: var(--bg-muted);
}

.matches-filter-group {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.matches-filter-label,
.matches-sort-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.matches-confidence-filter {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
  min-width: 220px;
  padding: 0.2rem 0.55rem 0.2rem 0.75rem;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-height: 2.55rem;
}

.matches-status-filter,
.matches-sort {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.matches-filter-menu {
  display: inline-block;
  position: relative;
  z-index: 5;
}

.matches-filter-menu.open {
  z-index: 120;
}

.matches-filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  font-weight: 600;
}

.matches-filter-caret {
  font-size: 0.7rem;
  opacity: 0.75;
  margin-left: 0.1rem;
}

.matches-filter-menu.open .matches-filter-caret {
  transform: rotate(180deg);
}

.matches-filter-dropdown {
  min-width: 11.5rem;
}

.matches-filter-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.matches-filter-item i {
  width: 1rem;
  text-align: center;
  opacity: 0.9;
}

.matches-filter-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.matches-filter-item.active {
  color: var(--text-primary);
  background: var(--bg-hover);
  font-weight: 600;
}

.matches-confidence-range {
  position: relative;
  width: 9.5rem;
  height: 1.35rem;
}

.matches-confidence-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: var(--border);
  pointer-events: none;
}

.matches-confidence-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.matches-confidence-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  z-index: 3;
}

.matches-confidence-slider::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
  border: none;
}

.matches-confidence-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg-surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  pointer-events: auto;
  margin-top: -5px;
}

.matches-confidence-slider::-moz-range-track {
  height: 4px;
  background: transparent;
  border: none;
}

.matches-confidence-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg-surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  pointer-events: auto;
}

.matches-confidence-slider:focus-visible::-webkit-slider-thumb,
.matches-confidence-slider:focus-visible::-moz-range-thumb {
  outline: 2px solid rgba(99, 102, 241, 0.35);
  outline-offset: 2px;
}

.matches-confidence-value {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 4.75rem;
  font-variant-numeric: tabular-nums;
}

.matches-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.matches-pagination-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.matches-pagination-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.matches-pagination-page {
  font-size: 0.85rem;
  color: var(--text-secondary);
  min-width: 4.5rem;
  text-align: center;
}

.matches-page-size {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}

.matches-page-size-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.matches-page-size-select {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.65rem;
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.matches-page-size-select:hover,
.matches-page-size-select:focus-visible {
  color: var(--text-primary);
  border-color: var(--border-strong);
  outline: none;
}

@media (max-width: 768px) {
  .matches-filters {
    padding: 0.85rem;
  }

  .matches-filters-row {
    flex-direction: column;
    align-items: stretch;
  }

  .matches-filter-group,
  .matches-sort,
  .matches-confidence-filter,
  .matches-status-filter {
    width: 100%;
    justify-content: flex-start;
  }

  .matches-filter-menu,
  .matches-filter-trigger {
    width: 100%;
  }

  .matches-filter-trigger {
    justify-content: flex-start;
  }

  .matches-confidence-filter {
    min-width: 0;
  }

  .matches-confidence-range {
    flex: 1;
    max-width: none;
    width: auto;
  }

  .matches-page-size {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
}

.matches-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  overflow: hidden; /* обрезаем строки по скруглению таблицы */
  width: 100%;
  max-width: 100%;
}

.matches-table-wrap .catalog-table {
  margin: 0;
  width: 100%;
  table-layout: fixed;
}

.matches-table-wrap thead th {
  position: static;
  background: var(--bg-elevated);
  box-shadow: none;
}

/* Перебиваем ширины .catalog-table (4 колонки дашборда) — здесь 6 колонок */
.matches-table-wrap .catalog-table th:nth-child(n),
.matches-table-wrap .catalog-table td:nth-child(n) {
  width: auto;
}

.matches-table-wrap col.match-col-num { width: 2.75rem; }
.matches-table-wrap col.match-col-track { width: auto; }
.matches-table-wrap col.match-col-date { width: 10.5rem; }
.matches-table-wrap col.match-col-confidence { width: 5.75rem; }
.matches-table-wrap col.match-col-status { width: 9.5rem; }
.matches-table-wrap col.match-col-action { width: 9rem; }

.matches-table-wrap .catalog-table th:nth-child(1),
.matches-table-wrap .catalog-table td:nth-child(1) {
  width: 2.75rem;
  padding-left: 0.75rem;
  padding-right: 0.35rem;
  text-align: center;
}

.matches-table-wrap .catalog-table th:nth-child(2),
.matches-table-wrap .catalog-table td:nth-child(2) {
  width: auto;
  text-align: left;
}

.matches-table-wrap .catalog-table th:nth-child(3),
.matches-table-wrap .catalog-table td:nth-child(3) {
  width: 10.5rem;
  text-align: center;
}

.matches-table-wrap .catalog-table th:nth-child(4),
.matches-table-wrap .catalog-table td:nth-child(4) {
  width: 5.75rem;
  text-align: center;
}

.matches-table-wrap .catalog-table th:nth-child(5),
.matches-table-wrap .catalog-table td:nth-child(5) {
  width: 9.5rem;
  text-align: center;
}

.matches-table-wrap .catalog-table th:nth-child(6),
.matches-table-wrap .catalog-table td:nth-child(6) {
  width: 9rem;
  padding-left: 0.5rem;
  padding-right: 1.25rem;
  text-align: center;
}

.matches-table-wrap td.match-col-index {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.matches-table-wrap .beat-cell-text strong,
.matches-table-wrap .beat-cell-text .muted-match {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 100%;
}

.matches-table-wrap .beat-cell-text .match-source-tag {
  display: inline-flex;
  overflow: visible;
  text-overflow: clip;
  max-width: none;
}

.matches-table-wrap .matches-link-cell {
  text-align: center;
  white-space: nowrap;
}

.matches-table-wrap .matches-status-cell {
  text-align: center;
}

.match-links-menu {
  display: inline-block;
  position: relative;
  text-align: left;
}

.match-links-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.match-links-caret {
  font-size: 0.7rem;
  opacity: 0.75;
}

.match-links-menu.open .match-links-caret {
  transform: rotate(180deg);
}

.match-links-dropdown {
  min-width: 180px;
}

.match-links-item {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
}

.match-links-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.match-links-item i {
  width: 1rem;
  text-align: center;
  opacity: 0.9;
}

.matches-table-wrap td.date-cell {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.matches-table-wrap td.match-col-date {
  white-space: nowrap;
  overflow: visible;
}

.match-spotify-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.match-spotify-preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.15rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(29, 185, 84, 0.45);
  background: rgba(29, 185, 84, 0.12);
  color: #1db954;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.match-spotify-preview-btn:hover {
  background: rgba(29, 185, 84, 0.2);
  border-color: #1db954;
}

.match-spotify-preview-btn.is-playing {
  background: #1db954;
  border-color: #1db954;
  color: #06140c;
}

.match-spotify-preview-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.match-spotify-preview audio {
  width: 100%;
  margin-top: 0.15rem;
  max-width: 18rem;
  height: 2rem;
}

.match-spotify-embed {
  margin-top: 0.75rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}

.match-spotify-embed iframe {
  display: block;
  width: 100%;
  height: 80px;
  border: 0;
}

@media (max-width: 768px) {
  .matches-page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .matches-page-header > div:first-child {
    min-width: 0;
    width: 100%;
  }

  .matches-back {
    width: auto;
    max-width: 100%;
    justify-content: flex-start;
    margin-bottom: 0.75rem;
  }

  .matches-page-header h1 {
    font-size: 1.35rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .matches-page-header p {
    overflow-wrap: anywhere;
  }

  .matches-page-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
  }

  .matches-page-actions .btn {
    width: auto;
    flex: 0 1 auto;
  }

  .matches-page .catalog-container {
    max-width: 100%;
    overflow-x: clip;
  }

  .matches-table-wrap {
    overflow: visible;
  }

  .matches-table-wrap .catalog-table {
    table-layout: auto;
  }

  .matches-table-wrap thead,
  .matches-table-wrap colgroup {
    display: none;
  }

  .matches-table-wrap .catalog-table,
  .matches-table-wrap .catalog-table tbody {
    display: block;
    width: 100%;
  }

  .matches-table-wrap tbody tr.matches-row-clickable {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr) auto;
    grid-template-areas:
      "num track links"
      "date date conf"
      "status status status";
    gap: 0.45rem 0.55rem;
    width: 100%;
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid var(--border);
    box-sizing: border-box;
  }

  .matches-table-wrap tbody tr.matches-row-clickable:last-child {
    border-bottom: none;
  }

  .matches-table-wrap tbody tr.matches-row-clickable:hover td:first-child {
    box-shadow: none;
  }

  .matches-table-wrap tbody tr.matches-row-clickable > td {
    display: block;
    width: auto !important;
    max-width: 100%;
    border-bottom: none !important;
    padding: 0 !important;
    min-width: 0;
    overflow: visible;
  }

  .matches-table-wrap td.match-col-index {
    grid-area: num;
    align-self: center;
    font-size: 0.8rem;
  }

  .matches-table-wrap td.match-col-track {
    grid-area: track;
    align-self: center;
  }

  .matches-table-wrap td.match-col-date {
    grid-area: date;
    display: flex !important;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
  }

  .matches-table-wrap td.match-col-date::before {
    content: "Релиз";
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.85;
  }

  .matches-table-wrap td.match-col-confidence {
    grid-area: conf;
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
  }

  .matches-table-wrap td.matches-status-cell {
    grid-area: status;
    width: 100% !important;
  }

  .matches-table-wrap td.matches-link-cell {
    grid-area: links;
    text-align: right;
    align-self: center;
    white-space: nowrap;
  }

  .matches-table-wrap .beat-cell {
    gap: 0.65rem;
    min-width: 0;
  }

  .matches-table-wrap .beat-thumb,
  .matches-table-wrap .match-thumb {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }

  .matches-table-wrap .match-status-menu {
    display: block;
    width: 100%;
  }

  .matches-table-wrap .match-status-trigger {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    justify-content: flex-start;
  }

  .matches-table-wrap .match-links-trigger {
    min-width: 0;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  .matches-table-wrap .match-links-trigger .btn-label,
  .matches-table-wrap .match-links-trigger .match-links-caret {
    display: none;
  }

  .matches-table-wrap tbody tr:has(td[colspan]) {
    display: block;
    padding: 1rem 0.75rem;
  }

  .matches-table-wrap tbody tr:has(td[colspan]) td {
    display: block;
    width: 100% !important;
  }
}

.matches-row-clickable {
  cursor: pointer;
  transition: background var(--transition-fast);
}

.matches-row-clickable:hover {
  background: var(--bg-hover);
}

.matches-row-selected {
  background: var(--accent-muted);
}

.matches-row-selected:hover {
  background: rgba(59, 130, 246, 0.18);
}

body.match-detail-open {
  overflow: hidden;
}

.match-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 4000;
}

.match-detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(440px, 100vw);
  height: 100vh;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 4001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
}

.match-detail-drawer.open {
  transform: translateX(0);
}

.match-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.match-detail-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.match-detail-subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.match-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.5rem;
}

.match-detail-hero {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.match-thumb img,
.match-detail-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.match-thumb .cover-fallback-icon,
.match-detail-art .cover-fallback-icon {
  display: none;
}

.match-thumb.thumb-fallback .cover-fallback-icon,
.match-detail-art.thumb-fallback .cover-fallback-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-muted);
}

.match-detail-art {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.match-detail-art img {
  border-radius: var(--radius-md);
}

.match-detail-hero-text h3 {
  font-size: 1rem;
  margin-bottom: 0.15rem;
}

.match-detail-hero-text p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.match-detail-web-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.match-detail-web-search .btn {
  text-decoration: none;
}

.match-detail-web-search .btn i {
  opacity: 0.9;
}

.match-detail-section {
  margin-bottom: 1.25rem;
}

.match-detail-section h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.match-detail-dl {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.match-detail-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.5rem;
  align-items: start;
  font-size: 0.9rem;
}

.match-detail-row dt {
  color: var(--text-muted);
}

.match-detail-row dd {
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  word-break: break-word;
}

.copy-field-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
}

.copy-field-btn:hover {
  color: var(--accent);
  background: var(--accent-muted);
}

.match-detail-summary {
  font-size: 0.92rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.match-timeline-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.match-timeline-bar {
  position: relative;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  overflow: hidden;
}

.match-timeline-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--error);
  border-radius: var(--radius-full);
  min-width: 2px;
}

.match-dsp-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.match-dsp-btn {
  font-size: 0.85rem;
}

.match-detail-footer {
  display: none !important;
}

.match-detail-footer-row {
  display: flex;
  gap: 0.5rem;
}

.match-detail-footer-row .btn {
  flex: 1;
}

.match-detail-footer-muted {
  justify-content: space-between;
  align-items: center;
}

.danger-link {
  color: var(--error);
}

.danger-link:hover {
  color: #f87171;
}

.btn-block {
  width: 100%;
}

@media (max-width: 768px) {
  .match-detail-drawer {
    width: 100vw;
  }

  .match-detail-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

.upload-modal {
  padding-top: 0.5rem;
}

.upload-modal > .modal-close {
  top: 0.85rem;
  right: 0.85rem;
}

.upload-modal-head {
  text-align: center;
  margin-bottom: 1.5rem;
}

.upload-modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-muted), rgba(99, 102, 241, 0.08));
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.upload-modal-head h3 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.upload-modal-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.upload-dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem 1.25rem;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-muted) 0%, rgba(255, 255, 255, 0.01) 100%);
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.upload-dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-muted);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
  transform: translateY(-1px);
}

.upload-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.upload-drop-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.upload-dropzone.dragover .upload-drop-icon {
  transform: scale(1.05);
  border-color: var(--accent);
}

.upload-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 180px;
  justify-content: center;
}

.upload-drop-text {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0;
}

.upload-formats {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.upload-format-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-muted);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.upload-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.upload-progress-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 1.25rem;
  padding-right: 2.25rem;
  font-weight: 600;
  min-height: 2rem;
}

.upload-progress-header .text-link {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.upload-file-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 0.75rem;
}

.upload-file-list {
  max-height: min(42vh, 360px);
  overflow: auto;
  margin-bottom: 1rem;
  padding-right: 0.25rem;
}

.upload-file-list .upload-file-card:last-child {
  margin-bottom: 0;
}

.upload-queue-title {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.15rem 0.35rem;
  margin: -0.15rem -0.35rem 0.15rem;
  border-radius: var(--radius-sm);
}

.upload-queue-title:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
}

.upload-queue-title[readonly] {
  pointer-events: none;
}

.upload-queue-item.status-done {
  border-color: color-mix(in srgb, #22c55e 35%, var(--border));
}

.upload-queue-item.status-error {
  border-color: color-mix(in srgb, #ef4444 40%, var(--border));
}

.upload-queue-item.status-uploading {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.upload-batch-hint {
  margin: 0 0 1rem;
  font-size: 0.85rem;
}

.upload-file-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: #fff;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.upload-file-meta {
  flex: 1;
  min-width: 0;
}

.upload-file-meta strong {
  display: block;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-file-meta span {
  color: var(--text-muted);
  font-size: 0.8rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.beat-meta-form {
  margin-bottom: 1.25rem;
}

.upload-progress-footer .progress-track {
  height: 4px;
  background: var(--bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.protect-hero {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.protect-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-muted);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.protect-hero h3 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.protect-hero #protectBeatName {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.protect-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.protect-step {
  display: flex;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.protect-step-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.protect-step strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.protect-step p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.protect-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.protect-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.violation-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
}

@media (max-width: 768px) {
  .catalog-header {
    flex-direction: column;
  }

  /* Только кнопка-прямой потомок (загрузка в каталоге), не вложенные кнопки совпадений */
  .catalog-header > .btn {
    width: 100%;
    justify-content: center;
  }

  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .catalog-filters-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .catalog-search {
    width: 100%;
    flex: none;
  }

  .catalog-date-filter {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "label clear"
      "from from"
      "to to";
    gap: 0.45rem 0.5rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    align-items: center;
  }

  .catalog-date-filter-label {
    grid-area: label;
    padding-right: 0;
  }

  .catalog-date-from {
    grid-area: from;
  }

  .catalog-date-to {
    grid-area: to;
  }

  .catalog-date-clear {
    grid-area: clear;
    justify-self: end;
  }

  .catalog-date-field {
    display: grid;
    grid-template-columns: 1.75rem 1fr;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
  }

  .catalog-date-field input[type="date"] {
    max-width: none;
    width: 100%;
    min-height: 2.4rem;
  }

  .catalog-table th:nth-child(2),
  .catalog-table td:nth-child(2) {
    display: none;
  }

  /* Каталог: строки-карточки, чтобы статус и кнопки не наслаивались */
  #dashboard-page .catalog-table {
    table-layout: auto;
  }

  #dashboard-page .catalog-table thead {
    display: none;
  }

  #dashboard-page .catalog-table,
  #dashboard-page .catalog-table tbody,
  #dashboard-page .catalog-table tr,
  #dashboard-page .catalog-table td {
    display: block;
    width: 100% !important;
  }

  #dashboard-page .catalog-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "beat beat"
      "status actions";
    gap: 0.55rem 0.65rem;
    padding: 0.9rem 0.75rem;
    border-bottom: 1px solid var(--border);
    box-sizing: border-box;
  }

  #dashboard-page .catalog-table tbody tr:last-child {
    border-bottom: none;
  }

  #dashboard-page .catalog-table tbody tr:hover td:first-child {
    box-shadow: none;
  }

  #dashboard-page .catalog-table td {
    border-bottom: none;
    padding: 0;
    min-width: 0;
  }

  #dashboard-page .catalog-table td:nth-child(1) {
    grid-area: beat;
  }

  #dashboard-page .catalog-table td:nth-child(2) {
    display: none;
  }

  #dashboard-page .catalog-table td:nth-child(3) {
    grid-area: status;
    align-self: center;
  }

  #dashboard-page .catalog-table td:nth-child(4) {
    grid-area: actions;
    align-self: center;
  }

  #dashboard-page .catalog-table .row-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.35rem;
  }

  #dashboard-page .catalog-table .row-actions .btn-sm {
    min-width: 2.25rem;
    padding: 0.45rem 0.55rem;
  }

  #dashboard-page .catalog-table .row-actions .btn-sm .btn-label {
    display: none;
  }

  #dashboard-page .catalog-table .row-actions .btn-sm[title="Пересканировать"] {
    display: none;
  }

  #dashboard-page .catalog-table .status-pill {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #dashboard-page .catalog-table .catalog-empty-row td {
    grid-column: 1 / -1;
  }

  #dashboard-page .catalog-table-wrap {
    overflow: visible;
  }

  .protect-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Impersonation banner */
.impersonation-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  background: linear-gradient(90deg, rgba(234, 179, 8, 0.95), rgba(245, 158, 11, 0.92));
  color: #1a1200;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.impersonation-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.92rem;
}

body.impersonating-active {
  padding-top: 3rem;
}

body.impersonating-active .navbar {
  top: 3rem;
}

/* Admin tabs & panels */
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.admin-tab {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  padding: 0.55rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.admin-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.admin-tab.active {
  background: var(--accent-muted);
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--accent);
  font-weight: 600;
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.active {
  display: block;
}

.admin-panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.admin-panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.admin-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 420px;
}

.admin-search-wrap i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.admin-search-wrap input {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text-primary);
  font-family: inherit;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.admin-users-table {
  table-layout: fixed;
  width: 100%;
  min-width: 920px;
  margin: 0;
}

/* Перебиваем ширины .catalog-table (4 колонки дашборда) */
.admin-users-table th:nth-child(n),
.admin-users-table td:nth-child(n) {
  width: auto;
}

.admin-users-table th,
.admin-users-table td {
  padding: 0.75rem 0.65rem;
  vertical-align: middle;
}

.admin-users-table th:nth-child(1),
.admin-users-table td:nth-child(1) {
  width: 3.25rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.admin-users-table th:nth-child(2),
.admin-users-table td:nth-child(2) {
  width: 11rem;
  text-align: left;
}

.admin-users-table th:nth-child(3),
.admin-users-table td:nth-child(3) {
  width: auto;
  text-align: left;
}

.admin-users-table th:nth-child(4),
.admin-users-table td:nth-child(4) {
  width: 6.5rem;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.admin-users-table th:nth-child(5),
.admin-users-table td:nth-child(5),
.admin-users-table th:nth-child(6),
.admin-users-table td:nth-child(6) {
  width: 5.5rem;
  text-align: center;
}

.admin-users-table th:nth-child(7),
.admin-users-table td:nth-child(7) {
  width: 7.5rem;
  text-align: center;
  white-space: nowrap;
}

.admin-users-table th:nth-child(8),
.admin-users-table td:nth-child(8) {
  width: 6.5rem;
  text-align: center;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.admin-users-table th:nth-child(9),
.admin-users-table td:nth-child(9) {
  width: 6.25rem;
  text-align: right;
  white-space: nowrap;
  padding-right: 0.85rem;
}

.admin-users-table .admin-email-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 0; /* с table-layout:fixed даёт ellipsis в ячейке */
}

.admin-users-table .admin-num-cell {
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.admin-user-name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
}

.admin-user-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-actions {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.admin-settings-card h3 {
  margin: 0 0 0.35rem;
}

.admin-settings-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  align-items: end;
  margin-top: 1.25rem;
  max-width: 640px;
}

.admin-email-layout {
  display: grid;
  gap: 1.25rem;
}

.admin-email-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-email-master {
  margin: 1rem 0 0.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-muted);
}

.admin-email-schedules {
  display: grid;
  gap: 0.75rem;
}

.admin-email-categories {
  display: grid;
  gap: 1.25rem;
  margin-top: 1rem;
}

.admin-email-category {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: var(--bg-muted);
}

.admin-email-category-head h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.admin-email-category-head p {
  margin: 0 0 0.75rem;
}

.admin-email-schedule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  flex-wrap: wrap;
}

.admin-email-schedule-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.admin-email-schedule-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.admin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  user-select: none;
  font-weight: 500;
}

.admin-toggle.compact {
  font-weight: 400;
  font-size: 0.9rem;
}

.admin-toggle input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
}

.admin-email-template-meta {
  margin: 0.35rem 0 1rem;
}

#adminEmailHtml {
  width: 100%;
  min-height: 280px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.45;
  resize: vertical;
}

.admin-email-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

@media (max-width: 720px) {
  .admin-email-schedule-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.admin-badge-active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.admin-badge-inactive {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.admin-badge-admin {
  background: var(--accent-muted);
  color: var(--accent);
}

.admin-online-dot {
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #64748b;
  box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.25);
}

.admin-online-dot.online {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}

.admin-online-dot.offline {
  background: #64748b;
  box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.2);
}
