/* Influencer OPS - Phase 1 styles */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --danger: #dc2626;
  --warning: #f59e0b;
  --success: #16a34a;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --sidebar-w: 220px;
  --radius: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--gray-50); color: var(--gray-900); font-size: 14px; }

/* レイアウト */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--gray-900); color: #fff; padding: 20px 0; position: fixed; height: 100vh; overflow-y: auto; }
.sidebar h2 { font-size: 15px; padding: 0 16px 16px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 8px; }
.sidebar a { display: flex; align-items: center; gap: 8px; padding: 10px 16px; color: rgba(255,255,255,.7); text-decoration: none; font-size: 13px; transition: .15s; }
.sidebar a:hover, .sidebar a.active { background: rgba(255,255,255,.1); color: #fff; }
.sidebar .user-info { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.1); margin-top: auto; position: absolute; bottom: 0; width: 100%; font-size: 12px; color: rgba(255,255,255,.5); }
.main { margin-left: var(--sidebar-w); flex: 1; padding: 24px; min-width: 0; overflow-x: hidden; }

/* ヘッダー */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-header h1 { font-size: 20px; }

/* カード */
.card { background: #fff; border-radius: var(--radius); border: 1px solid var(--gray-200); padding: 20px; margin-bottom: 16px; }
.card h3 { font-size: 14px; color: var(--gray-500); margin-bottom: 12px; }

/* 統計カード */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 16px; }
.stat-card .label { font-size: 12px; color: var(--gray-500); }
.stat-card .value { font-size: 28px; font-weight: 700; margin-top: 4px; }

/* テーブル */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--gray-200); font-size: 13px; }
th { background: var(--gray-50); font-weight: 600; color: var(--gray-700); white-space: nowrap; }
tr:hover { background: var(--gray-50); }

/* ボタン */
.btn { display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px; border: none; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; transition: .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 4px 8px; font-size: 12px; }
.btn-copy { background: var(--success); color: #fff; }
.btn-copy:hover { background: #15803d; }

/* バッジ */
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-paused { background: #fef3c7; color: #92400e; }
.badge-closed { background: var(--gray-100); color: var(--gray-500); }
.badge-ending { background: #fee2e2; color: #991b1b; }

/* モーダル */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); z-index: 1000; justify-content: center; align-items: flex-start; padding-top: 60px; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 560px; max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--gray-200); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { font-size: 16px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--gray-500); }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 8px; }

/* フォーム */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--gray-300); border-radius: 6px; font-size: 13px; }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* アラート */
.alert { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; }
.alert-warning { background: #fffbeb; border: 1px solid #fbbf24; color: #92400e; }
.alert-info { background: #eff6ff; border: 1px solid #93c5fd; color: #1e40af; }

/* テンプレプレビュー */
.template-preview { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 6px; padding: 14px; white-space: pre-wrap; font-size: 13px; line-height: 1.6; max-height: 300px; overflow-y: auto; }
.template-var { background: #fef3c7; padding: 1px 4px; border-radius: 3px; font-weight: 600; }

/* 定休日警告 */
.holiday-warning { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; padding: 8px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; }

/* リスト */
.list-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--gray-100); }
.list-item:last-child { border-bottom: none; }

/* レスポンシブ */
/* カンバン */
.kanban-board { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 16px; min-height: calc(100vh - 120px); }
.kanban-column { min-width: 220px; max-width: 220px; background: var(--gray-100); border-radius: var(--radius); padding: 8px; flex-shrink: 0; }
.kanban-column-header { font-size: 12px; font-weight: 700; color: var(--gray-700); padding: 6px 8px; display: flex; justify-content: space-between; align-items: center; }
.kanban-column-header .count { background: var(--gray-200); border-radius: 10px; padding: 1px 8px; font-size: 11px; }
.kanban-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 6px; padding: 10px; margin-top: 6px; cursor: grab; font-size: 12px; transition: box-shadow .15s; }
.kanban-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.kanban-card .name { font-weight: 600; margin-bottom: 2px; }
.kanban-card .meta { color: var(--gray-500); font-size: 11px; }
.kanban-card .visit { color: var(--primary); font-weight: 600; margin-top: 4px; font-size: 11px; }
.kanban-card.dragging { opacity: .5; }
.kanban-column.drag-over { background: var(--primary-light); }

/* バズ度 */
.buzz-high { color: #dc2626; font-weight: 600; }
.buzz-normal { color: var(--gray-500); }
.buzz-low { color: var(--gray-300); }

/* サブタブ */
.subtab-active { background: var(--primary) !important; color: #fff !important; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .kanban-board { flex-direction: column; }
  .kanban-column { min-width: 100%; max-width: 100%; }
}

/* === カレンダー === */
.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:1px;background:var(--gray-200);border-radius:8px;overflow:hidden}
.cal-header{background:var(--gray-100);padding:8px;text-align:center;font-weight:600;font-size:12px;color:var(--gray-600)}
.cal-day{background:#fff;min-height:100px;padding:4px 6px;position:relative}
.cal-day.today{background:#eff6ff}
.cal-day.today .day-num{background:var(--primary);color:#fff;border-radius:50%;width:24px;height:24px;display:flex;align-items:center;justify-content:center}
.cal-day.other-month{background:var(--gray-50);opacity:.5}
.day-num{font-size:13px;font-weight:600;margin-bottom:2px}
.cal-event{font-size:10px;padding:2px 4px;margin:1px 0;border-radius:3px;background:#dbeafe;color:#1e40af;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:default}
.cal-event.warn{background:#fef3c7;color:#92400e;border-left:3px solid #f59e0b}

/* === 直近来店一覧 === */
.upcoming-card{display:flex;align-items:center;gap:12px;padding:10px 12px;border-bottom:1px solid var(--gray-200)}
.upcoming-card:last-child{border-bottom:none}
.upcoming-card .date-box{text-align:center;min-width:44px;background:var(--gray-100);border-radius:8px;padding:6px 8px}
.upcoming-card .date-box .day{font-size:20px;font-weight:700;line-height:1}
.upcoming-card .date-box .weekday{font-size:11px;color:var(--gray-500)}
.upcoming-card .info{flex:1}
.upcoming-card .info .name{font-weight:600;font-size:14px}
.upcoming-card .info .meta{font-size:12px;color:var(--gray-600);margin-top:2px}
