:root {
  --ink: #17252c;
  --muted: #607178;
  --paper: #f7faf6;
  --line: #d8e3dc;
  --night: #04232d;
  --ocean: #063746;
  --green: #2f7d5e;
  --coral: #d76652;
  --gold: #ebb45e;
  --white: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #f8fbf7, #edf5ef);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  line-height: 1.7;
}

body:not(.is-authenticated) [data-dashboard],
body.is-anonymous [data-dashboard] {
  display: none !important;
}

body.is-authenticated [data-auth-panel] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--ocean);
  background: var(--gold);
  font-weight: 850;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.admin-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 56px;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 26px;
  border-radius: 10px;
  color: var(--white);
  background: linear-gradient(135deg, var(--night), var(--ocean));
}

.admin-hero span,
.panel-head span,
.admin-hero p {
  color: rgba(255, 255, 255, 0.72);
}

.admin-hero h1,
.panel h2 {
  margin: 4px 0 0;
  line-height: 1.35;
}

.admin-hero p {
  margin: 12px 0 0;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.14);
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.ghost-button.dark {
  color: var(--ocean);
  background: rgba(6, 55, 70, 0.08);
}

.secondary-button {
  color: var(--ocean);
  background: rgba(47, 125, 94, 0.12);
}

.danger-button {
  color: var(--white);
  background: var(--coral);
}

.text-button {
  padding: 7px 12px;
  color: var(--green);
  background: rgba(47, 125, 94, 0.1);
  font-size: 0.86rem;
}

.panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(4, 35, 45, 0.08);
}

.roadmap-panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(241, 248, 244, 0.98));
}

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

.roadmap-grid article {
  display: grid;
  gap: 8px;
  min-height: 178px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.roadmap-grid article > span {
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 950;
}

.roadmap-grid h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
}

.roadmap-grid p,
.privacy-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.privacy-note {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(215, 102, 82, 0.28);
  border-radius: 10px;
  background: rgba(255, 247, 242, 0.86);
}

.privacy-note strong {
  color: var(--coral);
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  max-width: 520px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 850;
}

input,
select,
textarea {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
}

textarea {
  resize: vertical;
}

.notice {
  min-height: 1.5em;
  color: var(--coral);
  font-weight: 850;
}

.dashboard {
  display: grid;
  gap: 18px;
}

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

.stat-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.stat-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.stat-card strong {
  display: block;
  margin-top: 4px;
  color: var(--green);
  font-size: 1.9rem;
  line-height: 1.1;
}

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

.panel-head span {
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
}

.table-title-cell {
  min-width: 280px;
}

.table-title-cell strong,
.table-title-cell small,
td small {
  display: block;
}

.table-title-cell small,
td small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(47, 125, 94, 0.12);
  font-size: 0.82rem;
  font-weight: 900;
}

.status-pill.is-new {
  color: var(--coral);
  background: rgba(215, 102, 82, 0.12);
}

.status-pill.is-approved {
  color: var(--white);
  background: var(--green);
}

.status-pill.is-rejected {
  color: var(--white);
  background: var(--coral);
}

.submission-detail,
.member-editor {
  border-color: rgba(47, 125, 94, 0.28);
}

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

.detail-item {
  display: grid;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfb;
  font-weight: 850;
}

.detail-item.full {
  grid-column: 1 / -1;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.detail-item legend {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.detail-item strong,
.detail-item p {
  display: block;
  margin: 4px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-item input,
.detail-item select,
.detail-item textarea {
  margin-top: 6px;
  background: var(--white);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.member-form {
  display: grid;
  gap: 14px;
}

.tag-field {
  margin: 0;
}

.tag-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.tag-checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  font-size: 0.86rem;
  font-weight: 850;
}

.tag-checkbox-grid input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--green);
}

.tag-checkbox-grid span {
  color: var(--ink);
  font-size: inherit;
}

.content-form {
  display: grid;
  gap: 14px;
}

.check-item input {
  width: 22px;
  min-height: 22px;
  margin-top: 12px;
  accent-color: var(--green);
}

.content-preview {
  margin-top: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7fbf7;
}

.preview-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--coral);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.content-preview article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.content-preview h3 {
  margin: 8px 0;
  font-size: 1.05rem;
}

.content-preview p {
  margin: 0;
  color: var(--muted);
}

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

.content-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.content-list h3 {
  margin: 0;
  padding: 12px 14px;
  background: #f1f7f3;
}

.content-list ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.content-list li {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.content-list small {
  display: block;
  color: var(--muted);
  font-weight: 850;
}

.live-monitor-panel {
  border-color: rgba(6, 55, 70, 0.18);
}

.live-health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.live-health-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfb;
}

.live-health-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.live-health-card strong {
  display: block;
  margin-top: 4px;
  color: var(--green);
  font-size: 1.22rem;
  line-height: 1.3;
}

.live-health-card.alert strong {
  color: var(--coral);
}

.live-item-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.live-item-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.live-item-card.alert {
  border-color: rgba(215, 102, 82, 0.32);
  background: rgba(255, 247, 242, 0.86);
}

.live-item-card h3,
.live-item-card p {
  margin: 0;
}

.live-item-card p {
  color: var(--muted);
  font-size: 0.9rem;
}

.live-item-card a {
  width: fit-content;
  color: var(--green);
  font-weight: 900;
  text-decoration: none;
}

.live-detail-list {
  display: grid;
  max-height: 142px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.live-detail-list p {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid rgba(216, 227, 220, 0.72);
  color: var(--ink);
}

.live-detail-list strong {
  color: var(--green);
  font-size: 0.82rem;
}

.live-detail-list strong.alert {
  color: var(--coral);
}

@media (max-width: 760px) {
  .admin-hero,
  .panel-head {
    display: grid;
  }

  .admin-actions {
    justify-content: flex-start;
  }

  .stat-grid,
  .content-grid,
  .live-health-grid,
  .live-item-grid,
  .detail-grid,
  .tag-checkbox-grid,
  .roadmap-grid {
    grid-template-columns: 1fr;
  }

  .roadmap-grid article {
    min-height: auto;
  }
}
