:root {
  --bg: #f6f7f8;
  --panel: #ffffff;
  --panel-soft: #f0f4f3;
  --text: #1f2933;
  --muted: #667085;
  --line: #d8dee4;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #dff4f0;
  --warn: #b7791f;
  --warn-soft: #fff4d6;
  --danger: #b42318;
  --danger-soft: #ffe4df;
  --ok: #217a43;
  --ok-soft: #ddf7e8;
  --ink-soft: #eef1f4;
  --shadow: 0 10px 30px rgba(31, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

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

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

.sidebar {
  background: #18212f;
  color: #f8fafc;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #31a38e;
  color: #ffffff;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 3px;
  color: #b6c2cf;
  font-size: 13px;
}

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

.nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: #cbd5e1;
}

.nav a.active,
.nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #cbd5e1;
  display: grid;
  gap: 6px;
  font-size: 13px;
  line-height: 1.6;
}

.sidebar-note strong {
  color: #ffffff;
}

.sidebar-note button {
  width: 100%;
  margin-top: 8px;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.24);
}

.main {
  padding: 28px;
  min-width: 0;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 6px;
}

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

h1 {
  margin-bottom: 8px;
  font-size: 28px;
  line-height: 1.25;
}

h2 {
  font-size: 20px;
  margin-bottom: 14px;
}

h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

.subtle {
  color: var(--muted);
  line-height: 1.7;
}

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

.button,
button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  min-height: 38px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button:hover,
button:hover {
  border-color: #aab4bf;
}

.button.primary,
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.button.primary:hover,
button.primary:hover {
  background: var(--accent-strong);
}

.button.ghost,
button.ghost {
  background: transparent;
}

.button.danger,
button.danger {
  border-color: var(--danger);
  color: var(--danger);
}

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

.grid.two {
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat,
.panel,
.empty-state {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat {
  padding: 14px;
}

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

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.panel {
  padding: 18px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

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

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  background: #f8fafc;
  color: #475467;
  font-size: 13px;
  font-weight: 700;
}

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

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status.done {
  background: var(--ok-soft);
  color: var(--ok);
}

.status.missing,
.status.pending {
  background: var(--warn-soft);
  color: var(--warn);
}

.status.none,
.status.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.status.info {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status.project-collecting {
  background: #e6f4ff;
  color: #175cd3;
}

.status.project-archived {
  background: var(--ok-soft);
  color: var(--ok);
}

.status.project-delivered {
  background: #ece9fe;
  color: #5925dc;
}

.status.account-active {
  background: var(--ok-soft);
  color: var(--ok);
}

.status.account-disabled {
  background: var(--danger-soft);
  color: var(--danger);
}

.status.role-admin {
  background: #fef0c7;
  color: #93370d;
}

.status.role-user {
  background: var(--ink-soft);
  color: #475467;
}

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

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

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-weight: 700;
  font-size: 13px;
}

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

textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.requirement-list,
.file-list,
.directory-preview {
  display: grid;
  gap: 10px;
}

.requirement-item {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: #475467;
}

.checkline input {
  width: 16px;
  height: 16px;
}

.hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.upload-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 12px;
  background: #ffffff;
}

.upload-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.file-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--ink-soft);
  color: #344054;
  font-size: 13px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filters button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.directory-preview {
  padding: 14px;
  border-radius: 8px;
  background: #101828;
  color: #e5e7eb;
  overflow: auto;
  line-height: 1.7;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.empty-state {
  padding: 42px;
  text-align: center;
}

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

.auth-panel {
  width: min(440px, 100%);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #18212f;
  color: #ffffff;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 10;
}

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

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 14px 16px;
    gap: 12px;
  }

  .nav {
    display: flex;
  }

  .sidebar-note {
    display: none;
  }

  .main {
    padding: 18px;
  }

  .page-header,
  .form-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .grid.two,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .requirement-item {
    grid-template-columns: 1fr;
  }
}
