:root {
  --bg: #07090a;
  --bg2: #0a120e;
  --green: #34e2a6;
  --amber: #ffb84d;
  --coral: #ff7a6b;
  --text: #eef4f0;
  --muted: #8ba394;
  --glass: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.12);
  --danger: #ff5c7a;
  --ok: #45f0b0;
  font-family: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

body { position: relative; overflow-x: hidden; }

h1, h2, h3 { font-family: 'Sora', sans-serif; margin: 0 0 0.4em; }

.hidden { display: none !important; }

.bg-glow {
  position: fixed;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(40% 35% at 20% 15%, rgba(52, 226, 166, 0.16), transparent 60%),
    radial-gradient(45% 40% at 85% 20%, rgba(255, 184, 77, 0.16), transparent 60%),
    radial-gradient(50% 45% at 50% 90%, rgba(255, 122, 107, 0.12), transparent 60%);
  animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
  0% { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(2%, -2%, 0) scale(1.05); }
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, #000 40%, transparent 90%);
}

.accent {
  background: linear-gradient(90deg, var(--green), var(--amber), var(--coral));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.35);
}

/* Top nav */
.topnav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 32px;
  background: rgba(7,9,10,0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
}

@media (max-width: 520px) {
  .topnav { padding: 12px 16px; }
  .nav-user { font-size: 0.8rem; gap: 8px; }
}

.brand { display: flex; align-items: center; gap: 8px; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 1.15rem; }
.brand-mark { color: var(--green); text-shadow: 0 0 12px var(--green); }

.nav-links { display: flex; gap: 8px; }
.nav-link {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: 0.92rem; font-weight: 500;
}
.nav-link:hover { color: var(--text); border-color: var(--glass-border); }
.nav-link.active { color: var(--text); background: var(--glass); border-color: var(--glass-border); }

.nav-user { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 0.9rem; }

/* Buttons & inputs */
.btn {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.92rem;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(90deg, var(--green), var(--amber));
  color: #06110c;
  box-shadow: 0 0 24px rgba(52,226,166,0.25);
}
.btn-primary:hover { box-shadow: 0 0 32px rgba(255,184,77,0.4); }
.btn-secondary { background: var(--glass); color: var(--text); border-color: var(--glass-border); }
.btn-secondary:hover { border-color: var(--green); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--glass-border); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { background: rgba(255,92,122,0.15); color: var(--danger); border-color: rgba(255,92,122,0.4); }

input, select {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  flex: 1;
}
input:focus, select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(52,226,166,0.15); }
input[type="date"], input[type="month"] { flex: none; width: auto; color-scheme: dark; }
input[type="file"] { flex: 1; }

.row-inline { display: flex; gap: 10px; margin-bottom: 12px; width: 100%; flex-wrap: wrap; align-items: center; }

/* Layout */
main { max-width: 1080px; margin: 0 auto; padding: 40px 24px 80px; }
.view { animation: fadein 0.4s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: translateY(0);} }

.view-landing .hero { text-align: center; padding: 60px 0 20px; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.78rem;
  color: var(--green); font-weight: 600; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.15; font-weight: 800; }
.hero-sub { color: var(--muted); max-width: 620px; margin: 20px auto 34px; font-size: 1.05rem; line-height: 1.6; }

.signin-box { max-width: 380px; margin: 0 auto 60px; padding: 28px; }
#google-btn-slot { display: flex; justify-content: center; }
.dev-login { display: flex; flex-direction: column; gap: 10px; }
.dev-note { color: var(--muted); font-size: 0.82rem; margin: 0 0 6px; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; text-align: left; margin-top: 20px; }
.feature { padding: 24px; }
.feature-icon { font-size: 1.6rem; margin-bottom: 10px; }
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--muted); font-size: 0.9rem; line-height: 1.5; margin: 0; }

.center-card { max-width: 460px; margin: 100px auto; padding: 40px; text-align: center; }
.pulse-orb {
  width: 60px; height: 60px; margin: 0 auto 20px; border-radius: 50%;
  background: radial-gradient(circle, var(--green), var(--amber));
  box-shadow: 0 0 40px rgba(52,226,166,0.5);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1;} 50% { transform: scale(1.15); opacity: 0.7;} }

.page-head { margin-bottom: 24px; }
.page-head p { color: var(--muted); margin: 4px 0 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

.panel { padding: 24px; margin-bottom: 20px; }
.panel h3 { font-size: 1.05rem; }

.list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border); flex-wrap: wrap;
}
.list-item .meta { display: flex; flex-direction: column; gap: 2px; }
.list-item .meta strong { font-size: 0.95rem; }
.list-item .meta span { color: var(--muted); font-size: 0.8rem; }
.tag {
  font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: rgba(52,226,166,0.12); color: var(--green); border: 1px solid rgba(52,226,166,0.3);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.tag.role-super_admin { background: rgba(255,122,107,0.12); color: var(--coral); border-color: rgba(255,122,107,0.3); }
.tag.role-org_admin { background: rgba(255,184,77,0.12); color: var(--amber); border-color: rgba(255,184,77,0.3); }
.tag.status-pending { background: rgba(255,196,77,0.12); color: #ffc44d; border-color: rgba(255,196,77,0.3); }
.tag.status-active { background: rgba(69,240,176,0.12); color: var(--ok); border-color: rgba(69,240,176,0.3); }

.list-item-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list-item-controls select { flex: none; width: auto; padding: 6px 10px; font-size: 0.82rem; }

.muted { color: var(--muted); font-size: 0.85rem; }
.small { font-size: 0.78rem; font-weight: 400; }

.grid-scroll { overflow-x: auto; }
table.data-table { border-collapse: collapse; width: 100%; min-width: 640px; }
table.data-table th, table.data-table td {
  padding: 8px 10px; text-align: right; font-size: 0.82rem; border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}
table.data-table th { color: var(--muted); font-weight: 600; text-align: right; }
table.data-table th:first-child, table.data-table td:first-child { text-align: left; }
table.data-table td.label-cell { text-align: left; font-weight: 600; }
table.data-table td.num-cell { font-variant-numeric: tabular-nums; }
table.data-table td.no-data { color: var(--muted); }
table.data-table tfoot td { font-weight: 700; border-top: 2px solid var(--glass-border); border-bottom: none; }

.stat-tile { padding: 14px 18px; flex: 1; min-width: 140px; }
.stat-value { font-size: 1.3rem; font-weight: 700; font-family: 'Sora', sans-serif; margin-top: 2px; }

.org-switcher {
  padding: 6px 10px; font-size: 0.82rem; border-radius: 8px;
  background: rgba(255,255,255,0.04); color: var(--text); border: 1px solid var(--glass-border);
}
.org-picker-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.org-picker-list button {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  padding: 14px 18px; border-radius: 12px; background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border); color: var(--text); font-size: 0.95rem; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.org-picker-list button:hover { border-color: var(--green); background: rgba(52,226,166,0.06); }

.org-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border); font-size: 0.78rem; margin: 2px 4px 2px 0;
}
.org-badge-role { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; }
.org-badge-remove {
  background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.95rem; line-height: 1;
  padding: 0 2px; border-radius: 50%;
}
.org-badge-remove:hover { color: var(--danger); }

.exec-summary { margin-top: 14px; line-height: 1.6; }

.chart-wrap { position: relative; height: 280px; margin-top: 10px; }
.chart-wrap-tall { height: 420px; }

.upload-drop {
  border: 1.5px dashed var(--glass-border);
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.upload-drop:hover, .upload-drop.dragover { border-color: var(--green); background: rgba(52,226,166,0.05); }
.upload-drop input[type="file"] { display: none; }
