/* ===========================================================================
   Dashboard panels: discovery, submissions, label inbox, calendar
   Loaded after dashboard.css. Everything here is responsive down to 360px,
   because a label checks its inbox on a phone as often as at a desk.
   =========================================================================== */

/* ---------------------------------------------------------------------------
   Shared bits
   --------------------------------------------------------------------------- */

.detail-heading {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-quaternary);
  margin: 0 0 var(--space-3);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
}
.detail-pair__label { font-size: var(--text-xs); color: var(--text-quaternary); }
.detail-pair__value { font-size: var(--text-sm); margin-top: 2px; word-break: break-word; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}

.prefix-field { display: flex; align-items: center; }
.prefix-field__prefix {
  padding: 0 var(--space-2) 0 var(--space-3);
  height: 40px;
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
}
.prefix-field .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.more summary {
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding: var(--space-2) 0;
  user-select: none;
}
.more summary:hover { color: var(--text-primary); }

/* Segmented filter control */
.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  overflow-x: auto;
  /* Hide the scrollbar on the tab strip; it scrolls by drag on touch. */
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }

.seg__btn {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.seg__btn:hover { color: var(--text-primary); }
.seg__btn.is-on {
  background: var(--surface-solid);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
.seg__count { color: var(--text-quaternary); font-variant-numeric: tabular-nums; }
.seg__btn.is-on .seg__count { color: var(--accent); }

.inbox__filters {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}
.inbox__search { flex: 1; min-width: 200px; max-width: 320px; }

/* ---------------------------------------------------------------------------
   Submission rows
   --------------------------------------------------------------------------- */

.sub {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.sub + .sub { margin-top: var(--space-2); }
.sub:hover { border-color: var(--border-strong); background: var(--surface-2); }

.sub__play {
  width: 38px; height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-secondary);
  font-size: 12px;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.sub__play:hover:not(:disabled) { background: var(--accent); color: var(--accent-fg); }
.sub__play:disabled { opacity: 0.35; cursor: not-allowed; }
.sub__play .fa-play { margin-left: 2px; }

.sub__body { flex: 1; min-width: 0; }
.sub__top { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.sub__artist { font-weight: 600; font-size: var(--text-sm); }
.sub__stars { color: var(--accent); font-size: var(--text-xs); letter-spacing: 1px; }

.sub__tracks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.sub__track { cursor: pointer; }
.sub__track:hover { color: var(--accent); }

.sub__note {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-line;
}

.sub__meta { margin-top: var(--space-2); font-size: var(--text-xs); color: var(--text-quaternary); }

.sub__actions { display: flex; gap: var(--space-1); align-items: flex-start; flex: none; }

/* Star rating */
.rating { display: flex; gap: var(--space-1); }
.rating__star {
  font-size: 22px;
  line-height: 1;
  color: var(--border-strong);
  transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.rating__star:hover { transform: scale(1.12); }
.rating__star.is-on { color: var(--accent); }

/* ---------------------------------------------------------------------------
   Label directory
   --------------------------------------------------------------------------- */

.label-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.label-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color var(--dur-med) var(--ease-out),
              background var(--dur-med) var(--ease-out),
              transform var(--dur-med) var(--ease-out);
}
.label-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.label-card.is-picked {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.label-card.is-picked .label-card__tick {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

/* A closed label is still worth showing, so people know it exists and can come
   back. It just cannot be selected. */
.label-card.is-closed { opacity: 0.62; cursor: default; }
.label-card.is-closed:hover { transform: none; border-color: var(--border-subtle); }

.label-card__top { display: flex; align-items: center; gap: var(--space-3); }

.label-card__logo {
  width: 42px; height: 42px;
  flex: none;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface-2);
}
.label-card__logo--empty {
  display: grid;
  place-items: center;
  color: var(--text-quaternary);
  font-size: 15px;
}

.label-card__name {
  font-weight: 600;
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.label-card__name i { color: var(--accent); font-size: 11px; flex: none; }
.label-card__meta { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 2px; }

.label-card__tick {
  margin-left: auto;
  width: 22px; height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  color: transparent;
  font-size: 9px;
  transition: all var(--dur-fast) var(--ease-out);
}

.label-card__about {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.label-card__genres { display: flex; flex-wrap: wrap; gap: 5px; }

.label-card__foot {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-xs);
  flex-wrap: wrap;
}

/* Sticky action bar when labels are selected */
.submit-bar {
  position: sticky;
  bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--surface-overlay);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: var(--text-sm);
  animation: nw-pop var(--dur-med) var(--ease-spring);
  z-index: var(--z-sticky);
}
.submit-bar > :first-child { flex: 1; }

/* ---------------------------------------------------------------------------
   Pick list, used by the submit flow
   --------------------------------------------------------------------------- */

.pick-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-2);
}

.pick {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.pick:hover { background: var(--surface-2); }
.pick input { flex: none; accent-color: var(--accent); width: 16px; height: 16px; }
.pick__body { min-width: 0; }
.pick__title { display: block; font-size: var(--text-sm); }
.pick__meta { display: block; font-size: var(--text-xs); color: var(--text-quaternary); margin-top: 1px; }

/* ---------------------------------------------------------------------------
   Calendar
   --------------------------------------------------------------------------- */

.cal {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-1);
}

.cal__bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}
.cal__month { font-weight: 600; font-size: var(--text-md); min-width: 150px; }
.cal__bar > :last-child { margin-left: auto; }

.cal__head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border-subtle);
}
.cal__dow {
  padding: var(--space-2);
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-quaternary);
}

.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); }

.cal__cell {
  min-height: 92px;
  padding: var(--space-2);
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}
.cal__cell:nth-child(7n) { border-right: none; }
.cal__cell.is-outside { opacity: 0.35; }
.cal__cell.is-today { background: var(--accent-tint); }

.cal__date { font-size: var(--text-xs); color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.cal__cell.is-today .cal__date { color: var(--accent); font-weight: 700; }

.cal__chip {
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface-3);
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
}
.cal__chip--deal { background: var(--accent-soft); color: var(--accent); }

.cal__more { font-size: 10px; color: var(--text-quaternary); padding-left: 2px; }
.cal__loading { grid-column: 1 / -1; padding: var(--space-12); text-align: center; color: var(--text-tertiary); }

.cal__date-badge {
  width: 46px;
  flex: none;
  text-align: center;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.cal__date-badge span { display: block; font-size: var(--text-md); font-weight: 600; line-height: 1; }
.cal__date-badge small { display: block; font-size: 10px; color: var(--text-quaternary); text-transform: uppercase; margin-top: 2px; }

/* ---------------------------------------------------------------------------
   Image picker
   --------------------------------------------------------------------------- */

.img-picker {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--border-strong);
  background: var(--surface-2);
  overflow: hidden;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color var(--dur-med) var(--ease-out), background var(--dur-med) var(--ease-out);
}
.img-picker:hover, .img-picker.is-dragover { border-color: var(--accent); background: var(--accent-tint); }
.img-picker img { width: 100%; height: 100%; object-fit: cover; }
.img-picker__hint {
  position: absolute;
  inset: auto 0 0 0;
  padding: var(--space-2);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: var(--text-xs);
  text-align: center;
}

/* Spinner while variants are being built and uploaded. */
.img-picker.is-uploading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(2px);
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */

@media (max-width: 780px) {
  .grid-2 { grid-template-columns: 1fr; }
  .label-grid { grid-template-columns: 1fr; }
  .inbox__search { max-width: none; }

  /* A 7 column month grid is unusable at phone width, so the calendar becomes
     a list. The upcoming section below it already reads as one, so this keeps
     the same shape rather than inventing a second layout. */
  .cal__head { display: none; }
  .cal__grid { grid-template-columns: 1fr; }
  .cal__cell { min-height: 0; border-right: none; flex-direction: row; align-items: center; gap: var(--space-3); }
  .cal__cell:empty, .cal__cell.is-outside { display: none; }
  /* Days with nothing on them add nothing in a list view. */
  .cal__cell:not(:has(.cal__chip)) { display: none; }
  .cal__date { min-width: 26px; font-weight: 600; }
  .cal__chip { flex: 1; white-space: normal; }
}

@media (max-width: 560px) {
  .sub { flex-wrap: wrap; }
  .sub__actions { width: 100%; justify-content: flex-end; }
  .submit-bar { flex-wrap: wrap; border-radius: var(--radius-lg); }
  .submit-bar .btn { flex: 1; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .check-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   Deals
   --------------------------------------------------------------------------- */

.deal-group {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-quaternary);
  margin: var(--space-8) 0 var(--space-3);
}
.deal-group:first-child { margin-top: 0; }

.deal {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.deal:hover { border-color: var(--border-strong); background: var(--surface-2); }

.deal__top { display: flex; align-items: flex-start; gap: var(--space-4); }

/* Stage track. A row of dots joined by a line, filled up to the current stage.
   The connecting line is drawn on the step rather than as a separate element so
   it cannot fall out of alignment when a label wraps. */
.deal__track {
  display: flex;
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.deal__step {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.deal__step::before {
  content: "";
  position: absolute;
  top: 4px;
  left: -50%;
  width: 100%;
  height: 1.5px;
  background: var(--border);
}
.deal__step:first-child::before { display: none; }
.deal__step.is-done::before,
.deal__step.is-now::before { background: var(--accent); }

.deal__dot {
  position: relative;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1.5px solid var(--border);
  flex: none;
}
.deal__step.is-done .deal__dot { background: var(--accent); border-color: var(--accent); }
.deal__step.is-now .deal__dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.deal__step-label {
  font-size: 10px;
  color: var(--text-quaternary);
  text-align: center;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.deal__step.is-now .deal__step-label { color: var(--accent); font-weight: 600; }
.deal__step.is-done .deal__step-label { color: var(--text-tertiary); }

.deal__track--lg .deal__step-label { font-size: var(--text-xs); }

.deal__note {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------------------------------------------------------------------------
   Onboarding
   ---------------------------------------------------------------------------
   Deliberately not a modal. It sits over the corner of the dashboard so the
   product is visible behind it and nothing is blocked while it is open.
   --------------------------------------------------------------------------- */

.onboard {
  position: fixed;
  inset: auto var(--space-6) var(--space-6) auto;
  z-index: var(--z-modal);
  width: min(420px, calc(100vw - var(--space-8)));
  animation: nw-pop var(--dur-slow) var(--ease-spring);
}
.onboard.is-closing { animation: nw-fade-in var(--dur-fast) var(--ease-out) reverse forwards; }

.onboard__panel {
  position: relative;
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  background: var(--surface-panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  max-height: calc(100vh - var(--space-12));
  overflow-y: auto;
}

.onboard__close {
  position: absolute;
  top: var(--space-4); right: var(--space-4);
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  color: var(--text-quaternary);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.onboard__close:hover { background: var(--surface-2); color: var(--text-primary); }

.onboard__steps { display: flex; gap: 5px; margin-bottom: var(--space-5); }
.onboard__step {
  height: 3px;
  flex: 1;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  transition: background var(--dur-slow) var(--ease-out);
}
.onboard__step.is-on { background: var(--accent); }

.onboard__title { font-size: var(--text-xl); letter-spacing: -0.025em; margin-bottom: var(--space-2); }
.onboard__lede { font-size: var(--text-sm); color: var(--text-tertiary); line-height: 1.6; }

.onboard__points { display: flex; flex-direction: column; gap: var(--space-3); margin: var(--space-6) 0; }
.onboard__point { display: flex; gap: var(--space-3); font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.55; }
.onboard__point i {
  flex: none;
  margin-top: 3px;
  width: 16px;
  text-align: center;
  color: var(--accent);
  font-size: 12px;
}

.onboard__actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-6);
}

@media (max-width: 640px) {
  /* Full width sheet at the bottom on a phone. The corner card would cover the
     thing it is telling you to look at. */
  .onboard { inset: auto 0 0 0; width: 100%; }
  .onboard__panel { border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .onboard__actions { flex-direction: column-reverse; }
  .onboard__actions .btn { width: 100%; }

  /* Seven stages do not fit. Show the current one and the line only. */
  .deal__step-label { display: none; }
  .deal__track--lg .deal__step-label { display: block; font-size: 9px; }
}
