:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --line: #d7dde5;
  --text: #20242b;
  --muted: #66717f;
  --accent: #1f6b57;
  --accent-dark: #164d3f;
  --warning-bg: #fff4d6;
  --warning-line: #d8a817;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
}

.brand {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0;
}

.nav {
  display: flex;
  gap: 18px;
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.notice {
  border: 1px solid var(--warning-line);
  background: var(--warning-bg);
  padding: 10px 12px;
  margin-bottom: 18px;
  font-size: 14px;
}

.toolbar-band {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

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

h1 {
  margin-bottom: 4px;
  font-size: 30px;
  font-weight: 700;
}

h2 {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 700;
}

.toolbar-band p,
.detail-heading p,
.muted {
  color: var(--muted);
}

.filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}

.filter-section {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.filter-section-title {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

input,
select {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
}

select {
  appearance: none;
}

button,
.pager a,
.back-link,
.filter-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 6px 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
}

.back-link {
  width: fit-content;
  margin-bottom: 12px;
}

button:hover,
.pager a:hover,
.back-link:hover,
.filter-reset:hover {
  background: var(--accent-dark);
  color: #fff;
  text-decoration: none;
}

select:disabled {
  background: #eef2f5;
  color: var(--muted);
}

.state-message {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 16px;
  margin-bottom: 14px;
}

.auth-panel {
  max-width: 520px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 18px;
}

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

.auth-form button {
  width: fit-content;
}

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

.items-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

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

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

.status-pill {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  background: #eef5f1;
}

.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.detail-heading {
  margin-bottom: 18px;
}

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

.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 16px;
}

dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 12px;
  margin: 0;
}

dt {
  color: var(--muted);
  font-weight: 600;
}

dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.metadata-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.metadata-list li {
  display: grid;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  overflow-wrap: anywhere;
}

.metadata-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.metadata-list small {
  color: var(--muted);
}

@media (max-width: 860px) {
  .toolbar-band,
  .detail-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .header-inner,
  .page-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .filter-form {
    grid-template-columns: 1fr;
  }

  dl {
    grid-template-columns: 1fr;
  }
}
