/* === AG Insights — Admin Portal — Styles === */
/* Back-office launcher. Dark header + dark footer bands so the white/mint AG     */
/* Insights logo reads; light card grid in between. Card accent colour is         */
/* data-driven (--card-accent, set per card in portal.js) so new panels need no   */
/* css change. Structure adapted from the wwf-portal launcher.                    */

/* ── Reset & variables ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #ffffff;
  --surface:     #ffffff;
  --border:      #e6e9e7;
  --text:        #16201a;   /* near-black */
  --muted:       #5d665f;   /* grey body/labels */

  --agi-green:   #34d399;   /* AG Insights mint accent (matches the logo mark) */
  /* The AG logo PNG sits on an opaque BLACK block, so the dark bands are pure
     black — the block then blends in seamlessly (no visible rectangle). */
  --dark:        #000000;   /* footer + gate band */

  --footer-bg:   #000000;

  /* Consumed by ag-auth.js's injected sign-in screens if auth is ever enabled. */
  --primary:     #16201a;
  --agi-gradient:linear-gradient(160deg, #0b100e 0%, #10201a 100%);
}

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100%;
  color: var(--text);
  background: var(--bg);
  font-family: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
}

#app { min-height: 100vh; }

/* ── Loading gate — dark, shown from first byte, overwritten by portal.js ── */
.agi-gate {
  position: fixed; inset: 0;
  background: var(--dark);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.5rem; padding: 2rem; text-align: center; z-index: 2000;
}
.agi-gate-logo { height: 54px; width: auto; }   /* white/mint logo on dark — no filter */
.agi-gate-bar {
  width: 220px; height: 3px; background: rgba(255,255,255,0.12);
  border-radius: 3px; overflow: hidden; position: relative;
}
.agi-gate-bar-fill {
  position: absolute; top: 0; left: -60%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--agi-green), transparent);
  border-radius: 3px; animation: agi-sweep 1.4s ease-in-out infinite;
}
@keyframes agi-sweep { 0% { left: -60%; } 100% { left: 100%; } }
.agi-gate-label {
  font-size: 0.78rem; color: #8a948e;
  letter-spacing: 0.06em; text-transform: uppercase;
}

/* ── Header (black band; mint hairline divider) ── */
header {
  background: var(--dark);
  border-bottom: 1px solid rgba(52,211,153,0.35);
  padding: 3rem 3rem 3.5rem;
  min-height: 172px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
}

.header-title-block {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.header-logo { height: 52px; width: auto; }   /* white/mint logo on dark — no filter */

.header-tagline {
  margin-top: 0.7rem;
  font-size: 0.8rem; letter-spacing: 0.18em;
  color: #93a29a; text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  position: relative;
  z-index: 1;
}
.header-right > span { font-size: 0.85rem; color: #e6ebe8; }

/* ── Sign-out button (dark header) ── */
.btn-signout {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 6px;
  color: #e6ebe8;
  font-family: 'Sora', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn-signout:hover { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.1); }

/* ── Main ── */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 3rem 6rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}
/* Mint underline accent */
.section-label::after {
  content: '';
  display: block;
  width: 32px; height: 3px;
  margin-top: 0.5rem;
  background: var(--agi-green);
  border-radius: 2px;
}

.section-count {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── App cards ── */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
}

.app-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(20,32,26,0.04);
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

/* Top accent bar — colour comes from the per-card --card-accent variable */
.app-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent, var(--agi-green));
  border-radius: 14px 14px 0 0;
}

.app-card:hover {
  border-color: #cfd4cf;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(20,32,26,0.10);
}

/* Disabled card — panel not yet wired ("coming soon") */
.app-card.disabled {
  pointer-events: none;
  opacity: 0.55;
  box-shadow: none;
}

.app-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.app-card-team {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  color: var(--card-accent, var(--agi-green));
}

.app-card-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.app-card-badge {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  flex-shrink: 0;
}

.app-card-desc {
  font-size: 0.825rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.app-card-footer {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-card-cta {
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--card-accent, var(--agi-green));
}
.app-card-cta-soon { color: var(--muted); }

.app-card-cta-arrow { transition: transform 0.15s; }
.app-card:hover .app-card-cta-arrow { transform: translateX(3px); }

.grid-note {
  margin-top: 1.75rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}

/* ── Footer (dark band: AG Insights logo + version) ── */
footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 0.875rem 3rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--footer-bg);
}

.footer-logos { display: flex; align-items: center; gap: 16px; }
.footer-logos img { height: 24px; width: auto; opacity: 0.9; }

.footer-version {
  position: absolute;
  right: 20px;
  font-size: 0.7rem;
  color: #8a948e;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  main { padding: 2.5rem 2rem 6rem; }
}

@media (max-width: 768px) {
  header { padding: 2.5rem 1.5rem 3rem; min-height: 150px; }
  .header-logo { height: 42px; }
  main { padding: 2rem 1.25rem 6rem; }
  .app-grid { grid-template-columns: 1fr; }
  .header-right { gap: 10px; }
  footer { padding: 0.875rem 1.25rem; }
  .footer-version { right: 1.25rem; }
}

@media (max-width: 480px) {
  .header-logo { height: 38px; }
  .header-right > span { display: none; }
  main { padding: 1.5rem 1rem 6rem; }
  .footer-logos img { height: 20px; }
}
