:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #d7dfe8;
  --text: #1f2937;
  --muted: #667085;
  --primary: #2f6fed;
  --primary-weak: #e8f0ff;
  --success: #1f7a4f;
  --success-weak: #e7f6ee;
  --warn: #9a6700;
  --warn-weak: #fff3d6;
  --danger: #b42318;
  --danger-weak: #fde8e7;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, PingFang SC, "Microsoft YaHei", Arial, sans-serif;
}

body {
  font-size: 14px;
  line-height: 1.5;
}

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

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

.public-body {
  padding: 32px 20px;
}

.public-wrap {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
  align-items: start;
}

.public-hero,
.public-panel,
.card,
.sidebar-card,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.public-hero {
  padding: 28px;
}

.public-hero h1 {
  margin: 10px 0 12px;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: 0;
}

.public-hero p {
  margin: 0 0 18px;
  color: var(--muted);
  max-width: 42rem;
}

.hero-note {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.public-panel {
  padding: 20px;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.shell {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 20px;
  background: #101828;
  color: #eef2ff;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(145deg, #2f6fed, #185adb);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle,
.sidebar-meta,
.muted,
.field-help,
.eyebrow,
.empty {
  color: var(--muted);
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-link {
  display: block;
  padding: 12px 14px;
  border-radius: 8px;
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.04);
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.sidebar-name {
  font-size: 18px;
  font-weight: 700;
  margin: 2px 0 6px;
}

.content {
  padding: 22px;
}

.page-header {
  margin-bottom: 16px;
}

.page-header h1 {
  margin: 4px 0 0;
  font-size: 28px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.stack {
  display: grid;
  gap: 16px;
}

.card {
  overflow: hidden;
}

.card-head {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
}

.card-head h2 {
  margin: 0;
  font-size: 18px;
}

.card-body {
  padding: 18px;
}

.card-foot {
  padding: 0 18px 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 16px;
  box-shadow: none;
}

.stat-card span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 28px;
  line-height: 1;
}

.stack-form,
.grid-form {
  display: grid;
  gap: 14px;
}

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

.full-width,
.field-wide {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 6px;
}

.field-label {
  font-weight: 600;
}

.field-label em {
  color: var(--danger);
  font-style: normal;
}

.input,
.textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

.input:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.14);
}

.textarea {
  min-height: 98px;
  resize: vertical;
}

.input-inline {
  min-width: 180px;
}

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

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
  margin-top: 4px;
  margin-bottom: 4px;
}

.assign-form {
  flex-wrap: nowrap;
}

.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.15s ease;
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-ghost {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn-small {
  padding: 7px 10px;
  font-size: 13px;
}

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

.flash-success {
  background: var(--success-weak);
  border-color: #bfe7cd;
  color: var(--success);
}

.flash-error {
  background: var(--danger-weak);
  border-color: #f8c5c2;
  color: var(--danger);
}

.flash-warn {
  background: var(--warn-weak);
  border-color: #f2d49b;
  color: var(--warn);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
}

.badge-success {
  background: var(--success-weak);
  color: var(--success);
}

.badge-warn {
  background: var(--warn-weak);
  color: var(--warn);
}

.badge-muted {
  background: #edf2f7;
  color: #475467;
}

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

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

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

.table th {
  background: #f8fafc;
  font-weight: 700;
  white-space: nowrap;
}

.simple-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.simple-list li + li {
  margin-top: 8px;
}

.empty {
  padding: 12px 0;
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

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

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

  .auth-grid,
  .public-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .content,
  .public-body {
    padding: 14px;
  }

  .public-hero h1 {
    font-size: 28px;
  }

  .page-header h1 {
    font-size: 24px;
  }

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

  .inline-form {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
  }

  .input-inline {
    width: 100%;
    min-width: 0;
  }

  .table {
    min-width: 720px;
  }
}
