/* ── Portal Shell ─────────────────────────────────────────────── */
.portal-body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  min-height: 100dvh;
}

.portal-main {
  min-height: calc(100dvh - 64px);
  padding-bottom: 4rem;
}

.portal-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.portal-page--narrow {
  max-width: 720px;
}

/* ── Nav ──────────────────────────────────────────────────────── */
.portal-nav {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.portal-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.portal-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.portal-logo-mark {
  width: 34px;
  height: 34px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.portal-logo-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--fg);
}

.portal-logo-tag {
  font-size: 0.7rem;
  color: var(--fg-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: none;
}

@media (min-width: 640px) { .portal-logo-tag { display: inline; } }

.portal-nav-links {
  display: flex;
  gap: 0.25rem;
  flex: 1;
}

.nav-link {
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--fg-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover { background: var(--bg-card); color: var(--fg); }
.nav-link.active { background: var(--bg-card); color: var(--fg); }

.portal-nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.nav-client-name {
  font-size: 0.85rem;
  color: var(--fg-muted);
  display: none;
}

@media (min-width: 768px) { .nav-client-name { display: inline; } }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.88; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: var(--fg-muted); color: var(--fg); }

.btn-ghost-sm {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost-sm:hover { border-color: var(--fg-muted); color: var(--fg); }

.btn-approve {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #1a4731;
  color: #4ade80;
  border: 1px solid #22c55e33;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-approve:hover { background: #1c5e3c; }

.btn-revise {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-subtle);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-revise:hover { background: var(--accent-subtle); }

.w-full { width: 100%; }
.inline-form { display: inline; }

/* ── Page Header ──────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.page-sub {
  color: var(--fg-muted);
  font-size: 0.95rem;
}

.back-link {
  display: inline-block;
  color: var(--fg-muted);
  font-size: 0.85rem;
  text-decoration: none;
  margin-bottom: 1.25rem;
  transition: color 0.15s;
}
.back-link:hover { color: var(--fg); }

/* ── Calendar ─────────────────────────────────────────────────── */
.cal-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.cal-nav-btn {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.15s, color 0.15s;
}
.cal-nav-btn:hover { border-color: var(--fg-muted); color: var(--fg); }

.cal-nav-current {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.cal-day-label {
  background: var(--bg-elevated);
  padding: 0.6rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cal-cell {
  background: var(--bg-card);
  min-height: 90px;
  padding: 0.5rem 0.5rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cal-cell.cal-empty { background: var(--bg-elevated); }

.cal-cell.cal-today { background: #1a1510; }
.cal-cell.cal-today .cal-date { color: var(--accent); }

.cal-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 0.2rem;
  display: block;
}

.cal-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
  text-decoration: none;
  color: var(--fg);
  background: var(--bg-elevated);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: background 0.1s;
}
.cal-item:hover { background: var(--border); }

.cal-item-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--fg-muted);
}
.cal-item--pending_review .cal-item-dot { background: #f59e0b; }
.cal-item--approved .cal-item-dot { background: #22c55e; }
.cal-item--revision_requested .cal-item-dot { background: var(--accent); }

.cal-item-title { overflow: hidden; text-overflow: ellipsis; }

/* ── Sections & Cards ─────────────────────────────────────────── */
.section-block { margin-top: 2rem; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.link-muted { color: var(--fg-muted); font-size: 0.85rem; text-decoration: none; }
.link-muted:hover { color: var(--fg); }
.link-accent { color: var(--accent); text-decoration: none; }
.link-accent:hover { text-decoration: underline; }

.badge-count {
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid var(--accent-subtle);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 100px;
}

.badge-pending {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  text-decoration: none;
  white-space: nowrap;
}

.badge-status {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: capitalize;
  padding: 0.15rem 0.6rem;
  border-radius: 100px;
  background: var(--bg-elevated);
  color: var(--fg-muted);
  border: 1px solid var(--border);
}
.badge-status--pending_review { background: #451a031a; color: #f59e0b; border-color: #f59e0b33; }
.badge-status--approved { background: #0527191a; color: #22c55e; border-color: #22c55e33; }
.badge-status--revision_requested { background: var(--accent-subtle); color: var(--accent); border-color: var(--accent-subtle); }
.badge-status--submitted { background: #1e293b; color: #94a3b8; border-color: #334155; }
.badge-status--in_progress { background: #1e1b4b; color: #818cf8; border-color: #4338ca33; }

.badge-type {
  font-size: 0.72rem;
  color: var(--fg-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.15rem 0.6rem;
  border-radius: 100px;
}

.cards-list { display: flex; flex-direction: column; gap: 0.75rem; }

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.card-row-main { display: flex; align-items: center; gap: 0.75rem; }
.card-row-title { font-size: 0.9rem; }
.card-row-date { font-size: 0.8rem; color: var(--fg-muted); }

.cards-stack { display: flex; flex-direction: column; gap: 1rem; }

/* ── Brief Cards ──────────────────────────────────────────────── */
.brief-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.brief-card-header { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.brief-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.brief-desc { color: var(--fg-muted); font-size: 0.9rem; line-height: 1.6; margin-bottom: 1rem; }

.brief-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.meta-item { }
.meta-link { color: var(--accent); text-decoration: none; }
.meta-link:hover { text-decoration: underline; }

/* ── Deliverable Grid ─────────────────────────────────────────── */
.deliverable-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.deliverable-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--fg);
  transition: border-color 0.15s, transform 0.1s;
}
.deliverable-card:hover { border-color: var(--fg-muted); transform: translateY(-2px); }
.deliverable-card--pending_review { border-color: #f59e0b44; }
.deliverable-card--pending_review:hover { border-color: #f59e0b; }

.deliverable-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-elevated);
  overflow: hidden;
}
.deliverable-thumb img { width: 100%; height: 100%; object-fit: cover; }

.deliverable-thumb--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.deliverable-info { padding: 1rem; }
.deliverable-header { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.deliverable-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.3rem; }
.deliverable-date { font-size: 0.8rem; color: var(--fg-muted); }

/* ── Detail View ──────────────────────────────────────────────── */
.detail-header { margin-bottom: 2rem; }
.detail-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }

.detail-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.detail-section-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 0.75rem; }
.detail-body { font-size: 0.95rem; line-height: 1.7; color: var(--fg-muted); }

.detail-preview-img { width: 100%; max-height: 500px; object-fit: contain; border-radius: 8px; background: var(--bg-elevated); display: block; margin-bottom: 1rem; }
.detail-preview-video { width: 100%; border-radius: 8px; display: block; margin-bottom: 1rem; }
.detail-preview-audio { width: 100%; margin-bottom: 1rem; }
.download-btn { margin-top: 0.75rem; }

.revision-notes-display {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--fg-muted);
  white-space: pre-wrap;
}

.review-actions {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.review-actions-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 1.25rem; }
.revision-form-block { margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1.5rem; }
.revision-form-intro { color: var(--fg-muted); font-size: 0.9rem; margin-bottom: 0.75rem; }
.revision-form { display: flex; flex-direction: column; gap: 0.75rem; }

.approved-banner {
  background: #0527191a;
  border: 1px solid #22c55e33;
  color: #22c55e;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

/* ── Forms ────────────────────────────────────────────────────── */
.portal-form { display: flex; flex-direction: column; gap: 1.5rem; }

.field-group { display: flex; flex-direction: column; gap: 0.5rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

.field-label { font-size: 0.85rem; font-weight: 500; color: var(--fg); }
.required { color: var(--accent); }

.field-input, .field-textarea, .field-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.65rem 0.9rem;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.field-input:focus, .field-textarea:focus, .field-select:focus { border-color: var(--accent); }
.field-input::placeholder, .field-textarea::placeholder { color: var(--fg-muted); }
.field-textarea { resize: vertical; }
.field-select option { background: var(--bg-card); }

.file-drop {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
  position: relative;
}
.file-drop.drag-over { border-color: var(--accent); background: var(--accent-subtle); }
.file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop-label { display: flex; flex-direction: column; gap: 0.4rem; pointer-events: none; }
.file-drop-icon { font-size: 1.5rem; }
.file-drop-label > span { color: var(--fg-muted); font-size: 0.9rem; }
.file-browse-link { color: var(--accent); cursor: pointer; pointer-events: auto; }
.file-drop-hint { font-size: 0.8rem; color: var(--fg-muted); }
.file-selected { color: var(--accent); font-size: 0.85rem; margin-top: 0.5rem; }

.form-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 0.5rem; }

/* ── Login ────────────────────────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100dvh; padding: 2rem; }

.login-container { width: 100%; max-width: 420px; }

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
}

.login-logo { text-align: center; margin-bottom: 1.5rem; }
.login-logo .portal-logo-mark { width: 52px; height: 52px; font-size: 1.1rem; border-radius: 14px; margin: 0 auto; }
.login-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; text-align: center; margin-bottom: 0.5rem; }
.login-sub { color: var(--fg-muted); font-size: 0.9rem; text-align: center; margin-bottom: 1.5rem; line-height: 1.5; }
.login-form { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
.login-help { color: var(--fg-muted); font-size: 0.82rem; text-align: center; }

/* ── Alerts ───────────────────────────────────────────────────── */
.alert-error {
  background: #2d0e0e;
  border: 1px solid #7f1d1d;
  color: #fca5a5;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.alert-success {
  background: #0527191a;
  border: 1px solid #22c55e33;
  color: #22c55e;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.alert-info {
  background: #1e1b4b22;
  border: 1px solid #818cf833;
  color: #818cf8;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ── Empty State ──────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.empty-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.empty-sub { color: var(--fg-muted); font-size: 0.9rem; max-width: 420px; }
