:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --panel-soft: #eef3f8;
  --text: #17202a;
  --muted: #5d6978;
  --line: #d9e0e8;
  --accent: #0f7b6c;
  --accent-strong: #075f54;
  --warn: #b84925;
  --danger: #ad2634;
  --shadow: 0 12px 28px rgba(25, 42, 62, 0.08);
}

* {
  box-sizing: border-box;
}

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

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

button {
  border: 0;
  cursor: pointer;
}

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

.login-panel {
  width: min(100%, 420px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

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

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

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

h1 {
  margin-bottom: 4px;
  font-size: 1.35rem;
}

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

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 248px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 22px 18px;
}

.nav-stack {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  text-align: left;
}

.nav-item.active {
  background: var(--panel-soft);
  color: var(--text);
  font-weight: 800;
}

.main {
  padding: 24px;
}

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

.topbar h2 {
  margin-bottom: 3px;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 8px 13px;
  font-weight: 800;
}

.button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.button.danger {
  background: var(--danger);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px;
  gap: 12px;
  margin-bottom: 14px;
}

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

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

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

th {
  background: #f0f4f8;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

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

.url {
  color: var(--accent-strong);
  text-decoration: none;
  word-break: break-all;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 3px 9px;
  font-size: 0.78rem;
  font-weight: 800;
}

.inline-actions {
  display: flex;
  gap: 7px;
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(13, 24, 38, 0.42);
  padding: 18px;
}

.dialog {
  width: min(100%, 620px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 22px;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.alert {
  border-radius: 6px;
  background: #fff3eb;
  color: var(--warn);
  margin: 12px 0;
  padding: 10px 12px;
}

.empty {
  padding: 34px 18px;
  text-align: center;
}

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

.audit-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
}


.import-panel,
.import-result {
  max-width: 760px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.import-help {
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 11px 12px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.import-result {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.import-result ul {
  margin: 4px 0 0;
  padding-left: 20px;
}

.import-result li {
  margin: 4px 0;
}
@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

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