/*
 * Why this stylesheet exists:
 * - Gives the internal tracker a distinct, premium dashboard feel without inheriting the marketing site layout.
 * - Optimizes for fast scanning of the tracker records and quarter notes on both desktop and mobile.
 * - Uses a darker, higher-contrast visual language so private admin tasks feel separate from the public site.
 */

:root {
  --bg: #08111d;
  --bg-soft: #0d1727;
  --panel: rgba(13, 23, 39, 0.82);
  --panel-strong: rgba(10, 18, 31, 0.96);
  --panel-border: rgba(160, 185, 255, 0.14);
  --panel-highlight: rgba(125, 211, 252, 0.1);
  --text: #eef4ff;
  --muted: #9cafcf;
  --accent: #7dd3fc;
  --accent-2: #f7b267;
  --accent-3: #8ef0c8;
  --danger: #ff8fa3;
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  --radius-sm: 18px;
  --max: 1280px;
  --ring: rgba(125, 211, 252, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 18%, rgba(125, 211, 252, 0.18), transparent 28%),
    radial-gradient(circle at 82% 10%, rgba(247, 178, 103, 0.18), transparent 25%),
    radial-gradient(circle at 60% 70%, rgba(142, 240, 200, 0.12), transparent 26%),
    linear-gradient(160deg, #060d16 0%, #0a1321 44%, #101a2d 100%);
  color: var(--text);
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  filter: blur(72px);
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}

body::before {
  left: -140px;
  top: 18vh;
  background: rgba(125, 211, 252, 0.24);
}

body::after {
  right: -120px;
  top: 6vh;
  background: rgba(247, 178, 103, 0.22);
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

:where(a, button, input, select):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(8, 17, 29, 0.42);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(54px);
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
}

.orb-a {
  width: 260px;
  height: 260px;
  left: -80px;
  bottom: 12vh;
  background: rgba(142, 240, 200, 0.18);
}

.orb-b {
  width: 240px;
  height: 240px;
  right: -60px;
  bottom: 18vh;
  background: rgba(125, 211, 252, 0.16);
}

.topbar,
.shell {
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #06101a;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  box-shadow: 0 14px 30px rgba(125, 211, 252, 0.26);
}

.brand-copy strong,
.hero h1,
.panel-head h2,
.dashboard-top h2,
.section-head h3,
.customer-name {
  font-family: "Fraunces", Georgia, serif;
}

.brand-copy {
  display: grid;
}

.brand-copy strong {
  font-size: 1.05rem;
}

.brand-copy small {
  color: var(--muted);
}

.home-link {
  text-decoration: none;
  color: var(--muted);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(160, 185, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
}

.shell {
  padding: 1rem 0 2.5rem;
}

.hero {
  border-radius: 32px;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 1.2rem;
}

.hero-copy,
.login-card {
  padding: 1.35rem;
}

.hero-copy {
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(125, 211, 252, 0.08), rgba(247, 178, 103, 0.05)),
    rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(160, 185, 255, 0.12);
}

.eyebrow,
.panel-kicker,
.summary-label,
.customer-index,
.filters-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--muted);
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.1rem);
  line-height: 0.95;
  margin: 0.75rem 0 1rem;
}

.lead {
  font-size: 1.06rem;
  max-width: 60ch;
  color: #d7e4ff;
}

.stats-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.3rem 0;
}

.mini-stat {
  border-radius: 18px;
  padding: 1rem;
  background: rgba(10, 18, 31, 0.55);
  border: 1px solid rgba(160, 185, 255, 0.12);
}

.mini-stat strong {
  display: block;
  font-size: 1.65rem;
}

.mini-stat span {
  color: var(--muted);
}

.feature-list {
  margin: 0;
  padding-left: 1.2rem;
  color: #d7e4ff;
}

.login-card {
  border-radius: 26px;
  display: grid;
  gap: 1rem;
  align-content: start;
  background:
    radial-gradient(circle at top right, rgba(125, 211, 252, 0.08), transparent 36%),
    rgba(8, 17, 29, 0.92);
}

.panel-head h2,
.dashboard-top h2 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.auth-form {
  display: grid;
  gap: 0.9rem;
}

.auth-form label,
.search-box,
.admin-row label {
  display: grid;
  gap: 0.4rem;
}

.auth-form span,
.search-box span,
.admin-row span {
  font-size: 0.92rem;
  color: var(--muted);
}

.auth-form input,
.search-box input,
.admin-row select {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(160, 185, 255, 0.16);
  background: rgba(8, 17, 29, 0.9);
  color: var(--text);
}

.auth-form input::placeholder,
.search-box input::placeholder {
  color: rgba(156, 172, 207, 0.7);
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 46px;
  padding: 0.8rem 1.1rem;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.primary-button {
  color: #07111c;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
}

.secondary-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(160, 185, 255, 0.18);
}

.ghost-button {
  color: var(--muted);
  background: transparent;
  border-color: rgba(160, 185, 255, 0.12);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.form-status,
.panel-note,
.muted,
.customer-subtitle,
.summary-footnote {
  color: var(--muted);
}

.panel-note {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(160, 185, 255, 0.18);
}

.dashboard {
  display: grid;
  gap: 1rem;
}

.dashboard-top,
.control-bar,
.summary-card,
.customer-card {
  border-radius: 24px;
}

.dashboard-top,
.control-bar {
  padding: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.summary-card {
  padding: 1rem 1.05rem 1.05rem;
  display: grid;
  gap: 0.3rem;
}

.summary-value {
  font-size: 1.8rem;
}

.summary-footnote {
  font-size: 0.92rem;
}

.control-bar {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.1fr);
  align-items: end;
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  border: 1px solid rgba(160, 185, 255, 0.18);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
}

.chip.is-active {
  background: rgba(125, 211, 252, 0.12);
  border-color: rgba(125, 211, 252, 0.5);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0 0.8rem;
}

.section-head h3 {
  margin: 0;
  font-size: 1.6rem;
}

.customer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.customer-card {
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
  cursor: pointer;
}

.customer-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.customer-heading {
  display: grid;
  gap: 0.15rem;
}

.customer-top-actions {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 0.6rem;
}

.customer-index {
  margin-bottom: 0.25rem;
}

.customer-name {
  margin: 0;
  font-size: 1.45rem;
}

.customer-subtitle {
  margin: 0.25rem 0 0;
}

.customer-preview {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  max-width: 42ch;
}

.details-toggle {
  min-height: 40px;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
}

.customer-details {
  display: grid;
  gap: 0.9rem;
}

.customer-card:not(.is-expanded) .customer-details {
  display: none;
}

.owner-pill,
.status-pill,
.note-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid rgba(160, 185, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
}

.owner-pill {
  color: var(--accent);
}

.customer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.meta-pill,
.quarter-pill {
  border-radius: 999px;
  border: 1px solid rgba(160, 185, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
}

.quarter-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 0.7rem;
}

.quarter-card {
  padding: 0.9rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(160, 185, 255, 0.12);
}

.quarter-card strong {
  display: block;
  margin-bottom: 0.3rem;
}

.quarter-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.customer-note {
  min-height: 2.4rem;
  color: #ffe5b6;
}

.followup-row {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(160, 185, 255, 0.12);
}

.followup-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.followup-head h4 {
  margin: 0.1rem 0 0;
  font-size: 1.05rem;
}

.followup-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 28ch;
  text-align: right;
}

.followup-input {
  width: 100%;
  resize: vertical;
  min-height: 96px;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(160, 185, 255, 0.16);
  background: rgba(8, 17, 29, 0.9);
  color: var(--text);
}

.followup-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.followup-status {
  margin: 0;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.75rem;
}

.empty-state {
  margin: 1.2rem 0 0;
  color: var(--muted);
}

.save-button {
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .hero,
  .summary-grid,
  .customer-grid {
    grid-template-columns: 1fr;
  }

  .control-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-direction: column;
    align-items: start;
    gap: 0.85rem;
  }

  .shell {
    width: min(calc(100% - 1rem), var(--max));
    padding-top: 0.7rem;
  }

  .hero,
  .login-card,
  .dashboard-top,
  .control-bar,
  .customer-card,
  .summary-card {
    border-radius: 20px;
  }

  .hero,
  .dashboard-top,
  .control-bar {
    padding: 1rem;
  }

  .hero-copy,
  .login-card {
    padding: 1rem;
  }

  .stats-preview {
    grid-template-columns: 1fr;
  }

  .dashboard-actions {
    width: 100%;
  }

  .dashboard-actions > * {
    flex: 1 1 auto;
  }

  .section-head {
    flex-direction: column;
    align-items: start;
  }

  .admin-row {
    grid-template-columns: 1fr;
  }
}
