:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #0a6d60;
  --primary-strong: #075247;
  --danger: #b42318;
  --border: #e5e7eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top right, #e8fff8, var(--bg) 38%);
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0d1f1e;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
  gap: 1rem;
}

.brand {
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
}

nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

nav a,
.link-button {
  color: #d3f9f3;
  text-decoration: none;
  font-weight: 600;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

main {
  padding: 1.25rem 0 2rem;
}

.hero {
  margin: 1rem 0 1.5rem;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.55rem, 2.5vw, 2rem);
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(10, 23, 33, 0.06);
  margin-bottom: 1rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1rem;
}

.auth-card {
  max-width: 480px;
  margin: 2rem auto;
}

.stack-form {
  display: grid;
  gap: 0.7rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

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

input,
select,
textarea {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  width: 100%;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  border: 0;
  text-decoration: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.button:hover {
  background: var(--primary-strong);
}

.button-secondary {
  background: #364152;
}

.button-secondary:hover {
  background: #1f2937;
}

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

.button-danger:hover {
  background: #8f1a10;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
  align-items: end;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 0.6rem;
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 0.9rem;
  color: #374151;
}

.flash-wrap {
  margin-top: 1rem;
}

.flash {
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  font-weight: 600;
}

.flash-success {
  background: #d1fae5;
  color: #065f46;
}

.flash-error {
  background: #fee2e2;
  color: #991b1b;
}

.inline-form {
  display: inline;
}

.list-stack {
  display: grid;
  gap: 0.6rem;
}

.inline-edit {
  display: flex;
  gap: 0.5rem;
}

.details-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
}

.details-card summary {
  cursor: pointer;
  margin-bottom: 0.8rem;
}

.admin-action-icons {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.icon-details {
  display: inline-block;
}

.icon-details > summary {
  list-style: none;
}

.icon-details > summary::-webkit-details-marker {
  display: none;
}

.icon-details form {
  margin-top: 0.7rem;
  min-width: 280px;
}

.icon-button {
  width: 2.3rem;
  height: 2.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.icon-button:focus-visible {
  outline: 2px solid #111827;
  outline-offset: 2px;
}

.icon-button-edit {
  background: #364152;
}

.icon-button-edit:hover {
  background: #1f2937;
}

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

.icon-button-delete:hover {
  background: #8f1a10;
}

@media (max-width: 900px) {
  .split,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .nav-row {
    flex-direction: column;
    justify-content: center;
    padding: 0.75rem 0;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
  }
}
