:root {
  --bg: #f2f4f7;
  --panel: #ffffff;
  --text: #1a1f2b;
  --muted: #5c6579;
  --border: #d6dbe6;
  --accent: #0f4cd1;
  --accent-strong: #0a37a0;
  --success-bg: #e8f8ef;
  --success-text: #1f7a45;
  --error-bg: #fdecec;
  --error-text: #9a1d2e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 10% -10%, #e5ecff 0%, var(--bg) 45%);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1180px, 92%);
  margin: 0 auto;
}

.site-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  backdrop-filter: blur(4px);
  z-index: 20;
}

.nav-row {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 14px;
  margin-left: 14px;
}

.nav-auth {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

.balance {
  font-size: 14px;
  color: var(--muted);
}

.page-content {
  padding: 28px 0 46px;
}

.hero {
  background: linear-gradient(115deg, #163988, #0e2557);
  color: #fff;
  border-radius: 20px;
  padding: 30px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 28px;
}

.hero.compact {
  padding: 24px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 38px);
}

.hero p {
  margin: 0;
  max-width: 780px;
  color: rgba(255, 255, 255, 0.9);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  margin: 26px 0 14px;
}

.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.collection-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--panel);
  color: inherit;
  display: block;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.collection-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(31, 48, 86, 0.09);
  text-decoration: none;
}

.collection-card img,
.placeholder-cover {
  width: 100%;
  height: 146px;
  object-fit: cover;
  display: block;
}

.placeholder-cover {
  background: linear-gradient(140deg, #bfd0ff, #e8efff);
}

.collection-meta {
  padding: 13px;
}

.collection-meta h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.collection-meta p {
  margin: 0 0 12px;
  color: var(--muted);
  min-height: 40px;
}

.collection-meta span {
  font-size: 13px;
  color: var(--muted);
}

.model-list {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
}

.model-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  gap: 16px;
  color: inherit;
}

.model-row:first-child {
  border-top: 0;
}

.model-row:hover {
  background: #f7f9ff;
  text-decoration: none;
}

.model-row p {
  margin: 6px 0 0;
  color: var(--muted);
}

.empty-state {
  background: var(--panel);
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 22px;
  color: var(--muted);
}

.btn {
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 14px;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

.btn:hover {
  background: var(--accent-strong);
  text-decoration: none;
}

.btn-secondary {
  background: #eaf0ff;
  color: #123b98;
}

.btn-secondary:hover {
  background: #d6e2ff;
}

.inline-form {
  margin: 0;
}

.stack-form {
  display: grid;
  gap: 12px;
  max-width: 520px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 11px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

textarea {
  resize: vertical;
}

.auth-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.two-col {
  display: grid;
  gap: 16px;
  grid-template-columns: 1.2fr 0.8fr;
}

.meta-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.meta-list span {
  color: var(--muted);
}

.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.package-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  padding: 16px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 10px;
  overflow: hidden;
}

.table th,
.table td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 10px;
  vertical-align: top;
}

.table th {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.table pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.flash {
  border-radius: 12px;
  padding: 11px 12px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.flash-success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: #b9e9cb;
}

.flash-error {
  background: var(--error-bg);
  color: var(--error-text);
  border-color: #f7b4bf;
}

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

.pagination {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  padding: 20px 0;
}

@media (max-width: 960px) {
  .nav-row {
    flex-wrap: wrap;
    padding: 10px 0;
  }

  .nav-links {
    margin-left: 0;
    flex-wrap: wrap;
  }

  .nav-auth {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
  }
}
