@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700&family=IBM+Plex+Mono:wght@400;500&family=Rajdhani:wght@400;500;600;700&display=swap");

:root {
  --navy: #040d1a;
  --navy2: #071526;
  --navy3: #0a1d35;
  --gold: #f0a020;
  --gold2: #d4880a;
  --teal: #00d4ff;
  --text: #e8f0ff;
  --muted: #7a8fb0;
  --dim: #3a4a65;
  --green: #2fe08a;
  --red: #ff5d6c;
  --radius: 6px;
  --display: "Barlow Condensed", ui-sans-serif, system-ui, sans-serif;
  --sans: "Rajdhani", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--navy);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(10, 74, 138, 0.07) 1px, transparent 0),
    linear-gradient(90deg, rgba(10, 74, 138, 0.07) 1px, transparent 0);
  background-size: 60px 60px;
}

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover {
  color: #ffc040;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(7, 21, 38, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(240, 160, 32, 0.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: var(--gold);
  font-size: 20px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  box-shadow: 0 0 18px rgba(240, 160, 32, 0.4);
}

.brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
}

.brand-sub {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--gold);
  margin-top: 3px;
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  margin-right: 8px;
}

.topbar-nav-active {
  color: var(--gold);
  border-color: rgba(212, 175, 55, 0.45);
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 4px;
}

h1 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}

h2 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 1.15rem;
  text-transform: uppercase;
  margin: 0;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin: 22px 0 26px;
}

.stats-detail {
  grid-template-columns: repeat(6, 1fr);
}

.stats-market {
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 16px;
}

.stat {
  background: linear-gradient(160deg, var(--navy2), var(--navy));
  border: 1px solid rgba(240, 160, 32, 0.15);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.stat-num {
  font-family: var(--mono);
  font-size: 1.7rem;
  font-weight: 500;
  color: var(--gold);
  line-height: 1;
}

.stat-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
}

.stat-num.ok {
  color: var(--green);
  font-size: 1rem;
}

.stat-num.warn {
  color: var(--gold);
  font-size: 1rem;
}

.stat-num.error {
  color: var(--red);
  font-size: 1rem;
}

.trend-up {
  color: var(--green) !important;
}

.trend-down {
  color: var(--red) !important;
}

.trend-flat {
  color: var(--muted) !important;
}

.subline {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 3px;
}

.symbol-link {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.symbol-link:hover {
  color: #ffc040;
  text-decoration: underline;
}

.symbol-text {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.btn-link,
.btn-link-top {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  padding: 6px 10px;
  border: 1px solid rgba(0, 212, 255, 0.35);
  border-radius: var(--radius);
  background: rgba(0, 212, 255, 0.06);
}

.btn-link:hover,
.btn-link-top:hover {
  background: rgba(0, 212, 255, 0.14);
  color: #7ee9ff;
}

.btn-link-top {
  display: inline-block;
  padding: 9px 14px;
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.day-range {
  min-width: 120px;
}

.day-range-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.day-range-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(47, 224, 138, 0.25), rgba(255, 93, 108, 0.25));
  border: 1px solid rgba(240, 160, 32, 0.15);
}

.day-range-track-lg {
  height: 10px;
  margin: 14px 0 10px;
}

.day-range-marker {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--navy);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(240, 160, 32, 0.6);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.detail-grid .card:nth-child(3),
.detail-grid .card:nth-child(4) {
  grid-column: span 1;
}

#holding-card {
  grid-column: 1 / -1;
}

.day-range-detail {
  margin-top: 14px;
}

.range-legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.range-note,
.quote-updated {
  margin-top: 10px;
  font-size: 0.82rem;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ext-link {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(240, 160, 32, 0.25);
  background: var(--navy3);
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}

.ext-link:hover {
  border-color: rgba(240, 160, 32, 0.55);
  background: rgba(240, 160, 32, 0.08);
}

.ext-link-primary {
  border-color: rgba(240, 160, 32, 0.55);
  background: rgba(240, 160, 32, 0.12);
  color: var(--gold);
}

.holding-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.detail-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.detail-value {
  font-family: var(--mono);
  font-size: 1rem;
}

.year-range-track {
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.2), rgba(240, 160, 32, 0.35));
}

.google-ref-link {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.error-panel {
  border-color: rgba(255, 93, 108, 0.35);
  color: var(--red);
  font-family: var(--mono);
  font-size: 0.85rem;
}

.card {
  background: var(--navy2);
  border: 1px solid hsla(0, 0%, 100%, 0.06);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 22px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid hsla(0, 0%, 100%, 0.06);
}

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

.card-sub {
  margin: 0;
  font-size: 0.82rem;
}

.holdings-card {
  grid-column: 2;
}

.equity-comp-details {
  margin-bottom: 22px;
}

.equity-comp-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
  margin-bottom: 8px;
}

.equity-comp-summary::-webkit-details-marker {
  display: none;
}

.equity-comp-summary h2 {
  margin: 0;
}

.equity-comp-total {
  margin: 6px 0 0;
  font-size: 0.9rem;
}

.equity-comp-chevron {
  color: var(--muted);
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.equity-comp-details[open] .equity-comp-chevron {
  transform: rotate(180deg);
}

.equity-comp-caption {
  margin: 0 0 14px;
  font-size: 0.82rem;
}

.equity-comp-table-wrap {
  overflow-x: auto;
}

.equity-comp-table {
  min-width: 920px;
}

tr.grant-exercisable {
  background: hsla(45, 90%, 55%, 0.08);
  box-shadow: inset 3px 0 0 hsl(45, 90%, 55%);
}

.grant-status.grant-exercisable {
  color: hsl(45, 90%, 62%);
  font-weight: 600;
}

.auth-container {
  max-width: 720px;
  margin: 48px auto 0;
}

.auth-card h1 {
  margin-bottom: 12px;
}

.auth-notice {
  margin: 0;
  font-size: 0.82rem;
  color: hsl(45, 90%, 62%);
}

.auth-footer {
  margin-top: 18px;
}

.auth-footer a {
  color: hsl(200, 90%, 70%);
}

.admin-section-title {
  margin: 28px 0 12px;
  font-size: 1.05rem;
}

.admin-add-form {
  margin-bottom: 8px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-table th,
.admin-table td {
  padding: 10px 8px;
  border-bottom: 1px solid hsl(215, 25%, 20%);
  text-align: left;
  vertical-align: middle;
}

.inline-form {
  margin: 0;
}

.danger-btn {
  color: hsl(0, 80%, 72%);
}

.admin-foot {
  margin-top: 24px;
}


.auth-container .auth-card:only-child h1 + .muted + h2,
.auth-container .admin-section-title:first-of-type {
  margin-top: 0;
}

#logout-form {
  margin: 0;
}

.layout-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  align-items: start;
}

.form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  cursor: pointer;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"] {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text);
  padding: 10px 13px;
  border-radius: var(--radius);
  border: 1px solid rgba(240, 160, 32, 0.2);
  background: var(--navy3);
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder {
  color: rgba(122, 143, 176, 0.7);
}

input:focus {
  border-color: rgba(240, 160, 32, 0.6);
  box-shadow: 0 0 0 3px rgba(240, 160, 32, 0.15);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  accent-color: var(--gold);
  cursor: pointer;
}

.btn,
button {
  font-family: var(--display);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--navy);
  background: var(--gold);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}

.btn:hover,
button:hover {
  background: #ffc040;
  box-shadow: 0 0 22px rgba(240, 160, 32, 0.45);
}

button.secondary,
.btn-secondary {
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(240, 160, 32, 0.4);
  clip-path: none;
}

button.secondary:hover,
.btn-secondary:hover {
  background: rgba(240, 160, 32, 0.12);
  box-shadow: none;
}

button.danger,
.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(255, 93, 108, 0.4);
  clip-path: none;
  padding: 6px 12px;
  font-size: 0.75rem;
}

button.danger:hover,
.btn-danger:hover {
  background: rgba(255, 93, 108, 0.12);
  box-shadow: none;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--dim);
}

td {
  padding: 11px 12px;
  border-bottom: 1px solid hsla(0, 0%, 100%, 0.05);
  font-size: 0.95rem;
}

tbody tr:hover {
  background: rgba(240, 160, 32, 0.04);
}

.price {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--gold);
  white-space: nowrap;
}

.symbol-cell {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--gold);
  border: 1px solid rgba(240, 160, 32, 0.35);
  background: rgba(240, 160, 32, 0.07);
}

.badge.default {
  color: var(--muted);
  border-color: var(--dim);
  background: transparent;
}

.badge.teal {
  color: var(--teal);
  border-color: rgba(0, 212, 255, 0.35);
  background: rgba(0, 212, 255, 0.07);
}

.inline-input {
  width: 6.5rem;
  padding: 6px 10px;
  font-size: 0.88rem;
}

.message {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0;
}

.message[data-tone="error"] {
  color: var(--red);
}

.message[data-tone="success"] {
  color: var(--green);
}

.empty {
  color: var(--muted);
  padding: 12px 0;
  font-size: 0.9rem;
}

.brief-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}

.brief-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid hsla(0, 0%, 100%, 0.05);
}

.brief-item:last-child {
  border-bottom: none;
}

.brief-link {
  flex: 1;
  min-width: 0;
  color: var(--text);
}

.brief-link:hover .brief-title {
  color: var(--gold);
}

.brief-title {
  display: block;
  font-size: 0.92rem;
  line-height: 1.4;
}

.brief-meta {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--muted);
}

.brief-symbol {
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#news-card {
  grid-column: 1 / -1;
}

.hidden {
  display: none !important;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 1100px) {
  .stats,
  .stats-detail {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .layout-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .holdings-card {
    grid-column: auto;
  }

  .equity-comp-details:not([open]) .equity-comp-caption,
  .equity-comp-details:not([open]) .equity-comp-table-wrap,
  .equity-comp-details:not([open]) #equity-comp-empty {
    display: none;
  }

  .detail-grid .card:nth-child(3),
  .detail-grid .card:nth-child(4),
  #holding-card,
  #news-card {
    grid-column: auto;
  }

  .brief-item {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 820px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .container {
    padding: 20px 14px 48px;
  }

  .brand-sub,
  td.hide-sm,
  th.hide-sm {
    display: none;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .topbar-right {
    width: 100%;
    justify-content: flex-end;
  }

  .topbar-nav {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    order: 3;
  }

  .stats,
  .stats-detail {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

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

  .link-grid,
  .holding-grid {
    grid-template-columns: 1fr;
  }

  .stat-num {
    font-size: 1.4rem;
  }

  .card {
    padding: 16px 14px;
  }

  h1 {
    font-size: 1.5rem;
  }

  table thead {
    display: none;
  }

  table tr {
    display: block;
    border: 1px solid rgba(240, 160, 32, 0.18);
    border-radius: var(--radius);
    margin-bottom: 10px;
    padding: 8px 12px;
    background: var(--navy2);
  }

  table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    border: none;
    padding: 5px 0;
    font-size: 0.92rem;
  }

  table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    flex-shrink: 0;
  }

  table td[data-label="Symbol"] {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    border-bottom: 1px solid hsla(0, 0%, 100%, 0.06);
    padding-bottom: 8px;
    margin-bottom: 4px;
  }

  table td[data-label="Symbol"]::before {
    content: "";
  }
}
