:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #64748b;
  --line: #d9dee7;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --warn: #fff7ed;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

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

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

nav a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
}

nav a:hover { background: #eef2f7; }

main {
  width: min(1220px, calc(100% - 32px));
  margin: 22px auto 60px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: var(--accent-dark); }
button.secondary { background: #334155; }

.flash,
.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #fed7aa;
  background: var(--warn);
  border-radius: 6px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.summary-grid article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.summary-grid article {
  padding: 16px;
}

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

.summary-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.panel {
  padding: 16px;
  margin-bottom: 16px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.status-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.status-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.badge {
  display: inline-flex;
  min-width: 28px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-weight: 700;
  font-size: 12px;
}

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

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

th {
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
}

.rules {
  display: grid;
  gap: 12px;
}

.rule-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.rule-head label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  font: inherit;
}

@media (max-width: 820px) {
  .topbar,
  .two-col {
    display: block;
  }

  nav { margin-top: 12px; }
  .summary-grid,
  .status-list {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
