:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #69758a;
  --line: #dfe5ee;
  --brand: #e8503f;
  --brand-dark: #b7352a;
  --green: #277c5a;
  --yellow: #8a5f06;
  --blue: #2867b2;
  --side: #172033;
  --radius: 8px;
  --shadow: 0 20px 70px rgba(25, 36, 58, .10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

button {
  cursor: pointer;
}

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

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: #fff;
}

.login-visual {
  min-height: 522px;
  padding: 44px;
  color: #fff;
  background:
    linear-gradient(0deg, rgba(23, 32, 51, .86), rgba(23, 32, 51, .24)),
    url("/assets/demo-cover-campus.jpg") center/cover;
}

.login-visual h1 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.2;
}

.login-visual p {
  margin: 0;
  max-width: 330px;
  color: rgba(255, 255, 255, .82);
  font-size: 14px;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px;
}

.login-box {
  width: min(360px, 100%);
}

.login-box h2 {
  margin: 0 0 6px;
  font-size: 23px;
}

.login-box p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #3a4659;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

.primary,
.ghost,
.danger,
.small {
  min-height: 34px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0 12px;
  font-weight: 750;
}

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

.ghost {
  color: #344258;
  background: #fff;
  border-color: var(--line);
}

.danger {
  color: var(--brand-dark);
  background: #fff3f1;
  border-color: #ffd1ca;
}

.small {
  min-height: 28px;
  padding: 0 8px;
  color: #344258;
  background: #fff;
  border-color: var(--line);
  font-size: 12px;
}

.small.primary {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.small.danger {
  color: var(--brand-dark);
  background: #fff3f1;
  border-color: #ffd1ca;
}

.error {
  margin-top: 12px;
  color: var(--brand-dark);
  font-size: 13px;
}

.app-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 178px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 14px 12px;
  color: #dce5f2;
  background: var(--side);
}

.logo {
  display: grid;
  gap: 3px;
  padding: 4px 2px 18px;
}

.logo strong {
  color: #fff;
  font-size: 16px;
}

.logo span {
  display: none;
}

#nav {
  display: grid;
  gap: 5px;
}

.nav-item {
  width: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: var(--radius);
  color: #b9c6d8;
  background: transparent;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 650;
  text-align: left;
}

.nav-item.active {
  color: #fff;
  background: var(--brand);
}

.workspace {
  min-width: 0;
  padding: 16px;
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.workspace-head h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.workspace-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.head-actions,
.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toast {
  margin-bottom: 12px;
  border: 1px solid #c9ead9;
  border-radius: var(--radius);
  background: #e9f7f0;
  color: #1e684d;
  padding: 10px 12px;
  font-size: 13px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-size: 21px;
  line-height: 1.1;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 12px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  border-bottom: 1px solid var(--line);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 760;
}

.panel-body {
  padding: 12px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: #5d6a7e;
  background: #fafbfd;
  font-weight: 760;
}

tr:last-child td {
  border-bottom: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 760;
}

.chip.live,
.chip.enabled,
.chip.approved,
.chip.valid,
.chip.done,
.chip.shipped {
  color: #1e684d;
  background: #e9f7f0;
}

.chip.wait,
.chip.pending,
.chip.pending_ship,
.chip.pending_address,
.chip.draft {
  color: #8a5f06;
  background: #fff5da;
}

.chip.off,
.chip.archived,
.chip.hidden,
.chip.disabled {
  color: #56647a;
  background: #eef2f7;
}

.chip.reject,
.chip.rejected {
  color: var(--brand-dark);
  background: #fff0ed;
}

.chip.published {
  color: #1e684d;
  background: #e9f7f0;
}

.chip.ended {
  color: #1f5a9e;
  background: #eaf2ff;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.form-grid .wide {
  grid-column: span 3;
}

.chart {
  height: 190px;
  display: grid;
  align-items: end;
  grid-template-columns: repeat(7, minmax(26px, 1fr));
  gap: 12px;
  padding: 16px;
}

.bar {
  min-height: 12px;
  border-radius: 7px 7px 0 0;
  background: var(--blue);
}

.bar:nth-child(2n) {
  background: var(--brand);
}

.bar:nth-child(3n) {
  background: var(--green);
}

.empty {
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.preview-img {
  width: 52px;
  height: 52px;
  border-radius: 7px;
  object-fit: cover;
  background: #eef2f7;
}

.image-upload-field {
  align-content: start;
  grid-template-columns: minmax(0, 1fr) auto;
}

.image-upload-field > span:first-child,
.image-upload-field > input[type="file"] {
  grid-column: 1 / -1;
}

.image-upload-field input[type="file"] {
  min-height: 38px;
  padding: 7px;
  background: #fafbfd;
}

.upload-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.form-image-preview {
  width: 92px;
  height: 68px;
  border-radius: 7px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #eef2f7;
}

@media (max-width: 980px) {
  .login-view,
  .app-view {
    grid-template-columns: 1fr;
  }

  .login-visual,
  .sidebar {
    display: none;
  }

  .workspace-head,
  .form-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .form-grid .wide {
    grid-column: span 1;
  }

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

@media (max-width: 560px) {
  .workspace {
    padding: 14px;
  }

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