:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #647084;
  --line: #dbe2ee;
  --primary: #e85d2a;
  --primary-dark: #c84719;
  --teal: #16857a;
  --green-bg: #e7f6ef;
  --green: #16774f;
  --yellow-bg: #fff3d6;
  --yellow: #8b5e00;
  --red-bg: #ffe7e3;
  --red: #b42318;
  --shadow: 0 12px 30px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

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

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

button,
input,
select {
  font: inherit;
}

.auth-screen {
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(232, 93, 42, 0.08), transparent 42%),
    var(--bg);
}

.login-shell {
  width: min(460px, calc(100vw - 32px));
}

.login-panel,
.panel,
.metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel {
  padding: 32px;
}

.brand-block,
.brand,
.page-header,
.panel-header,
.button-row {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 14px;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  line-height: 1.35;
}

.brand-block p,
.panel-header p,
.metric-card p,
.muted {
  color: var(--muted);
}

.small-text {
  font-size: 13px;
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: #3b4658;
  font-size: 14px;
  font-weight: 650;
}

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

.login-form + .muted {
  margin-top: 18px;
}

.primary-button,
.secondary-button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

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

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button {
  color: var(--ink);
  background: #eef2f7;
}

.secondary-button:hover {
  background: #e0e7f1;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: #111827;
  color: #e8edf6;
  padding: 22px 16px;
}

.brand {
  gap: 10px;
  margin-bottom: 28px;
  font-size: 17px;
  font-weight: 800;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  border-radius: 8px;
  color: #bac5d5;
  padding: 11px 12px;
  font-weight: 650;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.content {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 28px;
}

.page-header {
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.button-row {
  gap: 10px;
}

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

.metric-card {
  padding: 20px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 24px;
  line-height: 1.2;
}

.metric-card p {
  font-size: 13px;
  line-height: 1.5;
}

.panel {
  padding: 20px;
}

.panel-header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

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

.step {
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.step span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-weight: 800;
}

.step.done span {
  color: #fff;
  background: var(--teal);
}

.step p {
  font-size: 14px;
  line-height: 1.35;
}

.permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.permission-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  padding: 8px 12px;
  color: #3b4658;
  font-size: 14px;
  font-weight: 650;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: left;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #f8fafc;
}

.badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.badge.green {
  color: var(--green);
  background: var(--green-bg);
}

.badge.yellow {
  color: var(--yellow);
  background: var(--yellow-bg);
}

.badge.red {
  color: var(--red);
  background: var(--red-bg);
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  transform: translateY(20px);
  border-radius: 8px;
  background: #172033;
  color: #fff;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: 160ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-link {
    text-align: center;
  }

  .page-header,
  .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .status-grid,
  .steps {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .content {
    padding: 18px;
  }

  .sidebar nav {
    grid-template-columns: 1fr 1fr;
  }

  h1 {
    font-size: 24px;
  }
}
