:root {
  --bg: #f6f7f8;
  --panel: #ffffff;
  --text: #172026;
  --muted: #65727d;
  --line: #dfe5ea;
  --accent: #1f7a54;
  --accent-dark: #14593d;
  --danger: #b42318;
  --danger-dark: #821b13;
  --shadow: 0 12px 28px rgba(23, 32, 38, 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;
}

a {
  color: var(--accent-dark);
  overflow-wrap: anywhere;
}

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

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 18px;
  font-size: 22px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.panel {
  padding: 24px;
  margin-bottom: 20px;
}

.auth-panel {
  width: min(420px, 100%);
  margin: 12vh auto 0;
  padding: 28px;
}

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

.grid-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 16px;
}

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

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 9px 11px;
}

input[type="file"] {
  padding: 8px;
}

button,
.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 9px 16px;
  text-decoration: none;
  white-space: nowrap;
}

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

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

.secondary:hover {
  background: #eef2f4;
}

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

.danger:hover {
  background: var(--danger-dark);
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.message {
  border-radius: 6px;
  padding: 10px 12px;
  background: #edf7f2;
  color: #135338;
  font-weight: 700;
}

.message.error {
  background: #fff0ee;
  color: var(--danger);
}

.table {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1.4fr) minmax(170px, auto);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.table-head,
.cell {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.table-head {
  background: #eef2f4;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.cell {
  min-width: 0;
  background: #fff;
}

.title-cell {
  font-weight: 700;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.actions form {
  margin: 0;
}

.empty,
.hint {
  color: var(--muted);
}

.hint {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .topbar,
  .grid-form {
    grid-template-columns: 1fr;
  }

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

  .table {
    display: block;
    border: 0;
  }

  .table-head {
    display: none;
  }

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

  .cell:nth-last-child(1) {
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .actions .button,
  .actions button {
    width: 100%;
  }
}
