/* Branch 591 Reports Dashboard */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #333;
}

/* ── Nav ─────────────────────────────────────────── */
nav {
  background: #1a237e;
  color: white;
  padding: 14px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.nav-brand { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.nav-user { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.nav-user a { color: rgba(255,255,255,0.8); text-decoration: none; font-size: 13px; }
.nav-user a:hover { color: white; }
.avatar { width: 30px; height: 30px; border-radius: 50%; }

/* ── Main ────────────────────────────────────────── */
main { max-width: 1200px; margin: 0 auto; padding: 24px; }
h1 { font-size: 22px; margin-bottom: 20px; color: #1a237e; }

/* ── Report Cards Grid ───────────────────────────── */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.report-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #e8eaf0;
  transition: box-shadow 0.15s;
}
.report-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.1); }

.report-card h3 {
  font-size: 15px;
  color: #1a237e;
  margin-bottom: 6px;
}

.card-meta { font-size: 12px; color: #888; margin-bottom: 10px; line-height: 1.6; }
.card-meta strong { color: #555; }

.schedule-line { display: flex; align-items: center; gap: 6px; }
.cron {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 10px;
  color: #666;
  background: #f0f2f5;
  padding: 1px 6px;
  border-radius: 3px;
}

.card-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #666;
  margin: 10px 0;
  padding: 8px 0;
  border-top: 1px solid #f0f2f5;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.success { background: #4caf50; }
.status-dot.failure { background: #f44336; }
.status-dot.never { background: #ccc; }

.card-actions { display: flex; gap: 8px; align-items: center; padding-top: 8px; }

.btn-run {
  background: #1a237e;
  color: white;
  border: none;
  padding: 7px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-run:hover { background: #283593; }
.btn-run:disabled { background: #9e9e9e; cursor: not-allowed; }
.btn-run.running { background: #e65100; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

.run-status { font-size: 11px; color: #888; }
.run-status.ok { color: #2e7d32; }
.run-status.fail { color: #c62828; }

/* ── History Table ───────────────────────────────── */
.history-section {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #e8eaf0;
}
.history-section h2 { font-size: 18px; margin-bottom: 16px; color: #1a237e; }

table.history {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.history th {
  text-align: left;
  padding: 10px 12px;
  background: #f5f5f5;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}
table.history td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
table.history tr:hover { background: #fafafa; }
table.history .empty { text-align: center; color: #bbb; padding: 32px; font-style: italic; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-test { background: #fff3e0; color: #e65100; }
.badge-live { background: #e8f5e9; color: #2e7d32; }
.badge-fail { background: #ffebee; color: #c62828; }

/* ── Login Page ──────────────────────────────────── */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #f0f2f5;
}
.login-box {
  background: white;
  padding: 48px 40px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  text-align: center;
  max-width: 400px;
  width: 100%;
}
.login-icon { font-size: 48px; margin-bottom: 12px; }
.login-box h1 { color: #1a237e; margin-bottom: 8px; font-size: 24px; }
.login-box p { color: #666; font-size: 14px; margin-bottom: 24px; line-height: 1.5; }

.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid #ddd;
  padding: 12px 28px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: background 0.15s, box-shadow 0.15s;
}
.btn-google:hover { background: #f8f8f8; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }

.error {
  background: #ffebee;
  color: #c62828;
  font-size: 13px;
  margin-bottom: 16px;
  padding: 10px 16px;
  border-radius: 6px;
}

/* ── Toast Notification ──────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: #2e7d32; }
.toast.error { background: #c62828; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  nav { padding: 12px 16px; }
  main { padding: 16px; }
  .reports-grid { grid-template-columns: 1fr; }
}
