:root {
  --ink: #082235;
  --muted: #4d6270;
  --line: #bfd0d9;
  --page: #eef5f6;
  --panel: #ffffff;
  --brand: #114c60;
  --brand-2: #176f93;
  --danger: #af3f35;
  --success: #0f7a58;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  background: var(--brand);
  color: #fff;
}

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

.brand-mark {
  width: 40px;
  height: 40px;
  border: 2px solid #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: 0 0 auto;
}

.brand-text {
  display: grid;
  gap: 2px;
  text-decoration: none;
}

.brand-text small,
.user-bar,
.app-footer,
.page-heading p,
.action-grid span,
.demo-note,
.field-note {
  color: var(--muted);
}

.app-shell .brand-text small,
.app-shell .user-bar {
  color: #e9f5f8;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.95rem;
}

.user-bar a {
  color: #fff;
  font-weight: 700;
}

.main-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.main-tabs a {
  text-align: center;
  padding: 18px 10px;
  text-decoration: none;
  font-weight: 700;
  border-right: 1px solid #d8e3e8;
}

.guest-line {
  height: 8px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.page-container {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 48px;
}

h1 {
  margin: 0 0 8px;
  font-size: 1.85rem;
  font-weight: 800;
}

h2 {
  margin: 26px 0 14px;
  font-size: 1.35rem;
  font-weight: 800;
}

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

.page-heading p {
  margin: 0;
}

.alert-heading {
  border-left: 5px solid var(--danger);
  padding-left: 16px;
}

.primary-command,
.secondary-command,
.danger-command {
  min-height: 44px;
  min-width: 88px;
  border: 1px solid var(--brand-2);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.primary-command {
  background: var(--brand-2);
  color: #fff;
}

.secondary-command {
  background: #fff;
  color: var(--ink);
}

.danger-command {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.full {
  width: 100%;
}

.summary-grid,
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.summary-card,
.action-grid a,
.input-sheet,
.table-wrap,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.summary-card {
  border-top: 5px solid var(--brand-2);
  padding: 20px;
}

.summary-card span,
.action-grid span {
  display: block;
}

.summary-card strong {
  display: block;
  margin-top: 12px;
  font-size: 2.1rem;
}

.action-grid a {
  border-left: 5px solid var(--success);
  padding: 20px;
  text-decoration: none;
}

.search-band {
  display: grid;
  grid-template-columns: minmax(220px, 420px) 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #9fb5c0;
  border-radius: 4px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

.input-sheet {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 22px;
  border-top: 5px solid var(--brand-2);
}

.exception-sheet {
  border-top-color: var(--danger);
}

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

.field {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.span-two {
  grid-column: 1 / -1;
}

.check-field {
  align-content: center;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
}

.check-field input {
  width: 22px;
  height: 22px;
}

.field-note,
.validation {
  font-size: 0.85rem;
  color: var(--danger);
  font-weight: 400;
}

.form-actions {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.data-grid {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.data-grid th,
.data-grid td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

.data-grid th {
  background: #e6f0f3;
  border-bottom: 2px solid #8fb0bd;
}

.message {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-left: 5px solid var(--brand-2);
  background: #e9f7f2;
}

.message.error,
.validation-summary-errors {
  border-left-color: var(--danger);
  background: #fdebea;
  color: #8a261f;
}

.message.success {
  border-left-color: var(--success);
  background: #e9f7f2;
  color: #07533b;
}

.login-panel {
  width: min(440px, 100%);
  margin: 42px auto;
  padding: 24px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.login-brand .brand-mark {
  border-color: var(--brand);
  color: var(--brand);
}

.app-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 24px;
  font-size: 0.85rem;
}

@media (max-width: 940px) {
  .main-tabs {
    grid-template-columns: repeat(3, 1fr);
  }

  .summary-grid,
  .action-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .app-shell,
  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .main-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    grid-template-columns: repeat(5, 1fr);
  }

  .main-tabs a {
    padding: 10px 4px;
    font-size: 0.78rem;
  }

  .page-container {
    margin-bottom: 92px;
  }

  .search-band,
  .field-grid {
    grid-template-columns: 1fr;
  }
}
