:root {
  --accent: #0f766e;
  --accent-weak: rgba(15, 118, 110, 0.1);
  --on-accent: #fff;
  --bg: #f6f7f4;
  --surface: #fff;
  --raised: #eef2ef;
  --text: #18201c;
  --muted: #637067;
  --border: rgba(0, 0, 0, 0.1);
  --success: #247c45;
  --warning: #b7791f;
  --danger: #b42318;
  --info: #2563eb;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

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

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

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

.login-panel {
  width: min(430px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--on-accent);
  background: var(--accent);
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.18;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 17px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
}

.input,
.select {
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.input:focus,
.select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}

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

.primary,
.secondary,
.danger {
  min-height: 46px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
}

.primary {
  color: var(--on-accent);
  background: var(--accent);
}

.secondary {
  color: var(--text);
  background: var(--raised);
  border: 1px solid var(--border);
}

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

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

.sidebar {
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.68);
  padding: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.tenant-name {
  margin: 14px 0 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

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

.nav button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 700;
}

.nav button.active {
  color: var(--accent);
  background: var(--accent-weak);
}

.main {
  min-width: 0;
}

.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(246, 247, 244, 0.92);
  position: sticky;
  top: 0;
  z-index: 4;
}

.content {
  padding: 24px;
  display: grid;
  gap: 18px;
}

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

.panel,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.panel {
  padding: 18px;
}

.card {
  padding: 16px;
}

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

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

.search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 120px;
  gap: 10px;
}

.search-input {
  min-height: 56px;
  padding: 0 16px;
  font-size: 18px;
}

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

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

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

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

tr:hover td {
  background: rgba(15, 118, 110, 0.04);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
  background: var(--raised);
  color: var(--muted);
  white-space: nowrap;
}

.badge.success {
  color: var(--success);
  background: rgba(36, 124, 69, 0.1);
}

.badge.info {
  color: var(--info);
  background: rgba(37, 99, 235, 0.1);
}

.badge.warning {
  color: var(--warning);
  background: rgba(183, 121, 31, 0.12);
}

.badge.danger {
  color: var(--danger);
  background: rgba(180, 35, 24, 0.1);
}

.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.result-list {
  display: grid;
  gap: 10px;
}

.result-card {
  display: grid;
  gap: 10px;
}

.result-card mark {
  background: rgba(183, 121, 31, 0.22);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

.dropzone {
  min-height: 190px;
  border: 1px dashed rgba(15, 118, 110, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}

.dropzone.drag {
  border-color: var(--accent);
  background: var(--accent-weak);
}

.progress {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--raised);
}

.progress > div {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 160ms ease;
}

.viewer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
}

.preview {
  min-height: 520px;
  white-space: pre-wrap;
  line-height: 1.75;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: var(--raised);
  border-radius: 8px;
}

.error {
  margin-top: 12px;
  color: var(--danger);
  font-weight: 700;
}

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

  .sidebar {
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

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

  .search-box,
  .viewer,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .topbar,
  .content {
    padding-left: 14px;
    padding-right: 14px;
  }
}
