* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #eef2f7;
  color: #333;
  min-height: 100vh;
}

/* ====== ログインページ ====== */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
}

.login-box h1 {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 8px;
  text-align: center;
}

.login-box p {
  font-size: 13px;
  color: #999;
  margin-bottom: 28px;
  text-align: center;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: #555;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4a6cf7;
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: 11px;
  color: #999;
  margin-top: 3px;
}

.form-actions {
  margin-top: 22px;
}

button[type="submit"],
.btn-primary {
  width: 100%;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: #4a6cf7;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  margin-top: 8px;
}

button[type="submit"]:hover,
.btn-primary:hover {
  background: #3b5de7;
}

button[type="submit"]:disabled,
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error-msg {
  margin-top: 16px;
  padding: 12px;
  background: #ffebee;
  border: 1px solid #ef9a9a;
  border-radius: 6px;
  color: #c62828;
  font-size: 14px;
  display: none;
  text-align: center;
}

/* ====== 管理画面（admin.html） ====== */
body.admin-page {
  background: #f5f7fa;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

header h1 {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a2e;
}

header .logout-btn {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #e53935;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

header .logout-btn:hover {
  background: #c62828;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link {
  display: inline-block;
  padding: 8px 16px;
  color: #fff;
  background: #4a6cf7;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.nav-link:hover {
  background: #3b5de7;
}

.main-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.left-panel {
  flex: 0 0 38%;
  min-width: 300px;
}

.right-panel {
  flex: 1;
  min-width: 340px;
  position: sticky;
  top: 24px;
}

.panel-title {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #4a6cf7;
}

.broadcast-list {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  max-height: 78vh;
  overflow-y: auto;
}

.broadcast-item {
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  cursor: default;
  transition: background 0.15s;
}

.broadcast-item:last-child {
  border-bottom: none;
}

.broadcast-item:hover {
  background: #f8f9ff;
}

.broadcast-item .bi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.broadcast-item .bi-title {
  font-weight: 700;
  font-size: 14px;
  color: #1a1a2e;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.bi-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.bi-ref-btn,
.bi-delete-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.bi-ref-btn {
  background: #e8f0fe;
  color: #1a56db;
  border-color: #b6d4fe;
}

.bi-ref-btn:hover {
  background: #d0e2ff;
  border-color: #8bb8f8;
}

.bi-delete-btn {
  background: #fff;
  color: #c62828;
  border-color: #ef9a9a;
}

.bi-delete-btn:hover {
  background: #ffebee;
  border-color: #e57373;
}

.broadcast-item .bi-message {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.broadcast-item .bi-link {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: #4a6cf7;
  word-break: break-all;
}

.broadcast-item .bi-meta {
  font-size: 11px;
  color: #999;
  margin-top: 6px;
}

.no-broadcasts {
  padding: 28px 16px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

.result-area {
  margin-top: 20px;
  padding: 16px;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 8px;
}

.result-area h2 {
  font-size: 16px;
  color: #2e7d32;
  margin-bottom: 10px;
}

.result-area #resultMessage {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.result-area #resultDetails {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}

.error-area {
  margin-top: 20px;
  padding: 16px;
  background: #ffebee;
  border: 1px solid #ef9a9a;
  border-radius: 8px;
}

.error-area h2 {
  font-size: 16px;
  color: #c62828;
  margin-bottom: 10px;
}

.error-area #errorMessage {
  font-size: 13px;
  line-height: 1.5;
  color: #b71c1c;
}

footer {
  margin-top: 36px;
  text-align: center;
  color: #999;
  font-size: 12px;
}

/* ====== 削除確認モーダル ====== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 420px;
  margin: 16px;
  overflow: hidden;
}

.modal-header {
  padding: 18px 20px 12px;
  border-bottom: 1px solid #eee;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
}

.modal-body {
  padding: 20px;
  font-size: 14px;
  color: #555;
  line-height: 1.6;
}

.modal-warning {
  margin-top: 8px;
  font-size: 12px;
  color: #c62828;
  font-weight: 600;
}

.modal-footer {
  padding: 12px 20px 18px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-footer button {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.modal-footer .btn-cancel {
  background: #e0e0e0;
  color: #333;
}

.modal-footer .btn-cancel:hover {
  background: #cfcfcf;
}

.modal-footer .btn-delete {
  background: #e53935;
  color: #fff;
}

.modal-footer .btn-delete:hover {
  background: #c62828;
}

.modal-footer button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .main-layout {
    flex-direction: column-reverse;
  }
  .left-panel {
    flex: auto;
    width: 100%;
    min-width: 0;
  }
  .right-panel {
    flex: auto;
    width: 100%;
    min-width: 0;
    position: static;
  }
  .broadcast-list {
    max-height: 50vh;
  }
}
