/* Glodatum Reports Portal — reports.css
   Dark theme matching the dashboard design language */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f1117;
  --surface:   #1a1d27;
  --surface2:  #22263a;
  --border:    #2e3347;
  --accent:    #3b82f6;
  --accent-h:  #2563eb;
  --text:      #e2e8f0;
  --text-muted:#8892a4;
  --green:     #22c55e;
  --teal:      #14b8a6;
  --orange:    #f97316;
  --red:       #ef4444;
  --radius:    8px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.topbar-logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  text-decoration: none;
}

.topbar-logo span { color: var(--accent); }

.topbar-sep {
  color: var(--border);
  font-size: 20px;
  font-weight: 200;
}

.topbar-title {
  font-size: 14px;
  color: var(--text-muted);
}

.topbar-org {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
}

.main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 560px;
}

.card + .card { margin-top: 16px; }

/* ── Auth screen ─────────────────────────────────────────────────────────── */

.auth-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auth-wrap .card {
  max-width: 420px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ── Form elements ───────────────────────────────────────────────────────── */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.field input,
.field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
}

.field input::placeholder { color: var(--text-muted); }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
  padding: 12px;
  font-size: 15px;
}

.btn-primary:hover { background: var(--accent-h); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--border); }

.btn-report {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 14px;
}

.btn-report:hover {
  border-color: var(--accent);
  background: #1e2236;
}

.btn-report .report-icon { font-size: 22px; flex-shrink: 0; }

.btn-report .report-info { flex: 1; }

.btn-report .report-name {
  font-weight: 600;
  margin-bottom: 2px;
}

.btn-report .report-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-report .report-arrow {
  color: var(--text-muted);
  font-size: 18px;
  flex-shrink: 0;
}

/* ── Error / status messages ─────────────────────────────────────────────── */

.msg {
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.msg.visible { display: block; }

.msg-error {
  background: #2d1515;
  border: 1px solid #7f1d1d;
  color: #fca5a5;
}

.msg-info {
  background: #0f1e35;
  border: 1px solid #1e3a5f;
  color: #93c5fd;
}

/* ── Report picker screen ────────────────────────────────────────────────── */

.report-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ── Report options (date range, flags) ──────────────────────────────────── */

.options-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.options-panel .panel-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.toggle-row label {
  font-size: 13px;
  color: var(--text);
}

.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }

/* ── Session info strip ──────────────────────────────────────────────────── */

.session-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

.session-strip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.session-strip strong { color: var(--text); }

.session-strip .sign-out {
  margin-left: auto;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
}

.session-strip .sign-out:hover { color: var(--text); }

/* ── Loading spinner ─────────────────────────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Screens ─────────────────────────────────────────────────────────────── */

.screen { display: none; width: 100%; }
.screen.active { display: flex; flex-direction: column; align-items: center; }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .main { padding: 16px 12px; }
  .card { padding: 20px 16px; }
  .field-row { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
}
