/* Dashboard launcher — custom styles on top of Bootstrap 4 */

:root {
  --bg: #070b14;
  --surface: rgba(20, 28, 46, 0.72);
  --surface-hover: rgba(26, 36, 58, 0.85);
  --border: rgba(148, 170, 210, 0.12);
  --border-strong: rgba(148, 170, 210, 0.22);
  --text: #eef2f8;
  --text-muted: #94a2b8;
  --text-faint: #6b7a93;
  --brand: #6cc04a;
  --focus: #9be37a;

  /* Accent colours as RGB triplets so they can be tinted with alpha */
  --green: 108, 192, 74;
  --blue: 90, 169, 255;
  --amber: 245, 184, 61;
  --red: 242, 109, 109;
  --purple: 169, 139, 255;
  --orange: 246, 130, 31;

  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  position: relative;
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

/* Soft glows + faint grid, fixed behind content */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  z-index: 0;
}
body::before {
  background:
    radial-gradient(60% 40% at 15% -5%, rgba(108, 192, 74, 0.16), transparent 70%),
    radial-gradient(50% 35% at 100% 0%, rgba(90, 169, 255, 0.12), transparent 70%);
}
body::after {
  background-image:
    linear-gradient(rgba(148, 170, 210, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 170, 210, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 55%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 55%);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--brand);
  color: var(--bg);
  font-weight: 600;
}
.skip-link:focus { top: calc(var(--safe-top) + 8px); color: var(--bg); text-decoration: none; }

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding:
    calc(var(--safe-top) + 18px)
    calc(var(--safe-right) + 16px)
    calc(var(--safe-bottom) + 16px)
    calc(var(--safe-left) + 16px);
}

/* Header */
.app-header { margin-bottom: 26px; }
.app-topbar {
  display: flex;
  justify-content: center;
}
.brand-logo { height: 60px; width: auto; max-width: 100%; display: block; }

.app-hero { margin-top: 8px; }
.app-eyebrow {
  text-align: center;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-faint);
}

/* Section */
.app-main { flex: 1; outline: none; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin: 0;
}
.section-meta {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148, 170, 210, 0.08);
}
.section-meta:empty { display: none; }

/* Cards */
.launcher-item + .launcher-item { margin-top: 12px; }

.dash-card {
  --accent: var(--green);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  padding: 18px 16px;
  color: var(--text);
  text-decoration: none;
  background:
    linear-gradient(135deg, rgba(var(--accent), 0.08), transparent 55%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.accent-green  { --accent: var(--green); }
.accent-blue   { --accent: var(--blue); }
.accent-amber  { --accent: var(--amber); }
.accent-red    { --accent: var(--red); }
.accent-purple { --accent: var(--purple); }
.accent-orange { --accent: var(--orange); }

/* Decorative sparkline in the card background */
.dash-spark {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 46%;
  height: 55%;
  pointer-events: none;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%);
  mask-image: linear-gradient(90deg, transparent, #000 60%);
}
.spark-line { fill: none; stroke: rgba(var(--accent), 0.45); stroke-width: 1.5; stroke-linejoin: round; }
.spark-fill { fill: rgba(var(--accent), 0.07); stroke: none; }

.dash-card > :not(.dash-spark) { position: relative; }

a.dash-card:hover {
  color: var(--text);
  text-decoration: none;
  background:
    linear-gradient(135deg, rgba(var(--accent), 0.13), transparent 60%),
    var(--surface-hover);
  border-color: rgba(var(--accent), 0.4);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 12px 32px -14px rgba(var(--accent), 0.45);
  transform: translateY(-1px);
}
a.dash-card:active { transform: scale(0.985); }
a.dash-card:focus { outline: none; }
a.dash-card:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.dash-icon {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(var(--accent));
  background: linear-gradient(145deg, rgba(var(--accent), 0.22), rgba(var(--accent), 0.06));
  border: 1px solid rgba(var(--accent), 0.3);
  box-shadow: 0 6px 18px -8px rgba(var(--accent), 0.6);
}
.dash-icon-svg { width: 26px; height: 26px; }

.dash-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-title { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.dash-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.4; margin-top: 3px; }

.dash-go {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: rgba(148, 170, 210, 0.08);
  border: 1px solid var(--border);
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}
.dash-chevron { width: 18px; height: 18px; }
a.dash-card:hover .dash-go,
a.dash-card:focus-visible .dash-go {
  color: var(--bg);
  background: rgb(var(--accent));
  border-color: transparent;
  transform: translateX(2px);
}

.dash-card.is-disabled { cursor: not-allowed; }
.dash-card.is-disabled .dash-icon { filter: saturate(0.5); opacity: 0.7; }
.dash-badge {
  align-self: flex-start;
  margin-top: 8px;
  padding: 2px 9px;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 999px;
  color: rgb(var(--amber));
  background: rgba(var(--amber), 0.12);
  border: 1px solid rgba(var(--amber), 0.3);
}

.launcher-empty { color: var(--text-muted); font-size: 0.9375rem; padding: 16px 0; }


/* Footer */
.app-footer {
  margin-top: 32px;
  padding-top: 14px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-faint);
}
.footer-brand { font-size: inherit; }

@media (min-width: 768px) {
  .app-shell { padding-top: calc(var(--safe-top) + 48px); }
  .brand-logo { height: 76px; }
  .app-hero { margin-top: 10px; }
}

@media (max-width: 340px) {
  .dash-card { gap: 12px; padding: 16px 12px 16px 14px; }
  .dash-icon { flex-basis: 44px; width: 44px; height: 44px; }
  .dash-go { flex-basis: 28px; width: 28px; height: 28px; }
  .brand-logo { height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  a.dash-card:hover, a.dash-card:active { transform: none; }
}
