:root {
  --bg: #eef2f7;
  --panel: rgba(255, 255, 255, 0.92);
  --line: rgba(31, 70, 136, 0.14);
  --text: #0d1626;
  --muted: #556172;
  --accent: #f1460a;
  --accent-dark: #c43806;
  --accent-soft: rgba(241, 70, 10, 0.12);
  --sea: #1f4688;
  --sea-soft: rgba(31, 70, 136, 0.1);
  --shadow: 0 20px 60px rgba(12, 22, 38, 0.1);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(31, 70, 136, 0.18), transparent 32%),
    radial-gradient(circle at bottom left, rgba(241, 70, 10, 0.16), transparent 26%),
    linear-gradient(180deg, #f7f9fc 0%, #edf2f7 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  min-height: 100vh;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.brand {
  display: inline-flex;
  gap: 14px;
  align-items: center;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
}

.brand-logo {
  width: 112px;
  height: auto;
  display: block;
}

.brand-logo-header {
  width: 116px;
  object-fit: contain;
}

.main-content {
  max-width: 1400px;
  margin: 0 auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.auth-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 24px;
  align-items: stretch;
}

.auth-layout-centered {
  min-height: calc(100vh - 220px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-panel,
.dashboard-grid > .panel,
.rail,
.editor-panel,
.group-panel {
  padding: 28px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--sea);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 3vw, 3.4rem);
  line-height: 1.05;
  margin-bottom: 16px;
}

h2 {
  font-size: 1.45rem;
  margin-bottom: 14px;
}

.auth-panel {
  width: min(100%, 460px);
  display: grid;
  gap: 16px;
  text-align: center;
}

.auth-logo {
  width: min(100%, 320px);
  height: auto;
  margin: 0 auto 8px;
  display: block;
  object-fit: contain;
}

.field,
.checkbox-row {
  display: grid;
  gap: 8px;
}

.field span:first-child {
  font-size: 0.95rem;
  font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="file"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
}

textarea {
  resize: vertical;
}

.stacked-form,
.editor-form,
.action-stack {
  display: grid;
  gap: 16px;
}

.primary-button,
.secondary-button,
.ghost-button,
.download-link {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), #f5a041);
  color: white;
  box-shadow: 0 12px 24px rgba(204, 92, 44, 0.26);
}

.secondary-button,
.download-link {
  background: var(--sea-soft);
  color: var(--sea);
}

.ghost-button {
  background: transparent;
  border: 1px solid var(--line);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.download-link:hover {
  transform: translateY(-1px);
}

.dashboard-grid,
.detail-grid {
  display: grid;
  gap: 24px;
}

.dashboard-grid {
  grid-template-columns: minmax(320px, 480px) 1fr;
}

.detail-grid {
  grid-template-columns: 340px 1fr;
  align-items: start;
}

.dossier-list {
  display: grid;
  gap: 14px;
}

.dossier-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.dossier-card p,
.muted,
.detail-header p {
  color: var(--muted);
}

.demo-counter {
  display: grid;
  gap: 4px;
  margin: 16px 0 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(31, 70, 136, 0.08);
  border: 1px solid var(--line);
}

.demo-counter strong {
  font-size: 1.8rem;
  color: var(--sea);
}

.demo-counter span,
.demo-counter small {
  color: var(--muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
  background: rgba(29, 107, 114, 0.12);
  color: var(--sea);
}

.status-analysis-error {
  background: rgba(162, 38, 38, 0.12);
  color: #a62626;
}

.status-generated {
  background: rgba(78, 122, 47, 0.14);
  color: #4e7a2f;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.back-link {
  color: var(--sea);
}

.message-box {
  min-height: 64px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px dashed var(--line);
  color: var(--muted);
}

.message-box.error {
  border-color: rgba(162, 38, 38, 0.35);
  color: #a62626;
}

.notes-box {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(31, 70, 136, 0.09), rgba(31, 70, 136, 0.03));
  color: var(--muted);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding: 18px 6px 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer a {
  color: var(--sea);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.group-panel {
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.62);
}

.editor-head {
  margin-bottom: 18px;
}

.error-banner {
  padding: 12px 14px;
  border-radius: 14px;
  color: #a62626;
  background: rgba(162, 38, 38, 0.12);
}

@media (max-width: 1080px) {
  .auth-layout,
  .dashboard-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .page-shell {
    padding: 16px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .detail-header {
    flex-direction: column;
    gap: 16px;
  }
}
