/* Dashboard-specific styles ============================================== */

/* Topnav tabs =========================================================== */
.topnav-tabs { display: flex; align-items: center; gap: 4px; }
.topnav-tabs .tab {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 500;
}
.topnav-tabs .tab:hover { background: color-mix(in oklab, var(--fg), transparent 92%); color: var(--fg); }
.topnav-tabs .tab.is-active { color: var(--fg); background: color-mix(in oklab, var(--fg), transparent 92%); }

.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--text-sm);
}
.avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-on);
  display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 600;
}

/* Toolbar ================================================================ */
.toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--space-4);
  align-items: center;
  margin-bottom: var(--space-5);
}
.search {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  height: 38px;
}
.search input {
  border: 0; outline: 0; background: transparent;
  flex: 1;
  font-size: var(--text-base);
}
.search svg { color: var(--muted); }

.filter-group { display: flex; gap: var(--space-2); align-items: center; }
.select { display: inline-flex; align-items: center; gap: 6px; }
.select-label { color: var(--muted); font-size: var(--text-sm); }
.select select {
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 26px 0 10px;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%236b6b6b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") right 10px center / 8px no-repeat var(--surface);
  appearance: none;
  font-size: var(--text-sm);
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.view-toggle .vt {
  width: 36px; height: 36px;
  background: var(--surface);
  border: 0;
  color: var(--muted);
  display: inline-grid; place-items: center;
}
.view-toggle .vt.is-active { background: color-mix(in oklab, var(--accent), white 90%); color: var(--accent); }
.view-toggle .vt + .vt { border-left: 1px solid var(--border); }

/* Upload zone =========================================================== */
.upload {
  margin-bottom: var(--space-6);
  border-style: dashed;
  background: color-mix(in oklab, var(--surface), white 30%);
}
.upload-inner {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: var(--space-4);
  align-items: center;
  padding: 18px 22px;
  border-radius: var(--radius-md);
  cursor: pointer;
}
.upload-inner.is-drag,
.upload-inner:hover {
  background: color-mix(in oklab, var(--accent), white 92%);
  border-color: color-mix(in oklab, var(--accent), white 60%);
}
.upload-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--accent), white 88%);
  color: var(--accent);
  display: grid; place-items: center;
}
.upload-body { display: grid; gap: 4px; }
.upload-body strong { font-weight: 600; }
.upload-body span { color: var(--muted); font-size: var(--text-sm); }

/* Project grid (cards) ================================================== */
.project-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin-bottom: var(--space-8);
}
.project-card { overflow: hidden; transition: transform var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard); }
.project-card:hover { border-color: #cfcfcf; }
.project-card:focus-visible { outline: none; border-color: var(--accent); }
.pc-cover {
  position: relative;
  height: 132px;
  padding: 14px;
  display: grid;
  place-items: center;
}
.pc-slides {
  width: 96px; height: 64px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid color-mix(in oklab, var(--fg), transparent 80%);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  align-content: center;
}
.pc-slides i {
  display: block;
  height: 4px;
  background: color-mix(in oklab, var(--fg), transparent 75%);
  border-radius: 2px;
}
.pc-slides i:nth-child(1) { grid-column: 1 / -1; background: color-mix(in oklab, var(--fg), transparent 50%); height: 6px; width: 60%; }
.pc-slides i:nth-child(2) { width: 70%; }
.pc-slides i:nth-child(3) { width: 80%; }
.pc-slides i:nth-child(4) { width: 60%; }
.pc-slides i:nth-child(5) { width: 50%; }
.pc-slides i:nth-child(6) { width: 70%; }
.pc-status { position: absolute; top: 12px; left: 12px; }
.pc-ext {
  position: absolute; top: 12px; right: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: color-mix(in oklab, var(--surface), transparent 10%);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid color-mix(in oklab, var(--fg), transparent 86%);
}
.pc-body { padding: 14px 16px 16px; }
.pc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.pc-head h3 { margin: 0; font-size: var(--text-md); font-weight: 600; letter-spacing: -0.005em; line-height: 1.35; }
.pc-meta { color: var(--muted); font-size: var(--text-xs); margin: 6px 0 14px; }
.pc-foot { display: flex; align-items: center; justify-content: space-between; }
.pc-id { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.pc-actions { display: flex; align-items: center; gap: 6px; }

/* Project table ========================================================== */
.project-table { overflow: hidden; margin-bottom: var(--space-8); }
.project-table table { width: 100%; border-collapse: collapse; }
.project-table th, .project-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
  vertical-align: middle;
}
.project-table th {
  background: color-mix(in oklab, var(--surface), white 30%);
  color: var(--muted);
  font-weight: 500;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.project-table tr:last-child td { border-bottom: 0; }
.project-table tr:hover td { background: color-mix(in oklab, var(--surface), white 30%); }
.dot-thumb {
  width: 32px; height: 22px;
  border-radius: 4px;
  display: inline-block;
  border: 1px solid color-mix(in oklab, var(--fg), transparent 85%);
}

/* Responsive =========================================================== */
@media (max-width: 920px) {
  .toolbar { grid-template-columns: 1fr; }
  .filter-group { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .page-head { flex-direction: column; align-items: flex-start; }
  .upload-inner { grid-template-columns: 1fr; text-align: left; }
  .upload-inner .btn { justify-self: start; }
}