:root {
  --brand-primary: #b8c8ff;
  --brand-secondary: #d7c6ff;
  --brand-accent: #bfe7dd;
  --bg: #f8f6fb;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: #ffffff;
  --surface-soft: #f7f6fd;
  --text: #3f4254;
  --heading: #2e3140;
  --muted: #7c8398;
  --border: rgba(188, 194, 214, 0.42);
  --success: #4f9f82;
  --warning: #c89a4b;
  --danger: #c76b7f;
  --shadow: 0 10px 30px rgba(115, 114, 157, 0.10);
  --shadow-soft: 0 8px 24px rgba(173, 168, 208, 0.10);
  --radius: 22px;
  --radius-sm: 14px;
  --max-width: 1480px;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Montserrat Alternates", Inter, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(215, 198, 255, 0.22), transparent 30%),
    radial-gradient(circle at top right, rgba(184, 200, 255, 0.18), transparent 32%),
    radial-gradient(circle at bottom left, rgba(191, 231, 221, 0.18), transparent 28%),
    linear-gradient(180deg, #fbfaff 0%, #f6f4fb 100%);
  color: var(--text);
}

a {
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(252, 249, 255, 0.92)),
    linear-gradient(135deg, rgba(184, 200, 255, 0.15), rgba(215, 198, 255, 0.15));
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 4px 14px;
  color: var(--heading);
}

.brand-logo,
.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(184, 200, 255, 0.42), rgba(215, 198, 255, 0.55));
  color: var(--heading);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.brand-text h1 {
  margin: 0;
  color: var(--heading);
  font-size: 18px;
  line-height: 1.2;
}

.brand-text p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-label {
  margin-bottom: 4px;
  padding-left: 6px;
  color: #9aa0b4;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar .nav-link {
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--text);
  font-size: 15px;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: linear-gradient(135deg, rgba(184, 200, 255, 0.25), rgba(215, 198, 255, 0.28));
  color: var(--heading);
  transform: translateX(2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(14px);
}

.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar-title h2 {
  margin: 0;
  color: var(--heading);
  font-size: 24px;
}

.topbar-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.content-shell,
.page-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px;
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.metric {
  min-height: 116px;
}

.meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.chat-log {
  max-height: 620px;
  overflow-y: auto;
}

.chat-message {
  white-space: pre-wrap;
}

.creative-preview {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
  background: #e9e7f1;
}

.video-brief {
  white-space: pre-wrap;
  font: inherit;
  color: var(--text);
  background: rgba(247, 246, 253, 0.72);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.copy-text {
  white-space: pre-line;
}

.btn {
  border-radius: 14px;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  --bs-btn-bg: transparent;
  --bs-btn-border-color: transparent;
  --bs-btn-hover-bg: transparent;
  --bs-btn-hover-border-color: transparent;
  background: linear-gradient(135deg, #c8b8ff, #b7cbff);
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #2f3140;
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #bdaeff, #aabfff);
  color: #2f3140;
}

.btn-outline-primary,
.btn-outline-secondary {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover {
  border-color: rgba(184, 200, 255, 0.7);
  background: rgba(255, 255, 255, 0.92);
  color: var(--heading);
}

.form-control,
.form-select {
  border-radius: 14px;
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

.form-control:focus,
.form-select:focus {
  border-color: #c8b8ff;
  box-shadow: 0 0 0 0.2rem rgba(200, 184, 255, 0.22);
}

.form-label {
  color: var(--muted);
  font-weight: 700;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(247, 246, 253, 0.65);
  --bs-table-hover-bg: rgba(240, 237, 255, 0.75);
  border-color: var(--border);
  color: var(--text);
}

.table thead th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge {
  border-radius: 999px;
  font-weight: 700;
}

.badge-soft {
  background: #f0edff;
  color: #6a63a8;
  border: 1px solid rgba(200, 184, 255, 0.48);
}

.alert {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }
}

@media (max-width: 820px) {
  .content-shell,
  .page-shell,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }
}
