/* Dashboard-specific layout on top of standalone.css.
   .app-header and related chrome rules live in standalone.css (shared). */

.dashboard-hero {
  background: var(--th-accent-primary);
  color: var(--th-accent-on-primary);
  border-radius: 16px;
  padding: 28px 32px;
  margin: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.dashboard-hero h1 {
  margin: 0 0 4px 0;
  font-size: 22px;
}
.dashboard-hero .subtitle {
  margin: 0;
  font-size: 13px;
  opacity: 0.88;
}
.dashboard-hero .stats {
  display: flex;
  gap: 24px;
}
.dashboard-hero .stat .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
}
.dashboard-hero .stat .value {
  font-size: 22px;
  font-weight: 700;
}

.tab-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--th-surface);
  border: 1px solid var(--th-edge);
  border-radius: 12px;
  width: max-content;
}
.tab-btn {
  background: transparent;
  border: none;
  color: var(--th-on-surface-muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 500;
}
.tab-btn.active {
  background: var(--th-accent-primary);
  color: var(--th-accent-on-primary);
}
.tab-btn .count {
  margin-left: 6px;
  font-size: 11px;
  opacity: 0.8;
}

.tab-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 16px 0;
}

.search-input {
  width: 280px;
}

/* Search + New-video sit together on the right of the tab row */
.tab-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.project-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.project-card .thumb {
  aspect-ratio: 16 / 9;
  background: var(--th-surface-dim);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--th-on-surface-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
}
/* When a real first-scene photo is loaded the "16:9 preview" placeholder
   label becomes redundant — and unreadable over a photo. Hide it. */
.project-card .thumb.has-image .thumb-label { display: none; }
.project-card .thumb .progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--th-edge);
}
.project-card .thumb .progress::after {
  content: '';
  display: block;
  height: 100%;
  width: var(--progress, 0%);
  background: var(--th-accent-primary);
}

/* Live render overlay on cards whose status is "rendering". */
.card-render-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--th-overlay);
  color: var(--th-accent-on-primary);
}
.card-render-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--th-edge);
  border-top-color: var(--th-accent-primary);
  border-radius: 50%;
  animation: card-spin 700ms linear infinite;
}
@keyframes card-spin { to { transform: rotate(360deg); } }
.card-render-percent {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.card-render-stage {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}
.project-card.is-rendering { cursor: progress; }

/* "New reviewer feedback" badge — top-left of the card (dot-menu sits top-right). */
.project-card .review-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  background: var(--th-accent-primary);
  color: var(--th-accent-on-primary);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  box-shadow: 0 2px 8px var(--th-shadow-color);
}

.project-card .body {
  padding: 14px;
}
.project-card .name {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 6px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-card .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.project-card .updated {
  margin-top: 8px;
  color: var(--th-on-surface-faint);
  font-size: 11px;
}
.dot-menu-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--th-surface);
  color: var(--th-on-surface);
  border: 1px solid var(--th-edge);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.dot-menu-btn:hover { background: var(--th-surface-hover); }

.dropdown {
  position: absolute;
  z-index: 30;
  background: var(--th-surface);
  border: 1px solid var(--th-edge);
  border-radius: 10px;
  box-shadow: 0 8px 24px var(--th-shadow-color);
  min-width: 180px;
  padding: 4px;
}
.dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--th-on-surface);
}
.dropdown button:hover { background: var(--th-surface-hover); }
.dropdown .divider {
  height: 1px;
  background: var(--th-edge);
  margin: 4px 0;
}
.dropdown .danger { color: var(--th-accent-danger); }

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--th-on-surface-faint);
}
.empty .icon {
  font-size: 36px;
  margin-bottom: 8px;
}


.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--th-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}
.modal {
  background: var(--th-surface);
  border-radius: 14px;
  padding: 24px;
  width: 420px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 20px 60px var(--th-shadow-color);
}
.modal h2 {
  margin: 0 0 4px 0;
  font-size: 18px;
}
.modal .desc {
  margin: 0 0 16px 0;
  color: var(--th-on-surface-muted);
  font-size: 13px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--th-edge);
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  color: var(--th-on-surface);
}
.theme-toggle:hover { background: var(--th-surface-hover); }

/* Shared with me — recipient card styles */
.shared-card .shared-by {
  font-size: 12px;
  color: var(--th-on-surface-muted);
  margin-top: 4px;
}
.shared-card.shared-unread .name::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--th-accent-primary);
  margin-right: 6px;
  vertical-align: middle;
}
.badge-shared-permission {
  background: var(--th-tint-primary);
  color: var(--th-accent-primary);
  font-weight: 600;
}
.shared-copy-btn {
  font-size: 18px;
  line-height: 1;
}
.shared-copy-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
