:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --line: #d9e0e4;
  --text: #152027;
  --muted: #64727c;
  --accent: #0f766e;
  --accent-dark: #115e59;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Yu Gothic", "Meiryo", system-ui, sans-serif;
  font-size: 14px;
}

a {
  color: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px 1fr;
}

.sidebar {
  background: #17242b;
  color: #edf5f3;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  padding: 4px 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .16);
}

nav {
  display: grid;
  gap: 4px;
}

nav a {
  text-decoration: none;
  color: #c9d6d8;
  padding: 10px 12px;
  border-radius: 6px;
}

nav a.active,
nav a:hover {
  background: #0f766e;
  color: #ffffff;
}

.ghost {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .22);
  background: transparent;
  color: #edf5f3;
  border-radius: 6px;
  padding: 9px 10px;
  cursor: pointer;
}

.content {
  padding: 28px;
  min-width: 0;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.page-header h1 {
  margin: 2px 0 0;
  font-size: 26px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}

button,
.button-link {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 10px 16px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.button-link.secondary {
  background: #54616a;
}

button:hover,
.button-link:hover {
  background: var(--accent-dark);
}

.table-wrap,
.detail-list,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-wrap {
  overflow: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: #fbfcfc;
}

.row-action {
  width: 72px;
  text-align: right;
}

.row-action a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.empty {
  padding: 28px;
  color: var(--muted);
}

.detail-list {
  padding: 6px 0;
}

.detail-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
  border-bottom: 0;
}

dt {
  color: var(--muted);
  font-weight: 700;
}

dd {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(420px, 100%);
  padding: 28px;
}

.login-panel h1 {
  margin: 0;
  font-size: 28px;
}

.login-panel p {
  color: var(--muted);
  margin: 4px 0 22px;
}

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

.form-stack label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.alert {
  margin-bottom: 14px;
  border: 1px solid #f3b4b4;
  background: #fff4f4;
  color: #9f1239;
  border-radius: 6px;
  padding: 10px 12px;
}

.alert.ok {
  border-color: #a7e3cf;
  background: #effcf7;
  color: #0f766e;
}

.edit-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.edit-form.compact {
  grid-template-columns: 1fr;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.form-actions {
  grid-column: 1 / -1;
}

.form-actions.split {
  display: flex;
  gap: 10px;
}

.proposal-form {
  align-items: start;
}

.form-block {
  display: grid;
  gap: 12px;
}

.form-block h2 {
  margin: 0;
  font-size: 18px;
}

.choice-list {
  display: grid;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.choice-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fff;
}

.choice-row input {
  width: auto;
  margin-top: 3px;
}

.choice-row span {
  display: grid;
  gap: 3px;
}

.choice-row small {
  color: var(--muted);
  font-weight: 400;
}

.work-section {
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.work-section h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.mail-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
}

.hidden-field {
  display: none;
}

.attachment-list {
  display: grid;
  gap: 8px;
}

.attachment-list a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.attachment-list span,
.muted {
  color: var(--muted);
  font-weight: 400;
}

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

  .sidebar {
    position: static;
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content {
    padding: 18px;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .edit-form {
    grid-template-columns: 1fr;
  }
}
