﻿/* =================================================================
   MAKE IT SHOT — Design System & Global Styles
   Modern dark theme for creative production tools
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

/* ─── DESIGN TOKENS ─── */
:root {
  --bg-base: #09090b;
  --bg-subtle: #0f0f13;
  --bg-surface: #141419;
  --bg-raised: #1a1a21;
  --bg-muted: #22222a;
  --bg-emphasis: #2c2c36;

  --primary: #8b5cf6;
  --primary-hover: #a78bfa;
  --primary-muted: rgba(139,92,246,0.12);
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --accent-muted: rgba(245,158,11,0.12);

  --success: #22c55e;
  --success-muted: rgba(34,197,94,0.12);
  --warning: #eab308;
  --warning-muted: rgba(234,179,8,0.12);
  --danger: #ef4444;
  --danger-muted: rgba(239,68,68,0.12);
  --info: #3b82f6;
  --info-muted: rgba(59,130,246,0.12);

  --text: #ededf0;
  --text-secondary: #a0a0ad;
  --text-muted: #606070;
  --text-inverse: #09090b;

  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.13);
  --border-active: rgba(139,92,246,0.4);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.25);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
  --shadow-xl: 0 24px 64px rgba(0,0,0,0.5);

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.1s ease;
  --transition: 0.2s ease;
  --transition-slow: 0.3s ease;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --layout-max-width: 1280px;
}

/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

img, video { max-width: 100%; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-hover); }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}
h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h3 { font-size: clamp(1.05rem, 2vw, 1.25rem); }

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ─── DECORATIVE ORBS (removed — using subtle gradients instead) ─── */
.bg-orb { display: none; }

/* ─── TOPBAR / NAVIGATION ─── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 24px;
  background: rgba(9,9,11,0.8);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav a {
  text-decoration: none;
  color: #decfcf;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 13px;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.nav a:hover {
  color: var(--text);
  background: var(--bg-raised);
  border-color: var(--border);
}

.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: all var(--transition);
}

/* ─── USER MENU ─── */
.user-menu {
  position: relative;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-hover);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.user-avatar:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all var(--transition);
  z-index: 200;
}

.user-menu.open .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown a,
.user-dropdown .dropdown-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.user-dropdown a:hover {
  background: var(--bg-raised);
  color: var(--text);
}

.nav-buy-credits {
  background: rgba(139,92,246,0.12) !important;
  border: 1px solid rgba(139,92,246,0.28) !important;
  color: #c4b5fd !important;
  font-weight: 600 !important;
}

.nav-buy-credits:hover {
  background: rgba(139,92,246,0.22) !important;
  color: #ede9fe !important;
}

.dropdown-divider {
  height: 1px;
  margin: 4px 0;
  background: var(--border);
}

.dropdown-label {
  color: var(--text-muted) !important;
  font-size: 11px !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  pointer-events: none;
}

/* ─── MAIN CONTAINER ─── */
.shell {
  width: 100%;
  /*max-width: var(--layout-max-width);*/
  margin: 0 auto;
  padding: 32px 28px 48px;
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}

/* ─── MESSAGES / TOASTS ─── */
.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.message {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  animation: slideInDown 0.3s ease;
}

.message.error {
  background: var(--danger-muted);
  border-color: rgba(239,68,68,0.3);
  color: #fca5a5;
}

.message.success {
  background: var(--success-muted);
  border-color: rgba(34,197,94,0.3);
  color: #86efac;
}

.message.warning {
  background: var(--warning-muted);
  border-color: rgba(234,179,8,0.3);
  color: #fde047;
}

.message.info {
  background: var(--info-muted);
  border-color: rgba(59,130,246,0.3);
  color: #93c5fd;
}

/* Toast container */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  transition: transform var(--transition-slow);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
}

.toast-visible { transform: translateX(0); }

.toast-error {
  background: var(--danger-muted);
  border-color: rgba(239,68,68,0.3);
  color: #fca5a5;
}

.toast-success {
  background: var(--success-muted);
  border-color: rgba(34,197,94,0.3);
  color: #86efac;
}

/* ─── PAGE HEADER ─── */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.muted { color: var(--text-muted); }

/* ─── PUBLIC HOME PAGE ─── */
.home-shell {
  width: 100%;
  margin: 0 auto;
  padding: 0;
  display: grid;
  gap: 0;
  animation: fadeIn 0.3s ease;
}

.home-hero,
.home-section,
.home-final-cta {
  width: 100%;
  padding: 72px 28px;
}

.home-hero {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  align-items: center;
  gap: 52px;
  background:
    linear-gradient(135deg, rgba(20,20,25,0.86), rgba(9,9,11,0.98)),
    linear-gradient(90deg, rgba(34,197,94,0.08), rgba(139,92,246,0.08) 46%, rgba(245,158,11,0.07));
  border-bottom: 1px solid var(--border);
}

.home-hero-copy,
.home-hero-media,
.home-section-head,
.home-showcase-grid,
.home-workflow-grid,
.home-benefit-section,
.home-pricing-panel,
.home-final-cta > * {
  max-width: var(--layout-max-width);
}

.home-hero-copy {
  display: grid;
  gap: 22px;
  justify-self: start;
  order: 1;
}

.home-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-hero h1 {
  max-width: 760px;
  font-size: clamp(2.65rem, 6vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.home-hero-copy p {
  max-width: 680px;
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1.75;
}

.home-hero-actions,
.home-proof-row,
.home-pricing-facts {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.home-proof-row span,
.home-pricing-facts span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  background: rgba(255,255,255,0.03);
  font-size: 12px;
  font-weight: 700;
}

.home-hero-media {
  justify-self: end;
  width: min(100%, 640px);
  display: grid;
  gap: 14px;
  order: 2;
}

.home-media-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.58fr);
  gap: 14px;
  align-items: stretch;
}

.home-media-frame,
.home-placeholder {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(59,130,246,0.18), transparent 42%),
    linear-gradient(315deg, rgba(245,158,11,0.16), transparent 45%),
    linear-gradient(180deg, var(--bg-raised), var(--bg-surface));
  box-shadow: var(--shadow-lg);
}

.home-media-frame img,
.home-placeholder img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-media-frame::before,
.home-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, transparent, black 30%, black);
}

.home-media-frame::after,
.home-placeholder::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 55%;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.62));
}

.home-media-frame::before,
.home-media-frame::after,
.home-placeholder::before,
.home-placeholder::after {
  z-index: 1;
}

.home-media-frame span,
.home-media-frame strong,
.home-placeholder span {
  position: relative;
  z-index: 2;
}

.home-media-frame span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.home-media-frame strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 22px;
}

.home-media-frame {
  padding: 20px;
}

.home-media-frame-large {
  aspect-ratio: 16 / 9;
}

.home-media-frame-square {
  aspect-ratio: 1 / 1;
}

.home-media-frame-vertical {
  aspect-ratio: 9 / 16;
}

.home-section {
  display: grid;
  justify-items: center;
  gap: 34px;
  border-bottom: 1px solid var(--border);
}

.home-section-head {
  width: min(100%, var(--layout-max-width));
  display: grid;
  gap: 10px;
  text-align: center;
  justify-items: center;
}

.home-section-head h2,
.home-benefit-copy h2,
.home-pricing-panel h2,
.home-final-cta h2 {
  max-width: 780px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.home-section-head p,
.home-benefit-copy p,
.home-pricing-panel p,
.home-final-cta p {
  max-width: 720px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.75;
}

.home-showcase-grid,
.home-workflow-grid {
  width: min(100%, var(--layout-max-width));
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.home-showcase-card,
.home-step {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.home-showcase-card h3,
.home-step h3 {
  font-size: 18px;
}

.home-showcase-card p,
.home-step p,
.home-benefit-list span {
  color: var(--text-secondary);
  line-height: 1.65;
}

.home-placeholder {
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 18px;
  color: var(--text-secondary);
  font-weight: 800;
  text-align: center;
  isolation: isolate;
}

.home-placeholder span {
  position: relative;
  z-index: 2;
}

.home-placeholder-video {
  aspect-ratio: 16 / 9;
}

.home-placeholder-square {
  aspect-ratio: 1 / 1;
}

.home-placeholder-portrait {
  aspect-ratio: 4 / 5;
}

.home-workflow-section {
  background: var(--bg-subtle);
}

.home-step span {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(34,197,94,0.24);
  border-radius: var(--radius-sm);
  color: #86efac;
  background: rgba(34,197,94,0.1);
  font-weight: 800;
}

.home-benefit-section {
  width: 100%;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  align-items: start;
  gap: 44px;
  margin: 0 auto;
}

.home-benefit-copy {
  display: grid;
  gap: 14px;
}

.home-benefit-list {
  display: grid;
  gap: 12px;
  width: 100%;
}

.home-benefit-list div {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.home-benefit-list strong {
  font-size: 15px;
}

.home-pricing-section {
  background:
    linear-gradient(90deg, rgba(59,130,246,0.08), transparent 34%),
    linear-gradient(270deg, rgba(245,158,11,0.07), transparent 36%),
    var(--bg-base);
}

.home-pricing-panel {
  width: min(100%, 900px);
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.home-final-cta {
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
  background: var(--bg-subtle);
}

/* ─── FORMS: INPUTS, SELECT, TEXTAREA ─── */
input, textarea, select {
  font: inherit;
  font-size: 14px;
}

input, textarea, select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px var(--primary-muted);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23606070' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

textarea { resize: vertical; min-height: 80px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* Django form.as_p styling */
form p {
  margin: 0 0 16px;
}

form p label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

form p .helptext {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

form p ul.errorlist {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

form p ul.errorlist li {
  color: #fca5a5;
  font-size: 12px;
}

/* ─── BUTTONS ─── */
button, .btn, .open-link, .icon-button {
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

button, .btn, .open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

/* Primary button */
button, .btn-primary, .open-link {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

button:hover, .btn-primary:hover, .open-link:hover {
  background: var(--primary-hover);
  color: white;
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139,92,246,0.3);
}

button:active, .btn-primary:active, .open-link:active {
  transform: translateY(0);
}

/* Secondary button */
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-hover);
}

.btn-secondary:hover {
  background: var(--bg-raised);
  border-color: var(--border-hover);
  color: var(--text);
}

/* Ghost button */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--bg-raised);
  color: var(--text);
}

/* Danger button */
.btn-danger, .icon-button.danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn-danger:hover, .icon-button.danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

/* Accent button */
.btn-accent {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
}

.btn-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Small button */
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* Icon button */
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  text-decoration: none;
  font-size: 14px;
}

.icon-button:hover {
  background: var(--bg-emphasis);
  color: var(--text);
  border-color: var(--border-hover);
}

/* ─── FORMS / CREATE ─── */
.create-form, .rename-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ─── CARDS ─── */
.card, .stat-card, .panel-card, .project-card, .blank-state, .empty-page,
.dashboard-list, .auth-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.project-card {
  padding: 20px;
  display: grid;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* ─── STATS GRID ─── */
.stats-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 20px;
}

.stat-card {
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

.stat-card p {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
}

/* ─── PROJECT GRID ─── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ─── TABLES ─── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

table tr:hover td {
  background: var(--bg-raised);
}

table tr:last-child td {
  border-bottom: none;
}

/* ─── BADGES ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-primary { background: var(--primary-muted); color: var(--primary-hover); }
.badge-success { background: var(--success-muted); color: var(--success); }
.badge-warning { background: var(--warning-muted); color: var(--warning); }
.badge-danger { background: var(--danger-muted); color: var(--danger); }
.badge-info { background: var(--info-muted); color: var(--info); }

/* ─── EMPTY STATES ─── */
.empty-page, .blank-state {
  padding: 48px 32px;
  text-align: center;
}

.empty-page h1, .empty-page h2, .blank-state h2 {
  margin-bottom: 8px;
}

.empty-page p, .blank-state p {
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ─── CREDIT CHIP ─── */
.credit-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1px solid rgba(139,92,246,0.3);
  background: var(--primary-muted);
  color: var(--primary-hover);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

/* ─── ERROR TEXT ─── */
.error { color: #fca5a5; margin: 0; font-size: 13px; }

/* ─── AUTH PAGES ─── */
.auth-card {
  max-width: 440px;
  margin: 8vh auto 0;
  padding: 40px 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
}

.auth-card-wide {
  max-width: 500px;
}

.auth-header {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
  text-align: center;
}

.auth-header p {
  color: var(--text-muted);
}

.form-row {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.form-help {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.form-errors {
  margin: 0 0 14px;
  color: #fca5a5;
  font-size: 12px;
}

.auth-consent-row {
  margin-top: 2px;
}

.auth-consent-label {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.auth-consent-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--primary);
}

.auth-consent-label a {
  color: var(--primary);
  font-weight: 600;
}

.auth-card h1 {
  text-align: center;
  margin-bottom: 8px;
  font-size: 1.5rem;
}

.auth-card .auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 14px;
}

.auth-card form button[type="submit"] {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  font-size: 15px;
  border-radius: var(--radius-md);
}

.auth-link {
  text-align: center;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-link a {
  color: var(--primary);
  font-weight: 600;
}

.auth-link a:hover {
  color: var(--primary-hover);
}

.account-shell {
  display: grid;
  gap: 24px;
  max-width: 1100px;
}

.account-hero {
  display: grid;
  gap: 10px;
  padding: 28px 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background:
    radial-gradient(circle at top right, rgba(139,92,246,0.16), transparent 28%),
    radial-gradient(circle at left bottom, rgba(245,158,11,0.12), transparent 22%),
    var(--bg-surface);
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
}

.account-hero p:last-child {
  color: var(--text-secondary);
  max-width: 62ch;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.account-card {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent), var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.account-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-details {
  display: grid;
  gap: 14px;
}

.account-details div {
  display: grid;
  gap: 4px;
}

.account-details dt {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.account-details dd {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.account-form {
  display: grid;
  gap: 18px;
}

.account-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
}

.account-toggle input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.account-toggle span {
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ─── DASHBOARD ─── */
.dashboard-shell {
  display: grid;
  gap: 24px;
  padding-bottom: 32px;
}

.dashboard-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  gap: 20px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background:
    radial-gradient(ellipse at 10% 20%, rgba(139,92,246,0.08), transparent 50%),
    radial-gradient(ellipse at 90% 80%, rgba(245,158,11,0.06), transparent 50%),
    var(--bg-surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.dashboard-hero-copy, .dashboard-hero-panel {
  position: relative;
  z-index: 1;
}

.dashboard-kicker, .dashboard-section-eyebrow,
.dashboard-stat-label, .dashboard-featured-label,
.dashboard-project-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}

.dashboard-kicker, .dashboard-section-eyebrow, .dashboard-featured-label {
  color: var(--accent);
}

.dashboard-hero-copy h1 {
  margin: 12px 0 0;
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.05;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dashboard-hero-copy p {
  margin: 16px 0 0;
  max-width: 55ch;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.dashboard-hero-actions, .dashboard-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-hero-actions { margin-top: 24px; }

.dashboard-primary-action, .dashboard-project-primary,
.dashboard-secondary-action, .dashboard-project-secondary,
.dashboard-inline-link {
  text-decoration: none;
}

.dashboard-primary-action, .dashboard-project-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(139,92,246,0.25);
  transition: all var(--transition-fast);
}

.dashboard-primary-action:hover, .dashboard-project-primary:hover {
  background: var(--primary-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(139,92,246,0.35);
}

.dashboard-secondary-action, .dashboard-project-secondary, .dashboard-inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-hover);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  transition: all var(--transition-fast);
}

.dashboard-secondary-action:hover, .dashboard-project-secondary:hover, .dashboard-inline-link:hover {
  background: var(--bg-raised);
  border-color: var(--border-hover);
  color: var(--text);
}

.dashboard-inline-link--compact {
  min-height: 32px;
  margin-top: 8px;
  padding: 0 12px;
  justify-self: start;
  font-size: 12px;
}

.dashboard-inline-button {
  appearance: none;
  cursor: pointer;
}

.dashboard-inline-button:hover {
  box-shadow: none;
}

/* Dashboard hero panel */
.dashboard-hero-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: rgba(9,9,11,0.6);
  backdrop-filter: blur(8px);
}

.dashboard-hero-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

.dashboard-hero-panel-head strong {
  color: var(--text);
  font-size: 14px;
}

.dashboard-hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-hero-metrics div, .dashboard-credit-card,
.dashboard-stat-card, .dashboard-project-card, .dashboard-section-card {
  border: 1px solid var(--border);
  background: var(--bg-surface);
}

.dashboard-hero-metrics div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: var(--radius-lg);
}

.dashboard-hero-metrics span, .dashboard-credit-card span {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.dashboard-hero-metrics strong, .dashboard-credit-card strong,
.dashboard-stat-card strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

/* Featured links */
.dashboard-featured-link, .dashboard-featured-empty {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: var(--radius-lg);
  text-decoration: none;
}

.dashboard-featured-link {
  border: 1px solid rgba(139,92,246,0.15);
  background: linear-gradient(180deg, rgba(139,92,246,0.06), transparent);
  transition: border-color var(--transition-fast);
}

.dashboard-featured-link:hover {
  border-color: rgba(139,92,246,0.3);
}

.dashboard-featured-link strong {
  color: var(--text);
  font-size: 16px;
}

.dashboard-featured-link span:last-child, .dashboard-featured-empty {
  color: var(--text-muted);
  font-size: 13px;
}

/* Stats row */
.dashboard-stat-row, .dashboard-main-grid, .dashboard-project-grid,
.dashboard-credit-stack, .dashboard-activity-list { display: grid; }

.dashboard-stat-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-stat-card {
  padding: 20px;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.dashboard-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
}

.dashboard-stat-card:nth-child(1)::before { background: var(--primary); }
.dashboard-stat-card:nth-child(2)::before { background: var(--accent); }
.dashboard-stat-card:nth-child(3)::before { background: var(--success); }
.dashboard-stat-card:nth-child(4)::before { background: var(--info); }

.dashboard-stat-card p, .dashboard-muted {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

/* Main grid */
.dashboard-main-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.78fr);
  gap: 20px;
  align-items: start;
}

.dashboard-section-card {
  padding: 24px;
  border-radius: var(--radius-2xl);
}

.dashboard-stack-card { display: grid; gap: 16px; }

.dashboard-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-section-head h2 {
  margin: 6px 0 0;
  font-size: 20px;
}

/* Project cards */
.dashboard-project-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.dashboard-project-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius-xl);
  transition: all var(--transition);
}

.dashboard-project-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-project-badge { color: var(--primary); }

.dashboard-project-top h3 {
  margin: 8px 0 0;
  font-size: 18px;
}

.dashboard-project-format {
  color: var(--text-muted);
  font-size: 12px;
}

.dashboard-project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dashboard-project-meta span {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-raised);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.dashboard-project-updated {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

/* Projects page */
.projects-shell { gap: 24px; }

.projects-hero {
  background:
    radial-gradient(ellipse at 10% 20%, rgba(139,92,246,0.06), transparent 40%),
    radial-gradient(ellipse at 90% 80%, rgba(245,158,11,0.08), transparent 40%),
    var(--bg-surface);
}

.projects-project-card {
  cursor: pointer;
  transition: all var(--transition);
}

.projects-project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139,92,246,0.2);
  box-shadow: var(--shadow-md);
}

.projects-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.projects-delete-form { margin: 0; }

.projects-delete-button {
  background: transparent !important;
  color: var(--danger) !important;
  border-color: rgba(239,68,68,0.3) !important;
  font-size: 13px !important;
}

.projects-delete-button:hover {
  background: var(--danger-muted) !important;
}

.projects-empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-xl);
  background: transparent;
}

/* Credit cards and activity */
.dashboard-credit-stack { gap: 12px; }

.dashboard-credit-card {
  padding: 16px;
  border-radius: var(--radius-lg);
}

.dashboard-credit-card-large strong { font-size: 28px; }

.dashboard-activity-list {
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.dashboard-activity-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.dashboard-activity-mark {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

.dashboard-activity-copy strong {
  color: var(--text);
  font-size: 13px;
}

.dashboard-activity-copy p, .dashboard-activity-copy span {
  display: block;
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.dashboard-empty-state {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 28px;
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-xl);
  background: transparent;
}

.dashboard-credit-modal[hidden] {
  display: none;
}

.dashboard-credit-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
}

body.dashboard-credit-modal-open {
  overflow: hidden;
}

.dashboard-credit-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 10, 0.72);
  backdrop-filter: blur(10px);
}

.dashboard-credit-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius-2xl);
  background:
    radial-gradient(circle at top right, rgba(139,92,246,0.14), transparent 32%),
    radial-gradient(circle at bottom left, rgba(245,158,11,0.1), transparent 24%),
    var(--bg-surface);
  box-shadow: var(--shadow-xl);
}

.dashboard-credit-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  font-size: 24px;
  line-height: 1;
  box-shadow: none;
}

.dashboard-credit-modal-close:hover {
  background: var(--bg-raised);
  color: var(--text);
  border-color: var(--border-hover);
}

.dashboard-credit-modal-head {
  display: grid;
  gap: 8px;
  padding-right: 28px;
}

.dashboard-credit-modal-kicker {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
}

.dashboard-credit-modal-head p,
.dashboard-credit-note {
  color: var(--text-secondary);
  line-height: 1.65;
}

.dashboard-credit-form {
  display: grid;
  gap: 14px;
}

.dashboard-credit-label {
  margin-bottom: 0;
}

.dashboard-credit-input {
  height: 52px;
  padding: 0 16px;
  font-size: 18px;
  font-weight: 700;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.03);
}

.dashboard-credit-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: var(--radius-lg);
  background: rgba(139,92,246,0.08);
}

.dashboard-credit-summary span {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.dashboard-credit-summary strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
}

.dashboard-credit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-credit-cancel {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-weight: 600;
  box-shadow: none;
}

.dashboard-credit-cancel:hover {
  background: var(--bg-raised);
  border-color: var(--border-hover);
}

.dashboard-credit-submit {
  min-height: 44px;
}

.dashboard-empty-state h3 { font-size: 18px; }
.dashboard-empty-state p { color: var(--text-muted); line-height: 1.7; }

/* ─── STORY SETUP WIZARD ─── */
.wizard-steps {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.wizard-step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg-emphasis);
  font-size: 12px;
  font-weight: 700;
}

.wizard-step.active .wizard-step-number {
  background: var(--primary);
  color: white;
}

.wizard-step.active { color: var(--text); }

.wizard-step.completed .wizard-step-number {
  background: var(--success);
  color: white;
}

.wizard-connector {
  width: 48px;
  height: 2px;
  align-self: center;
  background: var(--bg-emphasis);
  border-radius: 1px;
}

.wizard-connector.completed {
  background: var(--success);
}

/* ─── CREDENTIALS PAGE ─── */
.credentials-card {
  max-width: 580px;
  margin: 4vh auto 0;
}

/* ─── PLANS PAGE ─── */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  max-width: 1440px;
  margin: 0 auto;
  align-items: stretch;
  justify-items: stretch;
}

.plan-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 24px 22px;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
  transition: all var(--transition);
  height: 100%;
  min-height: 100%;
}

.plan-card.featured {
  border-color: rgba(139,92,246,0.3);
  background: linear-gradient(180deg, rgba(139,92,246,0.06), var(--bg-surface));
  box-shadow: 0 0 40px rgba(139,92,246,0.08);
}

.plan-price {
  font-family: var(--font-display);
  font-size: 2em;
  font-weight: 800;
  white-space: nowrap;
}

.plan-features {
  text-align: left;
  display: grid;
  gap: 10px;
}

.plan-features--core {
  flex: 0 0 auto;
}

.plan-features--extra {
  flex: 1 1 auto;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.plan-features li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
}

.plan-action {
  margin-top: auto;
}

/* ─── CONTACT PAGE ─── */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  max-width: 900px;
  margin: 0 auto;
}

.contact-form {
  display: grid;
  gap: 16px;
}

.contact-info {
  display: grid;
  gap: 20px;
  align-content: start;
}

.contact-info-item {
  display: grid;
  gap: 6px;
}

.contact-info-item strong {
  font-size: 14px;
}

.contact-info-item p {
  color: var(--text-muted);
  font-size: 13px;
}

/* ─── PANEL WORKSPACE (Legacy boards) ─── */
.panel-workspace {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  align-items: start;
}

.panel-card {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.panel-add { min-height: 130px; align-content: center; }
.panel-head { display: flex; justify-content: space-between; align-items: center; }

/* Legacy blueprint */
.panel-blueprint {
  width: 295px;
  height: 225px;
  border: 1px solid var(--border-hover);
  padding: 3px;
  background: var(--bg-raised);
  display: grid;
  grid-template-columns: 80% 20%;
  gap: 2px;
  border-radius: var(--radius-md);
}

.panel-main-column {
  display: grid;
  grid-template-rows: 60% 30% 10%;
  height: 100%;
  gap: 2px;
}

.panel-holder {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  overflow: hidden;
}

.holder-nav {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,0.5);
  border-radius: var(--radius-md);
  padding: 2px 6px;
}

.generated-count {
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.panel-media-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-media-stage img, .panel-media-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.holder-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 10px;
  font-size: 11px;
}

.panel-meta-form {
  background: var(--bg-emphasis);
  border: 1px solid var(--border);
  padding: 4px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 4px;
  border-radius: var(--radius-sm);
}

.panel-meta-form textarea {
  width: 100%;
  resize: none;
  height: 100%;
  min-height: 28px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  padding: 4px 6px;
}

.meta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.meta-row select, .meta-row input {
  padding: 2px 4px;
  font-size: 10px;
  border-radius: var(--radius-xs);
  min-width: 0;
}

.panel-icons-row {
  background: var(--bg-emphasis);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
}

.mini-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--primary);
  background: var(--bg-raised);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  padding: 0;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mini-icon:hover {
  background: var(--primary-muted);
}

.panel-side-column {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.upload-form { padding: 2px; }

.upload-input.compact {
  width: 100%;
  height: 22px;
  font-size: 8px;
  padding: 0;
  border-radius: 3px;
}

.uploaded-strip {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  padding: 2px;
}

.uploaded-strip img, .uploaded-strip video {
  width: 100%;
  height: 38px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 2px;
}

.side-placeholder { width: 100%; height: 100%; min-height: 38px; }

/* ─── FOOTER ─── */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

.footer-inner {
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: 32px 28px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 16px 40px;
  align-items: center;
}

.footer-brand-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.footer-brand-mark {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  opacity: 0.85;
}

.footer-tagline {
  font-size: 12px;
  color: var(--text-muted);
  padding-left: 25px;
}

.footer-legal-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 20px;
  justify-content: flex-end;
}

.footer-legal-nav a {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.footer-legal-nav a:hover {
  color: var(--primary);
}

.footer-copy {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

@media (max-width: 640px) {
  .footer-inner {
    grid-template-columns: 1fr;
    padding: 24px 20px 20px;
  }
  .footer-legal-nav {
    justify-content: flex-start;
    gap: 4px 14px;
  }
}

/* ──────────────────────────────────────────────────────────────────
   STAFF ADMIN PANEL
   ────────────────────────────────────────────────────────────────── */

/* Staff layout */
.staff-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.staff-sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 28px 20px;
  background:
    radial-gradient(ellipse at top left, rgba(139,92,246,0.08), transparent 60%),
    var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.staff-sidebar h2 {
  margin: 0 0 6px;
  font-size: 1.3rem;
}

.staff-sidebar p {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.staff-nav {
  display: grid;
  gap: 6px;
}

.staff-nav a {
  display: flex;
  align-items: center;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.staff-nav a:hover {
  background: var(--bg-raised);
  color: var(--text);
  border-color: var(--border);
  transform: translateX(2px);
}

.staff-nav a.active {
  background: var(--primary-muted);
  color: var(--primary-hover);
  border-color: rgba(139,92,246,0.2);
}

.staff-main {
  display: grid;
  gap: 28px;
}

/* Staff section cards */
.staff-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  background: var(--bg-surface);
}

.staff-section h1, .staff-section h2 {
  margin-bottom: 20px;
}

.staff-section h1 {
  font-size: 1.5rem;
}

/* Staff dashboard stat cards */
.staff-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.staff-stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: var(--bg-surface);
  position: relative;
  overflow: hidden;
}

.staff-stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
}

.staff-stat-card:nth-child(1)::after { background: var(--primary); }
.staff-stat-card:nth-child(2)::after { background: var(--accent); }
.staff-stat-card:nth-child(3)::after { background: var(--success); }
.staff-stat-card:nth-child(4)::after { background: var(--info); }
.staff-stat-card:nth-child(5)::after { background: var(--warning); }
.staff-stat-card:nth-child(6)::after { background: var(--danger); }

.staff-stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.staff-stat-card .stat-label {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
}

/* Staff activity */
.staff-activity-list {
  display: grid;
  gap: 10px;
}

.staff-activity-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  font-size: 13px;
  align-items: center;
}

.staff-activity-item .activity-time {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

/* Staff forms */
.staff-form {
  display: grid;
  gap: 16px;
  max-width: 640px;
}

.staff-form button[type="submit"] {
  justify-self: start;
}

/* Staff list items */
.staff-list {
  display: grid;
  gap: 8px;
}

.staff-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  flex-wrap: wrap;
}

.staff-list-item form {
  display: inline-flex;
}

.staff-list-item form button {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* Staff settings (previously inline) */
.staff-settings-page {
  min-height: calc(100vh - 96px);
  padding: 24px 0 48px;
}

.staff-settings-frame {
  display: grid;
  gap: 28px;
}

.staff-settings-topline {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-hover), transparent);
}

.staff-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  align-items: start;
}

.settings-column {
  display: grid;
  gap: 22px;
}

.settings-heading {
  margin: 0;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.settings-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
}

.settings-form {
  display: grid;
  gap: 24px;
}

.settings-subsection {
  display: grid;
  gap: 20px;
}

.settings-subheading {
  margin: 0;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-display);
}

.settings-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
}

.settings-field {
  display: grid;
  gap: 6px;
  align-content: start;
}

.settings-field--full {
  grid-column: 1 / -1;
}

.settings-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.settings-help {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.settings-help code {
  font-size: 12px;
  color: var(--text-secondary);
}

.settings-input, .settings-select, .settings-textarea,
.settings-field input, .settings-field select, .settings-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  min-height: 40px;
  padding: 8px 12px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.settings-field input:focus, .settings-field select:focus, .settings-field textarea:focus {
  outline: none;
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px var(--primary-muted);
}

.settings-textarea, .settings-field textarea {
  min-height: 100px;
  resize: vertical;
}

.settings-action-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 4px;
}

.settings-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
}

.settings-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.settings-submit {
  min-width: 160px;
  min-height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--primary);
  background: var(--primary);
  color: white;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.settings-submit:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139,92,246,0.3);
}

.settings-errors {
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--danger-muted);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  list-style: none;
}

.settings-note {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.settings-hidden {
  display: none;
}

/* Staff statistics */
.staff-chart-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  background: var(--bg-surface);
}

.staff-chart-section h2 {
  margin: 0 0 16px;
  text-transform: capitalize;
  font-size: 1.1rem;
}

.staff-chart-section h3 {
  margin: 12px 0 8px;
  text-transform: capitalize;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.staff-chart-row {
  display: grid;
  grid-template-columns: 120px 1fr 60px;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.staff-chart-bar {
  height: 8px;
  background: var(--bg-emphasis);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.staff-chart-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.staff-chart-value {
  text-align: right;
  font-weight: 600;
  color: var(--text);
}

/* ─── UTILITIES ─── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* Form utilities */
.form-group {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.btn-block {
  width: 100%;
  display: flex;
  justify-content: center;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Badge variants */
.badge-muted {
  background: var(--bg-emphasis);
  color: var(--text-muted);
}

/* Auth headers */
.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-header h1 {
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Wizard page wrapper */
.wizard-page {
  max-width: 680px;
  margin: 0 auto;
}

.wizard-header {
  text-align: center;
  margin-bottom: 28px;
}

.wizard-header h1 {
  margin-bottom: 8px;
}

.wizard-header p {
  color: var(--text-muted);
  font-size: 14px;
}

.wizard-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg-emphasis);
  font-size: 12px;
  font-weight: 700;
}

.wizard-step.active .wizard-step-num {
  background: var(--primary);
  color: white;
}

.wizard-step.completed .wizard-step-num {
  background: var(--success);
  color: white;
}

/* ═══════════════════════════════════════════════════════
   TRANSACTIONS PAGE
   ═══════════════════════════════════════════════════════ */

.txn-page {
  display: grid;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: 48px;
}

/* ── Header ── */
.txn-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.txn-header-left { display: grid; gap: 4px; }

.txn-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 8px;
  transition: color var(--transition-fast);
}
.txn-breadcrumb:hover { color: var(--text-secondary); }

.txn-header-sub {
  color: var(--text-muted);
  font-size: 14px;
}

.txn-balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid rgba(139,92,246,0.3);
  background: var(--primary-muted);
  color: var(--primary-hover);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 30px;
}

/* ── Wallet strip ── */
.txn-wallet-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.txn-wallet-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  transition: border-color var(--transition-fast);
}
.txn-wallet-card:hover { border-color: var(--border-hover); }

.txn-wallet-card--total {
  border-color: rgba(139,92,246,0.2);
  background: linear-gradient(135deg, rgba(139,92,246,0.07), var(--bg-surface));
}

.txn-wallet-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.txn-wallet-icon--included  { background: var(--primary-muted);  color: var(--primary-hover); }
.txn-wallet-icon--purchased { background: var(--info-muted);     color: var(--info); }
.txn-wallet-icon--bonus     { background: var(--accent-muted);   color: var(--accent); }
.txn-wallet-icon--total     { background: linear-gradient(135deg, var(--primary-muted), var(--accent-muted)); color: var(--primary-hover); }

.txn-wallet-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.txn-wallet-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

/* ── Section card ── */
.txn-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  overflow: hidden;
}

.txn-section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.txn-section-head h2 {
  font-size: 1rem;
  margin-bottom: 2px;
}

.txn-section-head p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.txn-section-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.txn-icon--subscription { background: var(--primary-muted);  color: var(--primary-hover); }
.txn-icon--purchase     { background: var(--info-muted);     color: var(--info); }
.txn-icon--bonus        { background: var(--accent-muted);   color: var(--accent); }
.txn-icon--usage        { background: var(--success-muted);  color: var(--success); }

.txn-section-count {
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-raised);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Subscription inner layout ── */
.txn-subscription-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.txn-subscription-info {
  padding: 24px;
}

.txn-plan-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.txn-plan-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 20px;
}
.txn-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.txn-plan-status--active    { background: var(--success-muted); color: var(--success); }
.txn-plan-status--cancelled { background: var(--danger-muted);  color: var(--danger); }
.txn-plan-status--expired   { background: var(--warning-muted); color: var(--warning); }

.txn-plan-dates { display: grid; gap: 10px; }

.txn-plan-date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.txn-plan-date-row:last-child { border-bottom: none; }
.txn-plan-date-label { color: var(--text-muted); }
.txn-plan-date-value { color: var(--text-secondary); font-weight: 500; }

/* ── Credit balances panel ── */
.txn-balances {
  padding: 24px;
  border-left: 1px solid var(--border);
  display: grid;
  gap: 10px;
  align-content: start;
}

.txn-balances-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.txn-balance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  gap: 10px;
}
.txn-balance-row--total {
  border-color: rgba(139,92,246,0.25);
  background: linear-gradient(135deg, rgba(139,92,246,0.07), var(--bg-raised));
}

.txn-balance-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.txn-balance-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.txn-balance-dot--included  { background: var(--primary); }
.txn-balance-dot--purchased { background: var(--info); }
.txn-balance-dot--bonus     { background: var(--accent); }
.txn-balance-dot--total     { background: var(--success); }

.txn-balance-amount {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.txn-balance-amount--total {
  background: linear-gradient(90deg, var(--primary-hover), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 18px;
}

/* ── Renewal history sub-section ── */
.txn-renewal-history { border-top: 1px solid var(--border); }

.txn-sub-table-head {
  padding: 12px 24px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

/* ── Table ── */
.txn-table-wrap { overflow-x: auto; }

.txn-history-card {
  display: flex;
  flex-direction: column;
  height: 520px;
  max-height: 520px;
}

.txn-history-card .txn-section-head {
  flex-shrink: 0;
}

.txn-table-wrap--scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.txn-table-wrap--scroll .txn-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.txn-history-card .txn-empty {
  flex: 1 1 auto;
  display: grid;
  place-content: center;
}

.txn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.txn-table th {
  text-align: left;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  white-space: nowrap;
}

.txn-table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

.txn-table tr:last-child td { border-bottom: none; }
.txn-table tr:hover td { background: var(--bg-raised); }

/* ── Amounts ── */
.txn-amount {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}
.txn-amount--debit  { color: var(--danger); }
.txn-amount--credit { color: var(--success); }
.txn-amount--bonus  { color: var(--accent); }

/* ── Type + balance badges ── */
.txn-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.txn-type-badge--debit    { background: var(--danger-muted);  color: var(--danger); }
.txn-type-badge--refund   { background: var(--success-muted); color: var(--success); }
.txn-type-badge--purchase { background: var(--info-muted);    color: var(--info); }
.txn-type-badge--renewal  { background: var(--primary-muted); color: var(--primary-hover); }
.txn-type-badge--manual   { background: var(--warning-muted); color: var(--warning); }
.txn-type-badge--bonus    { background: var(--accent-muted);  color: var(--accent); }

.txn-balance-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg-raised);
}
.txn-balance-badge--included  { color: var(--primary-hover); border-color: rgba(139,92,246,0.3); background: var(--primary-muted); }
.txn-balance-badge--purchased { color: var(--info);          border-color: rgba(59,130,246,0.3); background: var(--info-muted); }
.txn-balance-badge--bonus     { color: var(--accent);        border-color: rgba(245,158,11,0.3); background: var(--accent-muted); }

/* ── Reason / ref labels ── */
.txn-reason-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.txn-reason-cell {
  color: var(--text);
  font-weight: 500;
}

.txn-ref-type {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.txn-ref-id, .txn-meta-project {
  display: inline;
  font-size: 11px;
  color: var(--text-muted);
  margin-right: 6px;
}
.txn-ref-none { color: var(--text-muted); }

.txn-date {
  white-space: nowrap;
  font-size: 12px;
  text-align: right;
  color: var(--text-muted);
}

/* ── Usage section summary ── */
.txn-usage-summary {
  margin-left: auto;
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}
.txn-usage-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.txn-usage-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.txn-usage-stat strong {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

/* ── Empty state ── */
.txn-empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.txn-empty a { color: var(--primary); font-weight: 600; }

/* ── Pagination ── */
.txn-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.txn-pagination a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
}
.txn-pagination a:hover {
  background: var(--bg-raised);
  color: var(--text);
}
.txn-pagination span {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Two-col grid (Purchases + Bonus) ── */
.txn-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .txn-wallet-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .txn-subscription-grid { grid-template-columns: 1fr; }
  .txn-balances { border-left: none; border-top: 1px solid var(--border); }
  .txn-two-col  { grid-template-columns: 1fr; }
  .txn-usage-summary { display: none; }
  .txn-wallet-strip  { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .txn-header      { flex-direction: column; }
  .txn-balance-pill { margin-top: 0; }
  .txn-wallet-strip { grid-template-columns: 1fr 1fr; }
  .txn-wallet-value { font-size: 1.3rem; }
}

/* ── Date filter bar ── */
.txn-date-filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.txn-date-filter-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.txn-date-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.txn-date-filter-group label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0;
}

.txn-date-filter-group input[type="date"] {
  width: auto;
  min-width: 140px;
  padding: 7px 12px;
  font-size: 13px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  color: var(--text);
  cursor: pointer;
  color-scheme: dark;
}

.txn-date-filter-group input[type="date"]:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px var(--primary-muted);
  outline: none;
}

.txn-date-apply {
  align-self: flex-end;
  white-space: nowrap;
}

.txn-date-reset {
  align-self: flex-end;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-muted);
}

.txn-date-range-label {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.txn-date-range-label strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.txn-date-error {
  width: 100%;
  font-size: 12px;
  color: var(--danger);
  padding: 4px 0;
}

/* ── Project & shot-card cells ── */
.txn-project-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.txn-project-deleted {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  font-style: italic;
}

.txn-shot-card {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-emphasis);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
  letter-spacing: 0.02em;
}

.txn-ref-type-fallback {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Cancel subscription UI ── */
.txn-cancel-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  margin-bottom: 16px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.txn-cancel-notice svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent);
}

.txn-cancel-notice strong {
  color: var(--text);
}

.txn-cancel-action {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.txn-cancel-btn {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--danger) 50%, transparent);
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.txn-cancel-btn:hover {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border-color: var(--danger);
}

/* Cancelled status pill */
.txn-plan-status--cancelled {
  color: var(--accent);
}

.txn-plan-status--cancelled .txn-status-dot {
  background: var(--accent);
}
  color: white;
}

.wizard-step-line {
  width: 48px;
  height: 2px;
  align-self: center;
  background: var(--bg-emphasis);
  border-radius: 1px;
}

/* Contact page */
.contact-page, .plans-page {
  max-width: 900px;
  margin: 0 auto;
}

.contact-header, .plans-header {
  text-align: center;
  margin-bottom: 32px;
}

.contact-header h1, .plans-header h1 {
  margin-bottom: 8px;
}

.contact-info-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  background: var(--bg-surface);
  display: grid;
  gap: 8px;
}

.contact-info-card h3 {
  font-size: 16px;
}

.contact-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.contact-link:hover {
  color: var(--primary-hover);
}

/* Plans page */
.plan-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.plan-featured {
  border-color: rgba(139,92,246,0.3);
  background: linear-gradient(180deg, rgba(139,92,246,0.06), var(--bg-surface));
  box-shadow: 0 0 40px rgba(139,92,246,0.08);
}

.plan-featured .plan-badge {
  color: var(--primary);
}

/* Staff stat grid */
.staff-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.staff-stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  display: block;
}

.staff-stat-label {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
  display: block;
}

.staff-stat-highlight {
  border-color: rgba(139,92,246,0.25);
  background: linear-gradient(135deg, rgba(139,92,246,0.06), var(--bg-surface));
}

/* Staff form card */
.staff-form-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--bg-raised);
  margin-top: 16px;
}

/* Staff list items - extended */
.staff-list-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.staff-list-empty {
  padding: 16px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* Staff activity variants */
.staff-activity-item {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  font-size: 13px;
  align-items: center;
}

.staff-activity-time {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

.staff-activity-actor {
  color: var(--text);
  font-weight: 600;
}

.staff-activity-action {
  color: var(--text-secondary);
}

.staff-activity-target {
  color: var(--text-muted);
  font-size: 12px;
}

.staff-activity-empty {
  padding: 16px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* Staff chart containers */
.staff-chart-container {
  display: grid;
  gap: 20px;
}

.staff-chart-period {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--bg-surface);
}

.staff-chart-period h2 {
  margin: 0 0 16px;
  text-transform: capitalize;
  font-size: 1.1rem;
}

.staff-chart-metric {
  margin-bottom: 16px;
}

.staff-chart-metric h3 {
  margin: 8px 0 6px;
  text-transform: capitalize;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.staff-chart-label {
  color: var(--text-secondary);
  font-size: 12px;
}

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ─── ANIMATIONS ─── */
@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Page entrance animation */
.shell, .staff-shell {
  animation: fadeIn 0.3s ease;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1100px) {
  .dashboard-hero, .dashboard-main-grid {
    grid-template-columns: 1fr;
  }
  .home-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 56px;
  }
  .home-hero-media {
    justify-self: stretch;
    width: 100%;
  }
  .home-benefit-section {
    grid-template-columns: 1fr;
  }
  .account-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .staff-shell {
    grid-template-columns: 1fr;
  }
  .staff-sidebar {
    position: static;
  }
  .staff-settings-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .topbar {
    height: 56px;
    padding: 0 16px;
  }

  .nav {
    display: none;
    position: fixed;
    inset: 0;
    top: 56px;
    background: var(--bg-base);
    flex-direction: column;
    padding: 20px;
    gap: 4px;
    z-index: 90;
    border-top: 1px solid var(--border);
  }

  .nav.nav-open {
    display: flex;
  }

  .nav a {
    padding: 12px 16px;
    font-size: 15px;
    border-radius: var(--radius-md);
  }

  .nav-toggle {
    display: flex;
  }

  .user-menu { display: none; }

  .shell {
    padding: 20px 16px 32px;
  }

  .home-hero,
  .home-section,
  .home-final-cta {
    padding: 46px 16px;
  }

  .home-hero {
    min-height: auto;
  }

  .home-hero h1 {
    font-size: 2.7rem;
  }

  .home-hero-copy p {
    font-size: 16px;
  }

  .home-showcase-grid,
  .home-workflow-grid {
    grid-template-columns: 1fr;
  }

  .home-media-row {
    grid-template-columns: 1fr 0.7fr;
  }

  .dashboard-shell { gap: 16px; }

  .dashboard-hero, .dashboard-section-card, .dashboard-stat-card {
    padding: 20px;
  }

  .dashboard-stat-row, .dashboard-hero-metrics, .dashboard-project-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-section-head, .dashboard-project-top {
    flex-direction: column;
  }

  .page-head {
    flex-direction: column;
  }

  .auth-card {
    margin: 4vh 16px 0;
    padding: 28px 20px;
  }

  .account-hero,
  .account-card {
    padding: 20px;
  }

  .settings-field-grid {
    grid-template-columns: 1fr;
  }

  .form-row-2 {
    grid-template-columns: 1fr;
  }

  .staff-stats-grid, .staff-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .staff-section {
    padding: 20px 16px;
  }

  .plans-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .brand {
    font-size: 1rem;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 7px;
  }

  h1 { font-size: 1.5rem; }

  .home-hero h1 {
    font-size: 2.25rem;
  }

  .home-hero-actions .btn {
    width: 100%;
  }

  .home-media-row {
    grid-template-columns: 1fr;
  }

  .home-media-frame strong {
    font-size: 18px;
  }

  .dashboard-hero-copy h1 {
    font-size: 1.6rem;
  }

  .staff-stats-grid, .staff-stat-grid {
    grid-template-columns: 1fr;
  }
}
