:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #18202b;
  --muted: #667085;
  --line: #e4e7ec;
  --primary: #1d4ed8;
  --primary-dark: #163fae;
  --good: #087443;
  --warn: #9a6700;
  --radius: 16px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: inherit; }
.wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { text-decoration: none; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #facc15; }
nav { display: flex; gap: 20px; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--muted); font-weight: 650; }
nav a:hover { color: var(--primary); }
main { min-height: calc(100vh - 150px); padding-bottom: 64px; }
.hero { padding: 76px 0 42px; text-align: center; }
.hero h1, .page-head h1 { font-size: clamp(2rem, 5vw, 4rem); line-height: 1.04; margin: 10px 0 18px; letter-spacing: -.04em; }
.eyebrow { color: var(--primary); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; }
.search { display: flex; max-width: 840px; margin: 30px auto; background: var(--surface); padding: 8px; border-radius: 18px; box-shadow: 0 14px 40px rgba(20, 35, 70, .11); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 16px; font-size: 1rem; }
button {
  border: 0; border-radius: 12px; background: var(--primary); color: white;
  padding: 13px 20px; font-weight: 750; cursor: pointer;
}
button:hover { background: var(--primary-dark); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 34px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stats strong { display: block; font-size: 1.7rem; }
.stats span { color: var(--muted); }
.page-head { padding: 54px 0 24px; }
.page-head p { color: var(--muted); max-width: 760px; }
.section-head { margin-top: 24px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 16px 0 34px; }
.card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card:hover { border-color: #a6b8eb; box-shadow: 0 10px 30px rgba(20, 35, 70, .07); }
.code { font-size: 1.45rem; font-weight: 850; }
.card small, .device-row span, .empty { color: var(--muted); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 22px; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  background: white; color: var(--text); font: inherit;
}
.filters select { width: auto; min-width: 190px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafbfc; }
.code-link { font-weight: 850; color: var(--primary); text-decoration: none; }
.list { display: flex; flex-direction: column; gap: 10px; }
.device-row {
  display: grid; grid-template-columns: minmax(220px, 1fr) minmax(160px, auto) auto;
  align-items: center; gap: 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px;
}
.device-row div:first-child { display: flex; flex-direction: column; gap: 3px; }
.battery-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.battery-tags a, .battery-tags span, .tag-cloud span {
  text-decoration: none; padding: 5px 9px; border-radius: 999px; background: #edf2ff; color: #284aa1; font-weight: 750; font-size: .86rem;
}
.status { display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.status.verified { background: #e6f6ee; color: var(--good); }
.status.unverified { background: #fff4d7; color: var(--warn); }
.detail-grid, .admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.panel h2 { margin-top: 0; }
dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; }
dt, dd { padding: 11px 0; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 700; text-align: right; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.form-stack { display: flex; flex-direction: column; gap: 13px; }
.form-stack label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: .92rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { flex-direction: row !important; align-items: center; }
.check input { width: auto; }
.warning { border-left: 4px solid #d97706; background: #fff8e7; padding: 12px 14px; color: #7a4c00 !important; }
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); background: white; }

@media (max-width: 760px) {
  .header-inner { align-items: flex-start; padding: 14px 0; flex-direction: column; }
  nav { gap: 12px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .search { flex-direction: column; }
  .detail-grid, .admin-grid { grid-template-columns: 1fr; }
  .device-row { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

.notice {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 700;
}

.notice.success {
  color: #087443;
  background: #e8f7ef;
  border: 1px solid #b7e6cc;
}

.notice.error {
  color: #a12622;
  background: #fff0ef;
  border: 1px solid #f3c2bf;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.form-stack small {
  color: var(--muted);
  font-weight: 400;
}

.admin-action {
  color: var(--primary);
  font-weight: 750;
  text-decoration: none;
}

.admin-action:hover {
  text-decoration: underline;
}

.admin-form-panel {
  max-width: 760px;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-actions form {
  margin: 0;
}

.danger-button {
  padding: 9px 13px;
  background: #b42318;
}

.danger-button:hover {
  background: #912018;
}
