:root {
  --primary-gradient: linear-gradient(135deg, #0066ff 0%, #0052cc 100%);
  --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --border-radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #374151;
  background: #f1f5f9;
  min-height: 100vh;
  margin: 0;
}

.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.btn-primary {
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--border-radius);
  color: white;
  font-weight: 600;
  padding: 12px 24px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: var(--border-radius);
  color: #374151;
  font-weight: 500;
  padding: 10px 20px;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: #0066ff;
  color: #0066ff;
}

.form-input {
  border: 2px solid #e5e7eb;
  border-radius: var(--border-radius);
  padding: 12px 16px;
  font-size: 16px;
  width: 100%;
  background: #f9fafb;
}

.form-input:focus {
  outline: none;
  border-color: #0066ff;
  background: white;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.15);
}

.form-label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  display: block;
}

.icon-container {
  background: var(--primary-gradient);
  border-radius: 50%;
  padding: 16px;
  box-shadow: var(--shadow-medium);
  width: fit-content;
}

.gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fade-in-up {
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-card {
  padding: 20px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  margin-bottom: 20px;
}

.section-card h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.muted {
  color: #64748b;
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
}

pre.report-json {
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 12px;
  max-height: 320px;
}

.ai-report-sections details.ai-report-json-details {
  margin-top: 1rem;
}

.ai-report-sections details.ai-report-json-details summary {
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  user-select: none;
}

.ai-report-sections details.ai-report-json-details summary:hover {
  color: #0066ff;
}

.ai-report-block h4 {
  margin-top: 0;
}

.dashboard-area {
  margin-bottom: 24px;
}

.area-title {
  margin: 0 0 12px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}

.card-compact {
  padding: 16px;
}

.card-title {
  margin: 0 0 6px;
  font-size: 1.03rem;
  font-weight: 700;
  color: #111827;
}

.details-summary {
  cursor: pointer;
  user-select: none;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.account-list,
.report-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.account-item,
.report-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.account-item-main,
.report-item-main {
  min-width: 0;
}

.account-item-title,
.report-item-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.35;
  word-break: break-word;
}

.account-item-meta,
.report-item-meta {
  font-size: 0.8rem;
  color: #64748b;
}

.report-item-link {
  color: #2563eb;
  text-decoration: none;
}

.report-item-link:hover {
  text-decoration: underline;
}

.th-num,
.td-num {
  text-align: right;
}

#campaignTable thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
}

.metric-card {
  border: 1px solid #dbeafe;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
}

.modal-panel {
  position: relative;
  width: min(640px, 100%);
  max-height: 90vh;
  overflow: auto;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-medium);
  border: 1px solid #d1d5db;
}

.modal-panel-lg {
  width: min(840px, 100%);
}

.modal-header,
.modal-footer {
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-footer {
  border-top: 1px solid #e5e7eb;
  border-bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-body {
  padding: 14px 16px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

.modal-close {
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #475569;
}
