:root {
  --accent: #3b5bdb;
  --accent-dark: #2c46ad;
  --bg: #f4f5f8;
  --panel: #ffffff;
  --border: #dfe2ea;
  --text: #22242c;
  --text-light: #6b7080;
  --danger: #d64545;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app-header {
  position: relative;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px 0;
}

.gmail-status {
  position: absolute;
  top: 16px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gmail-status .btn {
  padding: 4px 10px;
  font-size: 12.5px;
}

.gmail-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}

.gmail-badge.disconnected { background: #eceef2; color: #666; }
.gmail-badge.configured { background: #fff3d6; color: #a3720a; }
.gmail-badge.connected { background: #dff5e3; color: #1f7a3a; }

.app-header h1 {
  margin: 0 0 12px;
  font-size: 20px;
}

.subtitle {
  font-size: 13px;
  color: var(--text-light);
  font-weight: normal;
  margin-left: 10px;
}

.tabs {
  display: flex;
  gap: 4px;
}

.tab-btn {
  padding: 10px 18px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

main {
  padding: 20px 24px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar input[type="text"], .toolbar select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}

.btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}

.btn:hover { background: #eceef4; }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn.primary:hover { background: var(--accent-dark); }

.btn.danger-text { color: var(--danger); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: top;
}

.data-table th {
  background: #f8f9fc;
  color: var(--text-light);
  font-weight: 600;
}

.data-table.small th, .data-table.small td {
  padding: 6px 8px;
  font-size: 12.5px;
}

.row-actions button {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  margin-right: 8px;
}

.row-actions button.danger { color: var(--danger); }

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #e8eaf2;
  color: var(--text);
}

.status-未接触 { background: #eceef2; color: #666; }
.status-説明会参加 { background: #e1f0ff; color: #1868b8; }
.status-エントリー { background: #e6e3fb; color: #4b3fa8; }
.status-選考中 { background: #fff3d6; color: #a3720a; }
.status-内定 { background: #dff5e3; color: #1f7a3a; }
.status-接触済み { background: #e1f0ff; color: #1868b8; }
.status-日程調整中 { background: #fff3d6; color: #a3720a; }
.status-確定 { background: #dff5e3; color: #1f7a3a; }
.status-辞退 { background: #fbe4e4; color: #a83a3a; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,22,30,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-overlay.hidden { display: none; }

.hidden { display: none; }

.modal {
  background: var(--panel);
  border-radius: 10px;
  padding: 22px 26px;
  width: 480px;
  max-width: 92vw;
  max-height: 88vh;
  overflow-y: auto;
}

.modal.wide { width: 700px; }

.modal h2 { margin-top: 0; font-size: 17px; }

#modal-form label, .campaign-form label {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-light);
}

#modal-form input, #modal-form select, #modal-form textarea,
.campaign-form input, .campaign-form select, .campaign-form textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.campaign-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  align-items: start;
}

.campaign-form, .campaign-side {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.hint { font-size: 12.5px; color: var(--text-light); }
.hint code { background: #eceef4; padding: 1px 5px; border-radius: 4px; }

.contact-checklist {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin-bottom: 14px;
  background: #fafbfd;
}

.contact-checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text);
  padding: 4px 0;
  margin: 0;
}

.contact-checklist input { width: auto; margin: 0; }

.preview-box {
  white-space: pre-wrap;
  background: #fafbfd;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 13px;
  min-height: 120px;
  margin-bottom: 20px;
}

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

#export-json-text {
  width: 100%;
  font-family: Consolas, monospace;
  font-size: 12px;
}

.settings-panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 20px 24px;
  max-width: 720px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.settings-panel h2 { margin-top: 0; }

.settings-panel label {
  display: block;
  margin: 16px 0 6px;
  font-size: 13px;
  color: var(--text-light);
}

.settings-panel input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}

.setup-steps {
  font-size: 13.5px;
  line-height: 1.7;
  padding-left: 20px;
}

.setup-steps li { margin-bottom: 6px; }

.history-list {
  max-height: 60vh;
  overflow-y: auto;
}

.history-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 10px;
  background: #fafbfd;
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.history-item p {
  margin: 4px 0 0;
  font-size: 13.5px;
}

.help-panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 24px 28px 32px;
  max-width: 780px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  line-height: 1.75;
}

.help-panel h2 {
  margin-top: 0;
  font-size: 19px;
}

.help-panel h3 {
  margin-top: 30px;
  margin-bottom: 8px;
  font-size: 15px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.help-panel p { font-size: 14px; }

.help-callout {
  background: #eef2ff;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 14px;
}

.help-callout.warning {
  background: #fff8e6;
  border-left-color: #e0a020;
}

.help-steps {
  font-size: 14px;
  padding-left: 22px;
  margin: 8px 0;
}

.help-steps li { margin-bottom: 8px; }

.help-faq { margin: 8px 0 0; }

.help-faq dt {
  font-weight: 600;
  font-size: 14px;
  margin-top: 16px;
  color: var(--text);
}

.help-faq dd {
  margin: 4px 0 0;
  padding-left: 16px;
  border-left: 2px solid var(--border);
  font-size: 13.5px;
  color: #4a4d59;
}

.help-faq code, .help-panel code {
  background: #eceef4;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12.5px;
}
