:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --line: #d7e0ec;
  --brand: #0b3a6f;
  --accent: #0ea5b7;
  --shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans JP", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(14, 165, 183, 0.14), transparent 35%),
    radial-gradient(circle at 88% 5%, rgba(11, 58, 111, 0.14), transparent 28%),
    var(--bg);
}

a {
  color: #0b5ac2;
}

.page {
  width: min(1140px, calc(100% - 40px));
  margin: 34px auto 56px;
}

.hero {
  background: linear-gradient(130deg, #0d2f55 0%, #0b3a6f 60%, #16508f 100%);
  color: #f8fafc;
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}

.hero h1 {
  margin: 8px 0 8px;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
}

.lead {
  margin: 0;
  color: #dbe7f6;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-top: 16px;
  padding: 18px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
}

.back-link {
  margin: 0;
}

.back-link span {
  margin: 0 6px;
  color: #94a3b8;
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.list-action-row {
  display: flex;
  justify-content: flex-end;
  margin: 0;
  flex: 0 0 auto;
}

.new-entry-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid #0b3a6f;
  border-radius: 8px;
  color: #fff;
  background: #0b3a6f;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 16px rgba(11, 58, 111, 0.16);
}

.new-entry-button:hover,
.new-entry-button:focus-visible {
  background: #124b86;
  text-decoration: none;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tabs a {
  text-decoration: none;
  border: 1px solid #c7d5e8;
  color: #214168;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.92rem;
  background: #f8fbff;
}

.tabs a.active {
  background: #0b3a6f;
  color: #fff;
  border-color: #0b3a6f;
}

.search-stats-row {
  display: grid;
  grid-template-columns: minmax(390px, 0.9fr) minmax(480px, 1.1fr);
  gap: 24px;
  align-items: center;
}

.policy-controls {
  display: grid;
  gap: 12px;
  align-content: center;
}

.search-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-content: start;
}

.search-form input[type="text"] {
  min-width: 260px;
  padding: 10px 12px;
  border: 1px solid #c5d2e4;
  border-radius: 10px;
  font-size: 0.95rem;
}

.search-form button {
  border: none;
  border-radius: 10px;
  background: #0b3a6f;
  color: #fff;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
}

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

.stat-card {
  min-width: 0;
  padding: 14px 18px;
  border: 1px solid #cbd9eb;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff 0%, #f5f9ff 100%);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07);
}

.stat-card.month {
  border-color: #b6dfe1;
  background: linear-gradient(145deg, #ffffff 0%, #f0fbfb 100%);
}

.stat-card p {
  margin: 0;
}

.stat-label {
  color: #365675;
  font-size: 1rem;
  font-weight: 700;
}

.stat-value {
  margin-top: 5px !important;
  color: #0b3a6f;
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.stat-card.month .stat-value {
  color: #087c87;
}

.stat-count {
  margin-top: 4px !important;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.stat-empty {
  margin-top: 12px !important;
  color: #64748b;
  font-size: 1.25rem;
  font-weight: 700;
}

.progress-track {
  height: 7px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce7f4;
}

.progress-fill {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0b3a6f, #2879c7);
}

.stat-card.month .progress-fill {
  background: linear-gradient(90deg, #0b8792, #20b8b2);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  border-bottom: 1px solid #e5edf7;
  padding: 10px 10px;
  text-align: left;
  font-size: 0.94rem;
  vertical-align: middle;
}

th {
  background: #f4f8fd;
  color: #264a75;
  font-weight: 700;
}

.sort-link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.sort-link:hover {
  color: #0b5ac2;
  text-decoration: underline;
}

tbody tr:hover {
  background: #fafcff;
}

.badge {
  display: inline-block;
  border: 1px solid #c9d8eb;
  background: #f4f8fd;
  color: #23466f;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge.warn {
  border-color: #f5c07a;
  background: #fff8ef;
  color: #9a5700;
}

.badge.ok {
  border-color: #8fd4ba;
  background: #effcf6;
  color: #11623f;
}

.badge.danger {
  border-color: #f0a3a3;
  background: #fff1f1;
  color: #9f1f1f;
}

.muted {
  color: var(--muted);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 22px 12px;
}

.alert {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid;
}

.alert p {
  margin: 0;
}

.alert.success {
  color: #0b5a2d;
  border-color: #96d4b2;
  background: #edf9f2;
}

.alert.error {
  color: #8a1f1f;
  border-color: #ebb1b1;
  background: #fff2f2;
}

@media (max-width: 860px) {
  .page {
    width: min(1140px, calc(100% - 24px));
    margin: 20px auto 28px;
  }

  .hero {
    padding: 24px 18px;
  }

  .panel {
    padding: 14px;
  }

  .panel-header-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .list-action-row {
    width: 100%;
  }

  .new-entry-button {
    width: 100%;
  }

  .search-stats-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .stats {
    grid-template-columns: 1fr;
  }

  .search-form input[type="text"] {
    min-width: 0;
    width: 100%;
  }
}
