:root {
  --navy: #0b1f3a;
  --navy2: #102f57;
  --gold: #b89145;
  --bg: #f4f7fb;
  --white: #ffffff;
  --text: #142033;
  --muted: #64748b;
  --line: #d8e1ee;
  --green: #087f5b;
  --red: #c92a2a;
  --amber: #b7791f;
  --blue: #1d4ed8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "BIZ UDPGothic", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.header {
  background: linear-gradient(135deg, var(--navy), var(--navy2));
  color: var(--white);
  padding: 22px 28px;
  border-bottom: 5px solid var(--gold);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.brand-small {
  color: #d9e5f5;
  font-size: 13px;
  letter-spacing: .04em;
}

.header h1 {
  margin: 6px 0;
  font-size: clamp(22px, 3vw, 34px);
}

.header p {
  margin: 0;
  color: #d8e2f0;
  line-height: 1.65;
  font-size: 14px;
}

/* ==========================================
   共通レイアウト
========================================== */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px;
}

/* ==========================================
   HOME画面
========================================== */
.home-container {
  max-width: 850px;
  margin: 0 auto;
  padding: 22px;
}

.login-card {
  max-width: 520px;
  margin: 60px auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 12px 36px rgba(10, 31, 58, .12);
}

.login-card h2 {
  margin-top: 0;
}

.input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: white;
  font-size: 14px;
  margin: 7px 0 12px;
}

label {
  font-weight: 700;
  font-size: 13px;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  background: #e8eef6;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 4px 4px 0;
}

.btn:hover {
  opacity: .88;
}

.btn-primary {
  background: var(--navy);
  color: white;
}

.btn-gold {
  background: var(--gold);
  color: white;
}

.btn-green {
  background: var(--green);
  color: white;
}

.btn-red {
  background: var(--red);
  color: white;
}

.btn-outline {
  background: white;
  border: 1px solid var(--line);
}

.notice {
  background: #ecfdf5;
  border: 1px solid #b7ead8;
  color: #065f46;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 800;
  margin-bottom: 16px;
}

.warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 700;
  margin-bottom: 16px;
}

.layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 20px;
}

.sidebar,
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 4px 16px rgba(10, 31, 58, .05);
}

.sidebar {
  padding: 16px;
  align-self: start;
  position: sticky;
  top: 14px;
}

.user-box {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
}

.user-name {
  font-weight: 900;
}

.user-role {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.nav-button {
  width: 100%;
  display: block;
  text-align: left;
  border: 0;
  border-radius: 14px;
  background: transparent;
  padding: 13px 14px;
  cursor: pointer;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text);
}

.nav-button:hover {
  background: #f1f5f9;
}

.nav-button.active {
  background: var(--navy);
  color: white;
}

.card {
  padding: 20px;
  margin-bottom: 18px;
}

.card h2 {
  margin: 0 0 16px;
  color: var(--navy);
  border-left: 5px solid var(--gold);
  padding-left: 10px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: white;
}

.item h3 {
  margin: 10px 0;
  color: var(--navy);
}

.item p {
  color: var(--muted);
  line-height: 1.65;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  background: #eef2f7;
  color: #334155;
  margin: 2px;
}

.badge-blue {
  background: #dbeafe;
  color: var(--blue);
}

.badge-green {
  background: #dcfce7;
  color: #166534;
}

.badge-red {
  background: #fee2e2;
  color: var(--red);
}

.badge-amber {
  background: #fef3c7;
  color: var(--amber);
}

.badge-gold {
  background: #fff4dc;
  color: #79570d;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  background: #f8fafc;
  color: var(--navy);
  font-weight: 900;
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.chat-window {
  max-height: 360px;
  overflow: auto;
  background: #f8fafc;
  border-radius: 16px;
  padding: 14px;
  border: 1px solid var(--line);
}

.message {
  border: 1px solid var(--line);
  background: white;
  padding: 11px 13px;
  border-radius: 15px;
  margin: 10px 0;
  max-width: 82%;
  line-height: 1.65;
}

.message.mine {
  margin-left: auto;
  background: var(--navy);
  color: white;
}

.message-meta {
  font-size: 12px;
  opacity: .75;
  margin-bottom: 5px;
}

.split2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.split3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.footer-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  margin-top: 20px;
}

.required {
  color: var(--red);
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .grid,
  .split2,
  .split3 {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 14px;
  }
}

.login-card {
  display: none !important;
}

button {
  background: #1d4ed8;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  margin: 2px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.2s;
}

button:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

body {
  padding-top: 60px;
}

/* ==========================================
   共通カード
========================================== */
.seminar-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  border: 1px solid #e5e7eb;
  transition: 0.2s;
}

.seminar-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
}

.seminar-title {
  font-size: 18px;
  font-weight: bold;
  color: #0b1f3a;
  margin-bottom: 10px;
}

.seminar-info {
  margin-bottom: 6px;
  color: #374151;
}

.seminar-description {
  margin-top: 12px;
  margin-bottom: 16px;
  line-height: 1.7;
  color: #4b5563;
}

/* ==========================================
   マイページ
========================================== */

.mypage-container {
  max-width: 850px;
  margin: 0 auto;
  padding: 22px;
}

@media screen and (max-width: 768px) {

  body {
    padding-top: 120px !important;
    padding-bottom: 40px !important;
  }

  button {
    font-size: 13px;
    padding: 8px 10px;
  }

  .seminar-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  div[style*="bottom: 20px"] {
    position: static !important;
    margin-top: 20px !important;
    width: auto !important;
  }

}

.mobile-menu-button {
  display: none;
}

@media screen and (max-width: 768px) {

  .mobile-menu-button {
    display: inline-block;
    font-size: 22px;
    padding: 6px 12px;
  }

  .desktop-menu {
    display: none;
  }

  .mobile-menu-panel {
    display: none;
    width: 100%;
    margin-top: 10px;
  }

  .mobile-menu-panel.show {
    display: block;
  }

  .mobile-menu-panel button {
    width: 100%;
    margin-bottom: 6px;
    text-align: left;
  }

}

.mobile-menu-panel {
  display: none;
}

@media print {

  button {
    display: none !important;
  }

  header {
    display: none !important;
  }

  body {
    background: white !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  main {
    margin: 0 !important;
    padding: 0 !important;
  }

  .receipt-print {
    width: 180mm !important;
    min-height: 250mm !important;
    margin: 10mm auto !important;
    box-shadow: none !important;
    page-break-after: always;
  }

}

@media screen and (max-width: 768px) {

  #statusBox {
    position: fixed !important;
    top: 110px !important;
    right: 10px !important;
    max-width: 220px !important;
    font-size: 12px !important;
    z-index: 9000 !important;
  }

  #headerMenu {
    padding-right: 10px !important;
  }

}

@media screen and (max-width: 768px) {

  header button {
    font-size: 12px !important;
    padding: 6px 8px !important;
    margin: 3px !important;
  }

  #statusBox {
    position: fixed !important;
    top: 120px !important;
    right: 8px !important;
    max-width: 200px !important;
    font-size: 11px !important;
    z-index: 9999 !important;
  }

}

@media screen and (max-width: 768px) {

  #headerMenu {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    padding: 8px !important;
    box-sizing: border-box !important;
    overflow-x: auto !important;
    white-space: normal !important;
  }

  #headerMenu b {
    display: block !important;
    margin-bottom: 6px !important;
    font-size: 14px !important;
  }

  #headerMenu button {
    font-size: 11px !important;
    padding: 5px 7px !important;
    margin: 2px !important;
  }

  #statusBox {
    position: static !important;
    margin: 8px 12px 12px 12px !important;
    max-width: none !important;
    font-size: 12px !important;
    z-index: auto !important;
  }
}

.dashboard-title {
  font-size: 16px;
  white-space: nowrap;
  line-height: 1.2;
}

.dashboard-number {
  font-size: 32px;
  font-weight: bold;
}

.dashboard-number-orange {
  color: #d97706;
}

.form-group {
    margin-top: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
}

/* ==========================================
   メール送信画面
========================================== */

label {
  display: inline-block;
  margin-bottom: 6px;
  font-weight: bold;
}

textarea {
  padding: 10px;
  font-size: 16px;
  box-sizing: border-box;
}

/* メール送信画面の件名入力欄 */
#mailSubject {
  display: block;
  width: 100%;
  height: 42px;
  padding: 8px 10px;
  border: 1px solid #b8c4d6;
  border-radius: 10px;
  background-color: #ffffff;
  box-sizing: border-box;
  font-size: 16px;
  appearance: none;
}

/* 件名欄を選択したとき */
#mailSubject:focus {
  border: 2px solid #2563eb;
  outline: none;
}

/* ============================================
   管理メニュー
============================================ */

.admin-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.admin-menu button {
  padding: 12px;
}

/* ============================================
   資料管理画面
============================================ */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
}