/* ヨミトキ SPA 共通スタイル
 * コーポレートサイト（site2/ / design/01_design_system.md）のカラーパレットを踏襲
 */

:root {
  --navy: #10243B;
  --beige: #F5EFE6;
  --coral: #E5705B;
  --purple: #6C48A3;
  --purple-light: #f2edf7;
  --green: #3CB371;
  --amber: #D49A28;
  --red: #D63B3B;
  --gray-100: #f7f7f7;
  --gray-300: #ddd;
  --gray-600: #666;
  --gray-800: #333;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --radius: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Noto Sans JP", system-ui, sans-serif;
  color: var(--navy);
  background: var(--beige);
  line-height: 1.6;
}

a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== レイアウト ===== */

.app-header {
  background: var(--navy);
  color: white;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.app-header .brand {
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 0.05em;
}
.app-header .brand::before {
  content: "🔍 ";
}
.app-header nav a {
  color: white;
  margin: 0 8px;
  font-size: 13px;
  opacity: 0.85;
}
.app-header nav a:hover { opacity: 1; }
.app-header .user-chip {
  font-size: 12px;
  background: rgba(255,255,255,0.1);
  padding: 6px 12px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.app-header .user-chip small { opacity: 0.7; }
.app-header .logout-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 8px;
  font-family: inherit;
}
.app-header .logout-btn:hover { background: rgba(255,255,255,0.1); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 17px; color: var(--purple); margin: 24px 0 12px; }
h3 { font-size: 14px; color: var(--navy); }

/* ===== カード ===== */

.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 16px;
}

.card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.kpi {
  background: white;
  padding: 16px;
  border-radius: var(--radius);
  border-left: 4px solid var(--purple);
}
.kpi-label { font-size: 12px; color: var(--gray-600); }
.kpi-value { font-size: 26px; font-weight: bold; margin-top: 4px; }

/* ===== ボタン ===== */

.btn {
  background: var(--purple);
  color: white;
  border: 0;
  padding: 10px 18px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: #4f3580; text-decoration: none; color: white; }
.btn.secondary { background: var(--coral); }
.btn.secondary:hover { background: #c85e4b; color: white; }
.btn.ghost { background: transparent; color: var(--purple); border: 1px solid var(--purple); }
.btn.ghost:hover { background: var(--purple-light); color: var(--purple); }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #b02e2e; color: white; }

/* ===== フォーム ===== */

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12px; color: var(--gray-600); margin-bottom: 4px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}
.form-row input:focus, .form-row select:focus { outline: 2px solid var(--purple); outline-offset: -1px; }

/* ===== テーブル ===== */

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 8px 12px; text-align: left; border-bottom: 1px solid #eee; }
table.tbl th { background: var(--purple-light); color: var(--purple); font-weight: 600; }
table.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl tr:hover td { background: var(--gray-100); }

/* ===== バッジ・タグ ===== */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
}
.badge-role-PLATFORM_ADMIN { background: var(--navy); color: white; }
.badge-role-COMPANY_ADMIN { background: var(--purple); color: white; }
.badge-role-EMPLOYEE { background: var(--gray-300); color: var(--gray-800); }

/* ===== アラート ===== */

.alert {
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 12px;
}
.alert.error { background: #fff0f0; color: var(--red); border-left: 3px solid var(--red); }
.alert.info  { background: var(--purple-light); color: var(--purple); border-left: 3px solid var(--purple); }
.alert.success { background: #f1faf4; color: var(--green); border-left: 3px solid var(--green); }

/* ===== ログイン画面固有 ===== */

.login-wrap {
  min-height: calc(100vh - 50px);
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-box {
  background: white;
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  max-width: 400px;
  width: 100%;
}
.login-box h1 {
  text-align: center;
  color: var(--purple);
  margin-bottom: 24px;
}
.login-box .credentials-hint {
  font-size: 11px;
  color: var(--gray-600);
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--gray-300);
}
.login-box .credentials-hint code {
  background: var(--gray-100);
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 10px;
}

/* ===== 空状態 ===== */

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--gray-600);
}

/* ===== ユーティリティ ===== */

.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-gap { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mono { font-family: "Consolas", monospace; font-size: 12px; }
.muted { color: var(--gray-600); font-size: 12px; }
