/* Tokens match the rest of the family (macrolog/liftlog/maillog) deliberately —
   same user, same visual grammar. Wider shell than the phone-first apps since
   this one centers on a data table + map, not a single-column daily log. */
:root {
  --bg:      #FAFAFA;
  --surface: #FFFFFF;
  --card:    #F5F5F7;
  --border:  #E5E5EA;
  --text:    #1C1C1E;
  --muted:   #8E8E93;

  --blue:    #4C7FF0;
  --teal:    #2FA89C;
  --green:   #34C759;
  --indigo:  #6C63FF;
  --amber:   #FF9F0A;
  --red:     #FF3B30;

  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 12px; }
h2 { font-size: 16px; font-weight: 600; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* ── Nav ─────────────────────────────────────────────────────────────── */
.topnav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.brand { color: var(--text); font-weight: 700; font-size: 16px; }
.brand:hover { text-decoration: none; }
.navlinks { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.navlinks a { color: var(--text); }
.linklike {
  background: none; border: none; padding: 0; font: inherit; color: var(--muted);
  cursor: pointer;
}
.linklike:hover { color: var(--text); text-decoration: underline; }
.logout-form { display: inline; }

/* ── Layout helpers ──────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 4px;
}
.summary { margin-bottom: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.card.ok { border-color: var(--green); }
.card.error-card { border-color: var(--red); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.btn:hover { background: var(--card); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-danger { color: var(--red); border-color: var(--red); }
.btn[disabled] { opacity: 0.6; cursor: default; }
.btn-icon {
  background: none; border: none; cursor: pointer; font-size: 15px;
  padding: 2px 4px; border-radius: 4px;
}
.btn-icon:hover { background: var(--card); }
.inline-form { display: inline; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Forms ───────────────────────────────────────────────────────────── */
form.card label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 4px; }
form.card label:first-child { margin-top: 0; }
input[type="text"], input[type="password"], input[type="url"], textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}
textarea { resize: vertical; }
form.card .btn { margin-top: 12px; }

/* ── Login ───────────────────────────────────────────────────────────── */
.login-shell { max-width: 360px; margin: 15vh auto 0; text-align: center; }
.login-shell h1 { margin-bottom: 20px; }
.login-form { text-align: left; }
.error { color: var(--red); font-size: 13px; margin-bottom: 8px; }

/* ── Map ─────────────────────────────────────────────────────────────── */
.map {
  height: 380px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.pin { font-size: 16px; text-align: center; line-height: 22px; }

/* ── Table ───────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table.listings { width: 100%; border-collapse: collapse; font-size: 13px; }
table.listings th, table.listings td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.listings th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
table.listings tr:last-child td { border-bottom: none; }
table.listings tr.starred { background: #FFF8E8; }
table.listings tr.error-row { background: #FFF0EF; }
.col-address { white-space: normal; max-width: 320px; }
.col-notes { white-space: normal; max-width: 200px; color: var(--muted); }
.edit-link { margin-left: 8px; font-size: 12px; color: var(--muted); }
.col-actions { white-space: nowrap; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-pass { background: #E6F9EC; color: #1F8A3F; }
.badge-borderline { background: #FFF3DE; color: #B36B00; }
.badge-fail { background: #F1F1F3; color: var(--muted); }
.badge-unknown { background: #F1F1F3; color: var(--muted); }

/* ── Detail page ─────────────────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.detail-grid dt { color: var(--muted); font-size: 13px; }
.detail-grid dd { font-size: 14px; }

@media (max-width: 640px) {
  .shell { padding: 16px 12px 60px; }
  table.listings th, table.listings td { padding: 6px 8px; }
}
