:root {
  color-scheme: light;
  --ink: #1f2429;
  --muted: #68717d;
  --line: #e5e0dc;
  --soft: #fff6ef;
  --panel: #ffffff;
  --brand: #ff5a00;
  --brand-dark: #bd3d00;
  --brand-soft: #fff0e6;
  --gold: #a36b00;
  --red: #c34848;
  --blue: #246d8f;
  --teal: #188b7a;
  --sidebar: #17191d;
  --sidebar-soft: #24272d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 14%, rgb(255 90 0 / 12%), transparent 24%),
    radial-gradient(circle at 86% 8%, rgb(24 139 122 / 9%), transparent 28%),
    linear-gradient(135deg, #fffaf6 0%, #f7f8f8 48%, #eef3f2 100%);
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(428px, 100%);
  display: grid;
  gap: 16px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 28px 86px rgb(31 36 41 / 13%);
}

.login-card h1 {
  margin-bottom: 6px;
  font-size: 30px;
  line-height: 1.16;
}

.login-logo {
  width: 86px;
  height: 86px;
  padding: 0;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.login-card .eyebrow {
  margin-bottom: 10px;
  color: #737984;
  font-weight: 500;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.login-button {
  min-height: 46px;
  margin-top: 8px;
}

.shell {
  display: none;
}

body.is-authenticated .login-view {
  display: none;
}

body.is-authenticated .shell {
  display: grid;
}

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

.sidebar {
  background: linear-gradient(180deg, #1e2025 0%, var(--sidebar) 100%);
  color: #fff;
  padding: 24px 18px;
  border-right: 1px solid rgb(255 255 255 / 8%);
}

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

.mark {
  width: 50px;
  height: 50px;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
  padding: 0;
  box-shadow: none;
}

.brand strong {
  display: block;
  font-size: 18px;
  letter-spacing: 0;
}

.brand small,
.eyebrow,
.muted {
  color: var(--muted);
}

.brand small {
  display: block;
  color: #b9bdc5;
  margin-top: 2px;
}

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

.nav-btn {
  border: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: transparent;
  color: #d6d8dd;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
}

.nav-btn.active,
.nav-btn:hover {
  background: linear-gradient(90deg, rgb(255 90 0 / 20%), rgb(255 255 255 / 7%));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--brand);
}

.workspace {
  padding: 28px 32px 42px;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

.user-card {
  min-width: 140px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 32px rgb(31 36 41 / 6%);
}

.logout-btn {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.user-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

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

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

.two {
  grid-template-columns: 1.2fr 0.8fr;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 16px 40px rgb(31 36 41 / 7%);
}

.card h2 {
  margin-bottom: 14px;
}

.metric strong {
  display: block;
  font-size: 28px;
  margin: 8px 0;
  color: #15191d;
}

.delta {
  color: var(--teal);
  font-weight: 700;
}

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

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

th {
  color: #59616c;
  font-weight: 700;
  background: #fbfaf8;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.tag.ok {
  background: #e6f6f3;
  color: #116f62;
}

.tag.warn {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.tag.danger {
  background: #fbe8e8;
  color: var(--red);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.text-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--brand-dark);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.text-btn.danger {
  color: var(--red);
}

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

.search {
  min-width: 260px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  outline-color: var(--brand);
}

.button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--brand);
  color: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgb(255 90 0 / 20%);
}

.button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.button.secondary {
  background: #f1f2f4;
  color: var(--ink);
  box-shadow: none;
}

.steps {
  display: grid;
  gap: 10px;
}

.step {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.bars {
  display: grid;
  gap: 12px;
}

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

.track {
  height: 12px;
  border-radius: 8px;
  background: #ece7e2;
  overflow: hidden;
}

.fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--teal));
}

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

dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 70px rgb(23 32 42 / 24%);
}

dialog::backdrop {
  background: rgb(23 25 29 / 55%);
}

.modal-body {
  padding: 20px;
}

.modal-error {
  min-height: 20px;
  margin: 4px 0 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  outline-color: var(--brand);
}

.login-card label {
  gap: 8px;
  color: #5f6771;
}

.login-card input {
  min-height: 42px;
  padding: 10px 12px;
  border-color: #dedede;
  border-radius: 8px;
  font-weight: 600;
}

.login-card input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(255 90 0 / 10%);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

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

  .sidebar {
    position: static;
  }

  nav,
  .metrics,
  .two,
  .permission-grid {
    grid-template-columns: 1fr;
  }

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