/* Monthly SEO Automation — Professional Dark Dashboard Components */
/* The primary shell is defined in base.html for deployment portability. */

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

/* Priority tier color indicators */
.tier-0 { border-left: 4px solid #ef4444; }
.tier-1 { border-left: 4px solid #f97316; }
.tier-2 { border-left: 4px solid #f59e0b; }
.tier-3 { border-left: 4px solid #22c55e; }
.tier-4 { border-left: 4px solid #64748b; }

/* Score bar */
.score-bar {
  height: 7px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 5px;
}
.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8, #22c55e);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

/* Status colors */
.status-approved { color: #86efac; font-weight: 700; }
.status-completed { color: #7dd3fc; font-weight: 700; }
.status-deferred { color: #94a3b8; }
.status-proposed { color: #fcd34d; }
.status-error { color: #fca5a5; font-weight: 700; }

/* Collapsible sections */
.collapsible-header {
  cursor: pointer;
  user-select: none;
}
.collapsible-header::after {
  content: ' ▼';
  font-size: 10px;
  opacity: 0.62;
  color: #94a3b8;
}
.collapsible-header.collapsed::after {
  content: ' ▶';
}

/* Source intake status */
.source-ok { color: #86efac; }
.source-missing { color: #fca5a5; }
.source-legacy { color: #fcd34d; }

/* Metric cards grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.metric-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.94));
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 17px 20px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  text-align: center;
}
.metric-card .metric-value {
  font-size: 27px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.metric-card .metric-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 5px;
}
.metric-card .metric-delta {
  font-size: 12px;
  font-weight: 700;
  margin-top: 6px;
}
.metric-delta.positive { color: #86efac; }
.metric-delta.negative { color: #fca5a5; }
.metric-delta.neutral { color: #94a3b8; }

/* Focus scope indicator */
.focus-scope-active {
  background: rgba(56, 189, 248, 0.10);
  border: 1px solid rgba(56, 189, 248, 0.30);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12px;
  color: #bae6fd;
  margin-bottom: 16px;
}

/* New-client source checkbox cards */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.checkbox-card {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 13px;
  min-height: 46px;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 11px;
  color: #dbeafe;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}
.checkbox-card:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.36);
  transform: translateY(-1px);
}
.checkbox-card input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.checkbox-card span {
  line-height: 1.35;
}

/* Tooltip */
[data-tooltip] {
  position: relative;
  cursor: help;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #020617;
  color: #e5edf7;
  border: 1px solid rgba(148, 163, 184, 0.24);
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}
[data-tooltip]:hover::after {
  opacity: 1;
}

pre, code {
  background: rgba(2, 6, 23, 0.72);
  color: #dbeafe;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
}
pre { padding: 12px; overflow-x: auto; }

/* Print styles */
@media print {
  .navbar, .btn, form { display: none !important; }
  .container { width: 100% !important; margin-left: 0 !important; padding: 0 !important; }
  .card { box-shadow: none; border: 1px solid #cbd5e1; background: #fff; color: #111827; }
  body { background: #fff; color: #111827; }
  table, th, td { color: #111827; }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .container { padding: 16px 12px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .d-flex { flex-wrap: wrap; }
  table { font-size: 12px; }
  th, td { padding: 8px 8px; }
  .checkbox-grid { grid-template-columns: 1fr; }
}
