:root {
  --bg: #f4f6f2;
  --ink: #111313;
  --muted: #4e5a4e;
  --line: #d9dfd4;
  --accent: #1f6b4b;
  --accent-2: #dff2e6;
  --card: #ffffff;
  --shadow: 0 10px 30px rgba(0,0,0,0.08);
  --radius: 14px;
  --font: "Space Grotesk", "IBM Plex Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(circle at top left, #f9fbf7, #eef2ea 45%, #f4f6f2 100%);
}

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

.sidebar {
  background: #0f1d16;
  color: #ecf6ef;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.8px;
}
.brand-sub {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: #a7c7b7;
  margin-top: 4px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav button {
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: #e2f1ea;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #e2f1ea;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.nav-link:hover {
  background: #173325;
  border-color: #2f6449;
}

.nav button.active {
  background: #173325;
  border-color: #2f6449;
}

.sidebar-footer {
  margin-top: auto;
}

.main {
  padding: 26px 28px 40px;
}

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

.topbar h1 {
  margin: 0;
  font-size: 26px;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.api-label {
  font-size: 12px;
  color: var(--muted);
}

.content {
  display: grid;
  gap: 20px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

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

.actions {
  display: flex;
  gap: 8px;
}

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

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

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

.table th {
  background: var(--accent-2);
  font-weight: 600;
  white-space: nowrap;
}

.btn {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn.ghost {
  background: transparent;
  border-color: #2f6449;
  color: #c9e6d5;
}

.input, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-bottom: 12px;
  font-size: 14px;
}

.form label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 12, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: var(--card);
  width: min(780px, 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.hidden { display: none; }
.modal.hidden { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }
  .sidebar-footer { width: 100%; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .topbar-right { width: 100%; }
}
