/* ============================================================
   ダッシュボード（クライアント一覧）スタイル
   ============================================================ */
:root {
  --primary:      #1a73e8;
  --primary-dark: #1557b0;
  --success:      #34a853;
  --warning:      #fbbc04;
  --danger:       #ea4335;
  --bg:           #f0f4f8;
  --surface:      #ffffff;
  --border:       #e2e8f0;
  --text-main:    #1a202c;
  --text-sub:     #718096;
  --radius:       14px;
  --shadow:       0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:    0 8px 24px rgba(0,0,0,0.12);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Noto Sans JP', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-main);
  font-size: 14px;
  min-height: 100vh;
}

/* ヘッダー */
.dash-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 100;
}
.dash-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 18px; color: var(--primary);
}
.dash-logo i { font-size: 22px; }
.dash-logo span { color: var(--text-sub); font-size: 13px; font-weight: 400; margin-left: 4px; }
.btn-add-client {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 20px;
  background: var(--primary); color: white;
  border: none; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.btn-add-client:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,115,232,0.3); }

/* メイン */
.dash-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}
.dash-welcome {
  margin-bottom: 28px;
}
.dash-welcome h1 {
  font-size: 24px; font-weight: 800; color: var(--text-main);
  margin-bottom: 4px;
}
.dash-welcome p { font-size: 14px; color: var(--text-sub); }

/* クライアントグリッド */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* クライアントカード */
.client-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.25s;
  cursor: pointer;
  border: 1px solid var(--border);
  position: relative;
}
.client-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.client-card-accent {
  height: 5px;
  width: 100%;
}
.client-card-body { padding: 20px; }
.client-card-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.client-info { display: flex; flex-direction: column; gap: 4px; }
.client-name {
  font-size: 16px; font-weight: 700; color: var(--text-main);
}
.client-url {
  font-size: 12px; color: var(--text-sub);
  display: flex; align-items: center; gap: 4px;
}
.client-actions {
  display: flex; gap: 6px;
}
.btn-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-sub);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
}
.btn-icon:hover { background: var(--border); color: var(--text-main); }
.btn-icon.danger:hover { background: #fce8e6; color: var(--danger); border-color: var(--danger); }

/* KPIミニ */
.client-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.client-kpi {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
}
.client-kpi-label {
  font-size: 10px; color: var(--text-sub);
  font-weight: 600; margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.client-kpi-value {
  font-size: 18px; font-weight: 700;
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  line-height: 1.2;
}
.client-kpi-change {
  font-size: 10px; font-weight: 600;
  margin-top: 3px;
  display: flex; align-items: center; gap: 2px;
}
.client-kpi-change.up   { color: #1e7e34; }
.client-kpi-change.down { color: #c5221f; }
.client-kpi-change.flat { color: var(--text-sub); }

/* カード下部 */
.client-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.client-updated {
  font-size: 11px; color: var(--text-sub);
  display: flex; align-items: center; gap: 4px;
}
.btn-view-report {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  border-radius: 8px;
  border: none;
  font-size: 13px; font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-view-report:hover { opacity: 0.85; transform: translateY(-1px); }

/* ローディング・空状態 */
.card-loading {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 20px;
  color: var(--text-sub); gap: 8px;
}
.card-loading i { font-size: 24px; color: var(--primary); }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 24px;
  color: var(--text-sub);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; color: var(--border); display: block; }
.empty-state h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: var(--text-main); }

/* + 追加カード */
.add-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 20px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-sub); gap: 8px;
  min-height: 200px;
}
.add-card:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0f6ff;
}
.add-card i { font-size: 28px; }
.add-card span { font-size: 14px; font-weight: 600; }

/* モーダル */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center; justify-content: center;
  padding: 24px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%; max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: var(--text-sub);
  width: 32px; height: 32px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--bg); }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* フォーム */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 13px; font-weight: 600; color: var(--text-main);
  display: flex; align-items: center; gap: 4px;
}
.form-label .required { color: var(--danger); }
.form-input, .form-textarea {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--surface);
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}
.form-hint { font-size: 11px; color: var(--text-sub); }
.color-picker-row {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.color-dot {
  width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; border: 3px solid transparent;
  transition: all 0.15s;
}
.color-dot.selected { border-color: var(--text-main); transform: scale(1.15); }

.btn-primary {
  padding: 9px 20px; background: var(--primary); color: white;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary {
  padding: 9px 20px; background: var(--bg); color: var(--text-sub);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.btn-secondary:hover { background: var(--border); }

/* 削除確認モーダル */
.delete-modal-body {
  padding: 24px;
  text-align: center;
  display: flex; flex-direction: column; gap: 12px; align-items: center;
}
.delete-modal-body i { font-size: 40px; color: var(--danger); }
.delete-modal-body p { color: var(--text-sub); font-size: 14px; line-height: 1.6; }
.btn-danger {
  padding: 9px 20px; background: var(--danger); color: white;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer;
}

/* レスポンシブ */
@media (max-width: 600px) {
  .clients-grid { grid-template-columns: 1fr; }
  .dash-header-inner { padding: 0 16px; }
  .dash-main { padding: 20px 16px; }
}
