:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --border: #dde4ee;
  --accent: #4b9cd3;
  --accent-dark: #25608f;
  --ink: #1b1f33;
  --muted: #6f7a8c;
  --danger: #d64545;
  --success: #2e9e73;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #0a1226;
  color: #fff;
}

.topbar nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

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

.link-button:hover,
.topbar a:hover {
  text-decoration: underline;
}

.inline-form {
  display: inline;
}

.content {
  flex: 1;
  width: min(1100px, 95vw);
  margin: 32px auto;
}

.flash-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.flash {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 10px;
  background: #dbeafe;
  color: #0f172a;
  border: 1px solid #bfdbfe;
}

.flash.error {
  background: #fee2e2;
  border-color: #fecaca;
  color: #7f1d1d;
}

.flash.success {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #14532d;
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  margin: 0 auto;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.1);
}

.subtitle {
  color: var(--muted);
  margin-top: 4px;
  margin-bottom: 20px;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-grid label {
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-grid input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
}
.form-grid select {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
}
.form-grid input.has-warning {
  border-color: #f97316;
  background: #fff7ed;
}
.form-warning {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: #b45309;
}

.form-grid button,
.action-stack button {
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

.form-grid button:hover,
.action-stack button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.form-grid button:disabled,
.action-stack button:disabled {
  background: #b6c3d6;
  cursor: not-allowed;
  transform: none;
}

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

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.metrics {
  display: flex;
  gap: 16px;
}

.metric-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  min-width: 140px;
  text-align: right;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.metric-card span {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}

.metric-card strong {
  font-size: 1.6rem;
}

.table-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
}

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

.table-card th,
.table-card td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table-card th {
  background: #f1f5f9;
  text-align: left;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.table-card tbody tr:last-child td {
  border-bottom: none;
}

.list-compact {
  margin: 0;
  padding-left: 18px;
}

.list-compact li {
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.muted {
  color: var(--muted);
  font-size: 0.88rem;
}

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

.future-callout {
  margin-top: 30px;
  background: var(--panel);
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 24px;
  color: var(--muted);
}

.footer {
  background: #0a1226;
  color: #94a3b8;
  text-align: center;
  padding: 12px 0;
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .metrics {
    flex-wrap: wrap;
  }
  .metric-card {
    flex: 1 1 45%;
    min-width: 120px;
  }
  .table-card th,
  .table-card td {
    padding: 12px 12px;
  }
  .action-stack {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
  .action-stack button {
    flex: 1 1 45%;
  }
}
