/* Demo prototype — multi-vendor music distribution UI shell */

:root {
  --bg: #0c0d10;
  --surface: #14161c;
  --surface2: #1c1f28;
  --border: #2a2e38;
  --text: #e8eaef;
  --muted: #8b919d;
  --accent: #c9a227;
  --accent-dim: #a68416;
  --success: #3d9a6f;
  --warn: #c9872e;
  --error: #c94c4c;
  --radius: 10px;
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "Syne", var(--font);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

p {
  margin: 0 0 1rem;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.badge-demo {
  background: rgba(201, 162, 39, 0.12);
  border-color: var(--accent-dim);
  color: var(--accent);
}

.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

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

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--text);
}
.logo span {
  color: var(--accent);
}

.topnav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero {
  padding: 4rem 0 3rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  max-width: 18ch;
  margin: 0 auto 1rem;
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 42ch;
  margin: 0 auto 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #0c0d10;
}
.btn-primary:hover {
  background: #dfc063;
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  background: var(--surface2);
  text-decoration: none;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 2rem 0 4rem;
}

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

.step-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

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

.layout-app {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}

.main-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-backdrop {
  display: none;
}

.app-toolbar {
  display: none;
}

.mobile-nav-toggle {
  display: none;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.25rem;
}

.sidebar .logo {
  margin-bottom: 1.5rem;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li {
  margin-bottom: 0.35rem;
}

.nav-links a {
  display: block;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
}

.nav-links a:hover {
  background: var(--surface2);
  color: var(--text);
  text-decoration: none;
}

.nav-links a.active {
  background: rgba(201, 162, 39, 0.1);
  color: var(--accent);
}

.main {
  padding: 1.5rem 1.75rem 3rem;
  overflow-x: auto;
}

.page-title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
}

.page-desc {
  color: var(--muted);
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

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

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.panel-head {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

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

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

th,
td {
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface2);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.status-live {
  color: var(--success);
}
.status-pending {
  color: var(--warn);
}
.status-draft {
  color: var(--muted);
}

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

.field label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

.field textarea {
  min-height: 80px;
  resize: vertical;
}

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
  flex-wrap: wrap;
}

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

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

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

.tab-panel {
  display: none;
  padding: 1rem;
}

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

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.checklist li:last-child {
  border-bottom: none;
}

.mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  margin-top: 2px;
}

.mark.done {
  background: var(--success);
  border-color: var(--success);
}

.mark.pending {
  border-color: var(--warn);
}

.upload-zone {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.upload-zone strong {
  color: var(--text);
}

.timeline {
  margin: 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--border);
}

.timeline li {
  margin-bottom: 1rem;
  color: var(--muted);
}

.timeline strong {
  color: var(--text);
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.auth-tabs {
  display: flex;
  margin-bottom: 1.25rem;
}

.auth-tabs button {
  flex: 1;
  padding: 0.6rem;
  border: none;
  background: var(--surface2);
  color: var(--muted);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.auth-tabs button:first-child {
  border-radius: 8px 0 0 8px;
}
.auth-tabs button:last-child {
  border-radius: 0 8px 8px 0;
}

.auth-tabs button.active {
  background: var(--accent);
  color: #0c0d10;
}

.auth-pane {
  display: none;
}

.auth-pane.active {
  display: block;
}

.form-actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.format-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

/* --- Mobile & touch-friendly --- */

.table-wrap table {
  min-width: 36rem;
}

.tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  gap: 0.25rem;
}

.tab {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.nav-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .layout-app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(17.5rem, 86vw);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    border-right: 1px solid var(--border);
    border-bottom: none;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .nav-links a {
    padding: 0.75rem 0.85rem;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
  }

  .app-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 120;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface2);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
    touch-action: manipulation;
  }

  .mobile-nav-toggle-icon {
    display: block;
    width: 1.125rem;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
  }

  .logo-toolbar {
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .main {
    padding: 1rem 1rem 2.5rem;
  }

  .page-title {
    font-size: 1.35rem;
  }

  .grid-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr;
    padding: 0.75rem;
  }

  .tab-panel {
    padding: 0.75rem;
  }

  .toast {
    left: 1rem;
    right: 1rem;
    max-width: none;
    bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .shell {
    padding: 0 1rem;
  }

  .hero {
    padding: 2.5rem 0 2rem;
  }

  .hero-lead {
    font-size: 1rem;
  }

  .topnav {
    flex-wrap: wrap;
    padding: 0.75rem 0;
  }

  .topnav-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    width: 100%;
    gap: 0.5rem;
  }

  .topnav-actions .btn {
    flex: 1 1 auto;
    min-width: 6rem;
    justify-content: center;
  }

  .steps {
    grid-template-columns: 1fr;
    padding: 1.5rem 0 3rem;
  }

  .btn {
    min-height: 2.75rem;
    touch-action: manipulation;
  }

  .auth-layout {
    padding: 1rem;
    align-items: stretch;
  }

  .auth-card {
    padding: 1.25rem;
    max-width: none;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .grid-cards {
    grid-template-columns: 1fr;
  }

  .table-wrap table {
    min-width: 28rem;
    font-size: 0.8125rem;
  }

  th,
  td {
    padding: 0.55rem 0.65rem;
  }

  .panel-head {
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebar-backdrop {
    transition: none;
  }
}
