:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --ink: #17201b;
  --muted: #667066;
  --panel: #ffffff;
  --line: #dce2d8;
  --accent: #0f766e;
  --accent-dark: #0b514c;
  --warn: #a43f12;
  --shadow: 0 14px 38px rgba(23, 32, 27, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  padding: 0.7rem 0.95rem;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--accent-dark);
}

button.secondary {
  background: #e7ece5;
  color: var(--ink);
}

.shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.hidden {
  display: none !important;
}

.auth-panel {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 32px;
  align-items: center;
}

.auth-panel h1,
.topbar h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

.eyebrow {
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin: 0 0 8px;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

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

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

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

h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
}

label {
  display: grid;
  gap: 6px;
  color: #344139;
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.64rem 0.7rem;
  background: #fbfcfa;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

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

.filters button,
.checkbox {
  align-self: end;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.checkbox input {
  width: auto;
}

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

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

.preset {
  width: 100%;
  text-align: left;
  background: #f1f5ef;
  color: var(--ink);
  border: 1px solid transparent;
}

.preset:hover {
  background: #e4ebe0;
}

.preset strong {
  display: block;
  margin-bottom: 4px;
}

.preset span {
  display: block;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.35;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0.55rem;
  text-align: left;
  white-space: nowrap;
  font-size: 0.9rem;
}

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

td button {
  padding: 0.42rem 0.65rem;
  font-size: 0.82rem;
}

.error {
  color: var(--warn);
  min-height: 1.3rem;
}

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

.credential {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfa;
}

@media (max-width: 980px) {
  .auth-panel,
  .grid,
  .grid.two {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .shell {
    width: min(100vw - 20px, 1480px);
    padding: 16px 0;
  }

  .filters,
  .filters.compact {
    grid-template-columns: 1fr;
  }

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