:root {
  --navy: #203A43;
  --green: #00A86B;
  --gold: #D4AF37;
  --bg: #f4f6f7;
  --surface: #ffffff;
  --surface-alt: #eef2f3;
  --text: #1b2629;
  --muted: #5c6b70;
  --error: #b3261e;
  --warn: #9a6700;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 6px 18px rgba(0, 0, 0, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.hidden { display: none !important; }

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--navy);
  color: #fff;
  box-shadow: inset 0 -3px 0 var(--gold);
}
.brand { margin: 0; font-size: 1.3rem; font-weight: 700; letter-spacing: .02em; }
.topbar .btn { position: absolute; right: 16px; }

main { width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px 16px 32px; flex: 1; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin: 0 auto 18px;
}
.card.narrow { max-width: 360px; margin-top: 40px; }
.card h2 { margin: 0 0 14px; text-align: center; font-size: 1.2rem; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: .95rem; }
input, select, textarea {
  font: inherit;
  padding: 11px 12px;
  border: 1px solid #c9d2d5;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  width: 100%;
}
textarea { resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: .95rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: 0; }

.btn {
  font: inherit;
  font-weight: 600;
  padding: 12px 18px;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
}
.btn:hover { background: #e1e8ea; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: #18303a; }
.btn.small { padding: 7px 12px; min-height: 34px; font-size: .9rem; }
.btn:disabled { opacity: .6; cursor: wait; }

.row-btns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 12px;
  max-width: 520px;
  margin: 6px auto 0;
}
.row-btns.one { max-width: 260px; }

.msg { text-align: center; min-height: 1.4em; margin: 10px 0 0; }
.msg.error { color: var(--error); }
.msg.ok { color: var(--green); }
.count { text-align: center; color: var(--muted); margin: 4px 0 10px; font-size: .95rem; }

.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th {
  text-align: left;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  background: var(--surface-alt);
  padding: 10px 12px;
  white-space: nowrap;
}
.table td { padding: 10px 12px; vertical-align: top; }
.table tbody tr:nth-child(even) td { background: #f7f9fa; }
.table .dom { font-weight: 700; white-space: nowrap; }
.table .ns { color: var(--muted); font-size: .88rem; }
.table .empty td { text-align: center; color: var(--muted); padding: 22px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .85rem; font-weight: 700; white-space: nowrap; background: var(--surface-alt); }
.tag.afternic { background: #d9f3e8; color: #006b44; }
.tag.missing { background: #fbe9d0; color: var(--warn); }
.soon { color: var(--error); font-weight: 700; }
.note { color: var(--error); font-size: .88rem; }
.wait { color: var(--muted); }

.credit { text-align: center; padding: 14px; font-size: .9rem; color: var(--muted); }
.credit .jet { color: var(--navy); font-weight: 700; }
.credit .jade { color: var(--green); font-weight: 700; }

@media (max-width: 720px) {
  .filters { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .card { padding: 16px; }
}
@media (max-width: 480px) {
  .row-btns { grid-auto-flow: row; }
}
