* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}
a { color: #0f62fe; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: #0f172a;
  color: #fff;
}
.topbar a { color: #fff; }
.topbar__brand a {
  font-weight: 700;
  letter-spacing: 0.5px;
}
.topbar__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .topbar {
    justify-content: center;
    padding: 10px 12px;
  }
  .topbar__brand {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .topbar__actions {
    width: 100%;
    justify-content: center;
  }
  .topbar__actions .btn {
    padding: 8px 10px;
    font-size: 12px;
  }
}

.content {
  max-width: 1100px;
  margin: 20px auto 40px;
  padding: 0 16px;
}

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}
.card.hidden {
  display: none;
}
.card.highlight {
  box-shadow: 0 0 0 3px #0ea5e9 inset;
  transition: box-shadow .25s;
}
.card.narrow {
  max-width: 520px;
  margin: 0 auto;
}

.sec {
  display: grid;
  gap: 12px;
}
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  align-items: end;
  margin: 0;
  padding: 0;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.inline-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.two-textareas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}
.required::after {
  content:" *";
  color: #b91c1c;
  font-weight: 700;
}
.sec label {
  font-weight: 600;
  font-size: 14px;
}
.sec input, .sec select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.btn {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  min-height: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}
.btn.primary {
  background: #0f62fe;
  color: #fff;
  border-color: #0f62fe;
}
.btn.ghost {
  background: transparent;
  color: #0f62fe;
  border-color: #cbd5e1;
}
.btn.light {
  background: #e5e7eb;
  color: #111827;
  border-color: #e5e7eb;
}
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.notice {
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
}
.notice.error {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #9f1239;
}
.notice.success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  font-size: 14px;
}
th {
  background: #f8fafc;
  font-weight: 700;
}
tr:hover td {
  background: #f8fafc;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.badge.blue { background: #dbeafe; color: #1d4ed8; }
.badge.green { background: #d1fae5; color: #047857; }
.badge.orange { background: #ffedd5; color: #c2410c; }
.badge.gray { background: #e5e7eb; color: #374151; }
.badge.sky { background: #e0f2fe; color: #0369a1; }
.badge.amber { background: #fef3c7; color: #b45309; }
.badge.purple { background: #ede9fe; color: #6d28d9; }
.badge.red { background: #fee2e2; color: #b91c1c; }

.tablewrap {
  overflow-x: auto;
}

.pager {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.pager a {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #0f172a;
}
.pager a.active {
  background: #0f62fe;
  border-color: #0f62fe;
  color: #fff;
}

.footer {
  text-align: center;
  padding: 20px 10px 30px;
  color: #6b7280;
  font-size: 14px;
}

html[data-theme="dark"] body {
  background: #0b1220;
  color: #e5e7eb;
}
html[data-theme="dark"] a {
  color: #93c5fd;
}
html[data-theme="dark"] .card {
  background: #0f172a;
  border-color: #1f2937;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.5);
}
html[data-theme="dark"] .sec input,
html[data-theme="dark"] .sec select,
html[data-theme="dark"] .sec textarea {
  background: #111827;
  color: #e5e7eb;
  border-color: #374151;
}
html[data-theme="dark"] .btn.ghost {
  color: #cbd5e1;
  border-color: #475569;
}
html[data-theme="dark"] .btn.light {
  background: #1f2937;
  border-color: #374151;
  color: #e5e7eb;
}
html[data-theme="dark"] .notice {
  background: #111827;
  border-color: #334155;
  color: #e5e7eb;
}
html[data-theme="dark"] .notice.error {
  background: #3f1d2e;
  border-color: #9f1239;
  color: #fecdd3;
}
html[data-theme="dark"] .notice.success {
  background: #052e16;
  border-color: #166534;
  color: #bbf7d0;
}
html[data-theme="dark"] th,
html[data-theme="dark"] td {
  border-bottom-color: #1f2937;
}
html[data-theme="dark"] th,
html[data-theme="dark"] tr:hover td {
  background: #111827;
}
html[data-theme="dark"] .pager a {
  border-color: #334155;
  color: #e5e7eb;
}
html[data-theme="dark"] .footer {
  color: #9ca3af;
}
