﻿:root {
  --bg: #eef3f8;
  --card: #ffffff;
  --card-soft: #f7fafc;
  --line: #d6e0ea;
  --text: #16324a;
  --muted: #5b6b7a;
  --primary: #1f3a5f;
  --primary-strong: #12283f;
  --accent: #c65c3a;
  --ok: #2e8b57;
  --danger: #d64545;
  --danger-soft: #fff1f1;
  --shadow: 0 18px 45px rgba(31, 58, 95, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(31, 58, 95, 0.10), transparent 24%),
    linear-gradient(180deg, #f6f9fc 0%, var(--bg) 100%);
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-shell {
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(18, 40, 63, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(18, 40, 63, 0.16);
}

.site-header-inner {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  flex-wrap: wrap;
}

.brand-area {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-kicker,
.eyebrow,
.screen-tag {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: #a9c1da;
}

.site-title,
.hero-panel h2,
.screen-header h2,
.panel-card-header h3,
.auth-card h2 {
  margin: 0;
}

.site-title {
  color: #ffffff;
  font-size: 24px;
}

.site-nav,
.site-user-tools,
.button-group,
.hero-panel,
.screen-header,
.panel-card-header,
.dashboard-grid,
.activity-list li,
.import-flow,
.step-card,
.entry-layout,
.quick-actions,
.hero-actions,
.pill-group,
.compact-actions {
  display: flex;
  gap: 12px;
}

.site-nav {
  align-items: center;
  flex-wrap: wrap;
}

.site-nav a {
  color: #f4f8fc;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.site-user-tools {
  align-items: center;
  flex-wrap: wrap;
}

.user-chip,
.subtle,
.auth-copy {
  color: var(--muted);
}

.user-chip {
  color: #dbe8f4;
  font-size: 13px;
}

.main-shell {
  padding: 28px 0 40px;
}

.hero-panel,
.screen-card,
.panel-card,
.auth-card,
.filter-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(214, 224, 234, 0.95);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-panel,
.screen-card,
.auth-card,
.filter-card,
.panel-card {
  padding: 24px;
}

.hero-panel {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.hero-panel p,
.panel-card p,
.auth-copy {
  line-height: 1.7;
}

.hero-actions,
.button-group,
.compact-actions {
  align-items: center;
  flex-wrap: wrap;
}

.button-link,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button-link:hover {
  filter: brightness(1.02);
}

.ghost,
.ghost-link,
.small-button.ghost {
  background: #eef4f9;
  color: var(--primary);
  border: 1px solid var(--line);
}

.accent-button {
  background: var(--accent);
}

.small-button {
  padding: 8px 12px;
  border-radius: 10px;
}

.message-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.message-item {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
}

.message-item.success {
  background: #e9f7ee;
  color: var(--ok);
  border-color: #caead6;
}

.message-item.error,
.message-item.inline-message {
  background: #ffeaea;
  color: var(--danger);
  border-color: #f7caca;
}

.screen-card {
  margin-bottom: 24px;
}

.screen-header {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.dashboard-grid {
  align-items: stretch;
  gap: 18px;
}

.dashboard-grid > .panel-card:first-child {
  flex: 1.5;
}

.stack-column {
  flex: 1;
  display: grid;
  gap: 18px;
}

.soft-highlight {
  background: linear-gradient(180deg, #fbfcfe 0%, #f1f7fb 100%);
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid #e6edf4;
  padding: 13px 12px;
  text-align: left;
  vertical-align: top;
}

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

.is-alert-row {
  background: var(--danger-soft);
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status.ok {
  background: #e8f6ee;
  color: var(--ok);
}

.status.danger {
  background: #ffe7e7;
  color: var(--danger);
}

.muted-status {
  background: #eef3f8;
  color: var(--muted);
}

.activity-list,
.hint-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.activity-list li {
  grid-template-columns: 56px 1fr auto;
  padding: 10px 0;
  border-bottom: 1px solid #edf2f7;
  align-items: start;
}

.activity-list li:last-child,
.hint-list li:last-child {
  border-bottom: 0;
}

.activity-list strong {
  color: var(--primary);
}

.activity-list em {
  font-style: normal;
  color: var(--muted);
}

.hint-list li {
  line-height: 1.8;
  padding: 8px 0;
}

.filter-card,
.form-grid,
.stock-filter-grid,
.detail-grid {
  display: grid;
  gap: 14px;
}

.stock-filter-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  margin-bottom: 18px;
}

.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.entry-layout {
  align-items: start;
}

.entry-layout-form {
  display: block;
}

.entry-layout > .panel-card:first-child {
  flex: 0.9;
}

.entry-layout > .panel-card:last-child {
  flex: 1.3;
}

label,
.stack-form p {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

label span,
.stack-form label {
  font-size: 13px;
  color: var(--muted);
}

.helper-text {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fbfdff;
  color: var(--text);
}

textarea {
  resize: vertical;
}

ul.errorlist {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--danger);
  font-size: 12px;
}

.full-row {
  grid-column: 1 / -1;
}

.checkbox-line {
  flex-direction: row;
  align-items: center;
  padding-top: 22px;
}

.checkbox-line input {
  width: auto;
}

.push-right {
  justify-content: flex-end;
}

.danger-button {
  background: var(--danger);
}

.small-link {
  padding: 8px 12px;
  border-radius: 10px;
}

.auth-shell {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(520px, 100%);
}

.auth-form {
  margin-top: 16px;
}

.full-width {
  width: 100%;
}

.import-flow {
  flex-direction: column;
}

.step-card {
  align-items: center;
}

.step-index {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: linear-gradient(180deg, #edf4fb 0%, #dfeaf6 100%);
  color: var(--primary);
}

.pill-group {
  flex-wrap: wrap;
}

.narrow-card {
  max-width: 900px;
}

@media (max-width: 1100px) {
  .dashboard-grid,
  .entry-layout,
  .stock-filter-grid,
  .form-grid.two-up,
  .detail-grid {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100% - 24px, 1360px);
  }

  .site-header-inner,
  .screen-header,
  .hero-panel,
  .button-group,
  .compact-actions,
  .hero-actions,
  .activity-list li,
  .step-card {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .site-user-tools {
    width: 100%;
    justify-content: space-between;
  }

  .stock-filter-grid,
  .form-grid.two-up {
    grid-template-columns: 1fr;
  }

  .data-table {
    min-width: 620px;
  }
}
