/* ATIRO CODE 不動産CRM カスタムスタイル */

:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* {
  -webkit-tap-highlight-color: transparent;
}

body {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  min-height: 100vh;
}

/* スクロールバー */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* サイドバー */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #cbd5e1;
  border-radius: 0.5rem;
  margin-bottom: 0.25rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
}
.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}
.sidebar-link.active {
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  color: white;
  font-weight: 500;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.sidebar-link i {
  width: 1.25rem;
  text-align: center;
}

/* カード */
.stat-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  transition: all 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

/* ステータスバッジ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  white-space: nowrap;
}
.badge-new { background: #dbeafe; color: #1e40af; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-following { background: #fef3c7; color: #92400e; }
.badge-contracted { background: #ddd6fe; color: #5b21b6; }
.badge-lost { background: #fee2e2; color: #991b1b; }
.badge-available { background: #dcfce7; color: #166534; }
.badge-negotiating { background: #fef3c7; color: #92400e; }
.badge-closed { background: #f3f4f6; color: #374151; }
.badge-high { background: #fee2e2; color: #991b1b; }
.badge-normal { background: #dbeafe; color: #1e40af; }
.badge-low { background: #f3f4f6; color: #6b7280; }

/* ボタン */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.btn-primary {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: white;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  box-shadow: 0 4px 6px -1px rgba(30, 64, 175, 0.3);
}
.btn-secondary {
  background: white;
  color: #475569;
  border: 1px solid #cbd5e1;
}
.btn-secondary:hover {
  background: #f8fafc;
}
.btn-success {
  background: #10b981;
  color: white;
}
.btn-success:hover {
  background: #059669;
}
.btn-danger {
  background: #ef4444;
  color: white;
}
.btn-danger:hover {
  background: #dc2626;
}

/* テーブル */
.table-modern {
  width: 100%;
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}
.table-modern thead {
  background: #f8fafc;
}
.table-modern th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e2e8f0;
}
.table-modern td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
}
.table-modern tbody tr:hover {
  background: #f8fafc;
  cursor: pointer;
}

/* モーダル */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-content {
  background: white;
  border-radius: 1rem;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: modal-in 0.2s ease-out;
}
.modal-content.large {
  max-width: 960px;
}
@keyframes modal-in {
  from { transform: scale(0.95) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* フォーム */
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: white;
  transition: all 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* AIアシスタント */
.ai-panel {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 1px solid #c7d2fe;
  border-radius: 1rem;
}
.ai-extracted-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: white;
  border: 1px solid #c7d2fe;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  color: #4338ca;
  margin: 0.125rem;
}

/* タイムライン */
.timeline-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 1.25rem;
  border-left: 2px solid #e2e8f0;
}
.timeline-item:last-child {
  border-left-color: transparent;
}
.timeline-dot {
  position: absolute;
  left: -0.5rem;
  top: 0.25rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid white;
  box-shadow: 0 0 0 2px #3b82f6;
}

/* パイプライン */
.pipeline-column {
  background: #f8fafc;
  border-radius: 0.75rem;
  padding: 0.75rem;
  min-width: 260px;
}
.pipeline-card {
  background: white;
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  cursor: pointer;
  transition: all 0.15s;
}
.pipeline-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* カラーカード(KPI) */
.kpi-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}
.kpi-card.blue::before { background: linear-gradient(180deg, #3b82f6, #06b6d4); }
.kpi-card.green::before { background: linear-gradient(180deg, #10b981, #34d399); }
.kpi-card.purple::before { background: linear-gradient(180deg, #8b5cf6, #a78bfa); }
.kpi-card.orange::before { background: linear-gradient(180deg, #f59e0b, #fbbf24); }

/* タブ */
.tab-btn {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.tab-btn:hover {
  color: #1e40af;
}
.tab-btn.active {
  color: #1e40af;
  border-bottom-color: #1e40af;
}

/* トースト */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.875rem 1.25rem;
  border-radius: 0.5rem;
  background: white;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slide-up 0.3s;
}
.toast-success { border-left: 4px solid #10b981; }
.toast-error { border-left: 4px solid #ef4444; }
.toast-info { border-left: 4px solid #3b82f6; }
@keyframes slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* レスポンシブ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0 !important;
  }
}

/* マイクボタン */
.mic-btn {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px 0 rgba(6, 182, 212, 0.4);
  cursor: pointer;
  transition: all 0.2s;
}
.mic-btn:hover {
  transform: scale(1.05);
}
.mic-btn.recording {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}

/* 確度プログレスバー */
.probability-bar {
  display: inline-block;
  width: 60px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}
.probability-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981);
  transition: width 0.3s;
}
