/* ===================================================
   Aegis dashboard — 補助スタイル（site style.css と併用）
   =================================================== */

/* ===== ページヘッド（タイトル+ユーザー情報） ===== */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.page-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #555;
  background: #fff;
  border-radius: 30px;
  padding: 5px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.page-user img.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}
.logout-link {
  color: #555;
  font-size: 0.8rem;
  text-decoration: none;
  border-left: 1px solid #eee;
  padding-left: 10px;
  transition: color 0.15s;
}
.logout-link:hover { color: #ef4444; }

/* ===== ログイン ===== */
.login-body { display: block; }
.login-card {
  max-width: 420px;
  margin: 40px auto;
  background: #fff;
  border-radius: 16px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(15,23,42,0.08);
  border-left: 5px solid #2c7be5;
}
.login-logo { font-size: 44px; margin-bottom: 8px; }
.login-card h1 { font-size: 1.5rem; margin-bottom: 4px; color: #1e293b; }
.login-card .sub { color: #64748b; font-size: 0.9rem; margin-bottom: 24px; }
.btn-discord {
  display: block;
  background: #5865F2;
  color: #fff;
  padding: 13px;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.15s;
}
.btn-discord:hover { background: #4752C4; }

.discord-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: #5865F2;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  margin-top: 10px;
  transition: background 0.2s;
  font-family: inherit;
}
.discord-btn:hover { background: #4752C4; }
.login-note { font-size: 0.75rem; color: #64748b; margin-top: 18px; }

/* ===== サーバー一覧 ===== */
.server-list { display: flex; flex-direction: column; gap: 10px; }
.server-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  padding: 16px 20px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15,23,42,0.07);
  cursor: pointer;
  border-left: 5px solid #2c7be5;
  transition: transform 0.12s, box-shadow 0.12s;
}
.server-card:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(15,23,42,0.12); }
.server-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  overflow: hidden;
  flex-shrink: 0;
}
.server-icon img { width: 100%; height: 100%; object-fit: cover; }
.server-icon-default svg { width: 58%; height: 58%; }
.server-info { flex: 1; min-width: 0; }
.server-name { font-weight: 700; font-size: 1rem; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-meta { font-size: 0.8rem; color: #64748b; }
.server-owner { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 0.85rem; color: #334155; }
.owner-icon { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.owner-icon-default { background: #5865F2; }
.owner-name { font-weight: 600; }
.owner-id { color: #94a3b8; }

/* ===== 詳細ヘッダ ===== */
.server-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 16px 20px;
}
.server-head .server-icon { width: 52px; height: 52px; font-size: 1.4rem; }
.server-head .server-name { font-size: 1.1rem; }

/* ===== タブ ===== */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.tab {
  flex: 1;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #64748b;
  border-radius: 10px;
  padding: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.tab:hover { border-color: #2c7be5; color: #2c7be5; }
.tab.active { background: #2c7be5; border-color: #2c7be5; color: #fff; }
.tab-panel { display: block; }
.tab-panel[hidden] { display: none !important; }
.toolbar { margin-bottom: 12px; }

/* ===== 設定フォーム（site の .section を使うため最小限） ===== */
.form-group {
  background: #fff;
  padding: 16px 20px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15,23,42,0.07);
  margin-bottom: 14px;
  border-left: 5px solid #2c7be5;
}
.form-label {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  color: #1e293b;
}
.form-label .value {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
  background: #f1f5f9;
  padding: 1px 8px;
  border-radius: 20px;
}
.form-desc { font-size: 0.8rem; color: #64748b; margin-top: 4px; }

input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: #2c7be5; }
select option { background: #fff; }

.row { display: flex; gap: 8px; margin-top: 8px; }
.row input { flex: 1; }
.row button { flex-shrink: 0; }

.list-items { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 8px 6px 12px;
  font-size: 0.85rem;
  word-break: break-all;
}
.list-item .text { flex: 1; }
.list-item .x {
  background: none;
  border: none;
  color: #64748b;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}
.list-item .x:hover { color: #ef4444; background: #fef2f2; }

/* トグルスイッチ */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #cbd5e1;
  border-radius: 30px;
  transition: 0.2s;
}
.slider::before {
  content: "";
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .slider { background: #22c55e; }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ===== ログ ===== */
.log-item {
  background: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(15,23,42,0.06);
  word-break: break-word;
}
.log-item .log-time { font-size: 0.75rem; color: #64748b; margin-bottom: 4px; }
.log-item .log-time .log-author { color: #2c7be5; font-weight: 500; }
.log-item .log-content { font-size: 0.9rem; white-space: pre-wrap; }
.log-empty { color: #64748b; text-align: center; padding: 40px 0; }

.audit-item {
  background: #f8fafc;
  border-left: 4px solid #2c7be5;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}
.audit-item .audit-time { color: #64748b; font-size: 0.75rem; }
.audit-item .audit-user { color: #2c7be5; font-weight: 500; }
.audit-item .audit-detail { margin-top: 2px; }

/* ===== トースト ===== */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(15,23,42,0.25);
  z-index: 999;
  max-width: 90vw;
  font-size: 0.9rem;
}
.toast.ok { border-left: 4px solid #22c55e; }
.toast.err { border-left: 4px solid #ef4444; }

.error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.loading { color: #64748b; text-align: center; padding: 40px 0; }
.mono { font-family: Consolas, "Courier New", monospace; }
.hint { font-size: 0.75rem; color: #64748b; margin-top: 6px; }
