/* ==========================================================================
   Page layouts: auth, dashboard, admin, AI detail. Tokens live in theme.css
   ========================================================================== */

.shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: 22px 20px 60px;
  display: grid;
  gap: 20px;
}

.grid {
  display: grid;
  gap: 20px;
}
.grid-2 {
  grid-template-columns: 1.35fr 1fr;
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ── auth pages (login / signup / join) ────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.auth-hero {
  position: relative;
  overflow: hidden;
  padding: 56px 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  background:
    radial-gradient(720px 520px at 78% 12%, rgba(106, 92, 255, 0.32), transparent 62%),
    radial-gradient(620px 440px at 8% 88%, rgba(34, 211, 238, 0.2), transparent 62%),
    linear-gradient(180deg, #070a15, #0b0f1e);
  border-inline-start: 1px solid var(--line);
}

.auth-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 60% 40%, #000 20%, transparent 72%);
  pointer-events: none;
}

.auth-hero > * {
  position: relative;
}

.auth-hero h1 {
  font-size: clamp(1.9rem, 3.2vw, 2.8rem);
  max-width: 22ch;
}
.auth-hero h1 span {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-hero .lead {
  color: var(--text-dim);
  font-size: 1rem;
  max-width: 44ch;
}

.feature-list {
  display: grid;
  gap: 12px;
  max-width: 480px;
}
.feature {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
}
.feature-ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--brand-grad-soft);
  border: 1px solid rgba(106, 92, 255, 0.3);
  font-size: 1rem;
}
.feature strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}
.feature small {
  color: var(--text-mute);
  font-size: 0.79rem;
  line-height: 1.7;
}

.auth-side {
  display: grid;
  place-items: center;
  padding: 40px 26px;
  background: var(--bg-900);
}

.auth-card {
  width: min(430px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px 30px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
}
.auth-card h2 {
  font-size: 1.35rem;
}
.auth-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin-bottom: 20px;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}
.auth-tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 9px;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.auth-tabs button.active {
  background: var(--brand-grad);
  color: #05070f;
}

.demo-box {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px dashed var(--line-strong);
  font-size: 0.78rem;
  color: var(--text-mute);
  line-height: 2;
}

@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-hero {
    order: 2;
    padding: 36px 22px;
  }
  .auth-side {
    order: 1;
    padding: 28px 18px;
  }
}

/* ── dashboard ─────────────────────────────────────────────────────────────── */
.hero-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
  padding: 26px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(106, 92, 255, 0.18), rgba(34, 211, 238, 0.1) 55%, transparent);
}
.hero-panel::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  inset-inline-end: -110px;
  top: -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(106, 92, 255, 0.35), transparent 68%);
  pointer-events: none;
}
.hero-panel h1 {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  margin: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.stat {
  padding: 16px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(8, 11, 22, 0.5);
}
.stat b {
  display: block;
  font-size: 1.6rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.stat span {
  font-size: 0.78rem;
  color: var(--text-mute);
}

.meeting-list {
  display: grid;
  gap: 12px;
}

.meeting-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(8, 11, 22, 0.45);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
}
.meeting-card:hover {
  border-color: var(--line-strong);
  background: rgba(14, 18, 34, 0.6);
  transform: translateY(-1px);
}
.meeting-card.live {
  border-color: rgba(52, 211, 153, 0.35);
  box-shadow: inset 3px 0 0 rgba(52, 211, 153, 0.7);
}
.meeting-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.meeting-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-mute);
}
.meeting-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
@media (max-width: 760px) {
  .meeting-card {
    grid-template-columns: 1fr;
  }
  .meeting-actions {
    justify-content: flex-start;
  }
}

/* profile card */
.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.avatar-edit {
  position: relative;
  display: inline-block;
  line-height: 0;
  cursor: pointer;
}
.avatar-edit input[type="file"] {
  display: none;
}
.avatar-edit .cam {
  position: absolute;
  inset-inline-end: -4px;
  bottom: -4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-grad);
  color: #05070f;
  font-size: 0.7rem;
  border: 2px solid var(--bg-900);
}

/* ── AI detail ─────────────────────────────────────────────────────────────── */
.ai-header {
  display: grid;
  gap: 14px;
}
.ai-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 5px;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}
.ai-tabs button {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-weight: 700;
  font-size: 0.83rem;
  padding: 9px 18px;
  border-radius: var(--r-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}
.ai-tabs button.active {
  background: var(--brand-grad);
  color: #05070f;
}

.speaker-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(8, 11, 22, 0.45);
}
.speaker-card header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.speaker-card header .who {
  display: grid;
  line-height: 1.4;
}
.speaker-card audio {
  width: 100%;
  height: 38px;
  border-radius: var(--r-full);
}

.transcript-box {
  max-height: 460px;
  overflow-y: auto;
  padding: 16px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(4, 6, 14, 0.6);
  font-size: 0.88rem;
  line-height: 2.1;
  white-space: pre-wrap;
  word-break: break-word;
}
.transcript-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.transcript-line:last-child {
  border-bottom: 0;
}
.transcript-time {
  font-size: 0.74rem;
  color: var(--brand-2);
  font-variant-numeric: tabular-nums;
  padding-top: 3px;
}
.transcript-line b {
  color: #fff;
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.shot {
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(8, 11, 22, 0.5);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.shot:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}
.shot img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: #000;
  cursor: zoom-in;
}
.shot-body {
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}
.shot-body strong {
  font-size: 0.86rem;
}
.shot-body p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.85;
}

.qa-log {
  display: grid;
  gap: 12px;
}
.qa-item {
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(8, 11, 22, 0.45);
}
.qa-item .q {
  font-weight: 700;
  margin-bottom: 8px;
}
.qa-item .a {
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.95;
  white-space: pre-wrap;
}
.qa-item .who {
  font-size: 0.74rem;
  color: var(--text-mute);
  margin-top: 8px;
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: none;
  place-items: center;
  padding: 30px;
  background: rgba(2, 4, 10, 0.92);
  backdrop-filter: blur(6px);
}
.lightbox.open {
  display: grid;
}
.lightbox img {
  max-width: 100%;
  max-height: 86vh;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
}
.lightbox .close {
  position: absolute;
  top: 22px;
  inset-inline-end: 22px;
}

/* ── admin ─────────────────────────────────────────────────────────────────── */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.kv {
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(8, 11, 22, 0.5);
}
.kv span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-mute);
  margin-bottom: 4px;
}
.kv b {
  font-size: 0.92rem;
  word-break: break-all;
}

.limit-input {
  width: 92px;
  padding: 7px 10px;
  text-align: center;
}
