:root {
  /* Bearagon console palette — navy ground, tide/cyan blues, gold attention */
  --ink: #081521;
  --panel: #0F2438;
  --panel-light: #16324E;
  --white: #F5F8FA;
  --indigo: #1D6FA8;
  --indigo-bright: #4AC2E9;
  --signal: #2FBF8F;
  --warn: #E0A23C;
  --danger: #FF7A7A;
  --steel: #8AA3B8;
  --border: rgba(201, 228, 245, 0.09);
  --border-bright: rgba(74, 194, 233, 0.35);
}

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

html, body { height: 100%; }

body {
  background: var(--ink);
  color: var(--white);
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.mono-label {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.muted { color: var(--steel); }
.warn-ink { color: var(--warn); }

:focus-visible { outline: 2px solid var(--indigo-bright); outline-offset: 2px; }

button { font-family: inherit; cursor: pointer; }

/* TOP BAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 21, 33, 0.9);
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.brand-mark { width: 38px; height: 38px; object-fit: contain; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }

.brand-name {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand-client {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--steel);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.conn {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
}

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

.conn.live .conn-dot { background: var(--signal); box-shadow: 0 0 8px var(--signal); }
.conn.live .conn-label { color: var(--signal); }
.conn.demo .conn-dot { background: var(--indigo-bright); box-shadow: 0 0 8px var(--indigo-bright); }
.conn.demo .conn-label { color: var(--indigo-bright); }
.conn.offline .conn-dot { background: var(--danger); }
.conn.offline .conn-label { color: var(--danger); }

.icon-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--steel);
  padding: 7px;
  display: flex;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover { color: var(--white); border-color: var(--border-bright); }

/* LAYOUT */
.wrap {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 24px 32px;
}

/* STAT TILES */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

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

.stat-tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--steel);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-value {
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 1.9rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.stat-value-sm { font-size: 1.25rem; padding-top: 6px; }

.stat-sub { font-size: 0.76rem; color: var(--steel); }

.inline-icon { flex-shrink: 0; position: relative; top: -1px; }

/* PUSH OPT-IN BANNER */
.push-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--border-bright);
  border-left: 3px solid var(--warn);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.push-banner span { font-size: 0.9rem; color: var(--white); }
.push-banner.hidden { display: none; }

/* COLUMNS */
.columns {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 14px;
  align-items: start;
}

@media (max-width: 980px) {
  .columns { grid-template-columns: 1fr; }
  .col-side { order: -1; }
}

.col-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* CARDS */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.card-title { color: var(--signal); }

.queue-card .card-title { color: var(--warn); }

/* BRIEF */
.brief-greeting {
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 1.08rem;
  margin-bottom: 10px;
}

.brief-lines { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.brief-lines li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--white);
  font-size: 0.9rem;
}

.brief-lines li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--indigo-bright);
  flex-shrink: 0;
  position: relative;
  top: -2px;
}

.brief-lines li em {
  font-style: normal;
  color: var(--signal);
  font-weight: 500;
}

.brief-empty { color: var(--steel); font-size: 0.9rem; }

/* FEED */
.feed-day {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--steel);
  padding: 12px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.feed-day:first-child { padding-top: 0; }

.feed-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}

.feed-row:last-child { border-bottom: none; }

.feed-status {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  width: 96px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 3px;
}

.feed-status.handled { color: var(--signal); }
.feed-status.needs_you { color: var(--warn); }
.feed-status.error { color: var(--danger); }
.feed-status.info { color: var(--indigo-bright); }

.feed-body { flex: 1; min-width: 0; }

.feed-headline { color: var(--white); font-size: 0.9rem; }

.feed-headline em { font-style: normal; color: var(--signal); font-weight: 500; }

.feed-meta {
  display: flex;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.64rem;
  color: var(--steel);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.feed-amount {
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--signal);
  padding-top: 3px;
}

.feed-resolved { opacity: 0.55; }

.feed-empty { color: var(--steel); font-size: 0.9rem; padding: 8px 0; }

/* NEEDS-YOU QUEUE */
.queue-item {
  border: 1px solid rgba(224, 162, 60, 0.35);
  background: rgba(224, 162, 60, 0.06);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}

.queue-item:last-child { margin-bottom: 0; }

.queue-headline { font-size: 0.9rem; margin-bottom: 4px; }

.queue-detail { font-size: 0.8rem; color: var(--steel); margin-bottom: 10px; }

.queue-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  color: var(--steel);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.queue-actions { display: flex; gap: 8px; }

.btn-primary {
  background: var(--indigo);
  color: var(--white);
  border: none;
  border-radius: 7px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 0.2s ease;
}

.btn-primary:hover { background: var(--indigo-bright); }

.btn-secondary {
  background: none;
  color: var(--steel);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 14px;
  font-size: 0.82rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.btn-secondary:hover { color: var(--white); border-color: var(--border-bright); }

.queue-empty {
  color: var(--steel);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.queue-empty svg { color: var(--signal); flex-shrink: 0; }

/* FOOTER */
.foot {
  display: flex;
  justify-content: space-between;
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  color: var(--steel);
  font-size: 0.74rem;
}

/* SETTINGS MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 21, 33, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-backdrop.hidden { display: none; }

.modal {
  background: var(--panel);
  border: 1px solid var(--border-bright);
  border-radius: 14px;
  padding: 26px;
  width: min(440px, calc(100vw - 48px));
}

.modal h2 {
  font-family: 'Barlow', sans-serif;
  font-size: 1.15rem;
  margin-bottom: 18px;
}

.field { display: block; margin-bottom: 14px; }

.field > span {
  display: block;
  font-size: 0.8rem;
  color: var(--steel);
  margin-bottom: 5px;
}

.field input[type="text"],
.field input[type="url"],
.field input[type="password"] {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--white);
  font-family: inherit;
  font-size: 0.88rem;
}

.field input:focus { outline: none; border-color: var(--indigo-bright); }

.field select {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--white);
  font-family: inherit;
  font-size: 0.88rem;
}

.field select:focus { outline: none; border-color: var(--indigo-bright); }

.field-note {
  font-size: 0.8rem;
  color: var(--steel);
  margin-bottom: 14px;
}

.field-note.hidden, #profile-fields.hidden { display: none; }

.btn-danger {
  background: none;
  color: var(--danger);
  border: 1px solid rgba(255, 122, 122, 0.35);
  border-radius: 7px;
  padding: 8px 14px;
  font-size: 0.82rem;
  transition: border-color 0.2s ease;
}

.btn-danger:hover { border-color: var(--danger); }
.btn-danger.hidden { display: none; }

.modal-actions-spacer { flex: 1; }

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

.field-row span { margin: 0; font-size: 0.85rem; color: var(--white); }

.field-row input[type="checkbox"] { accent-color: var(--indigo); width: 16px; height: 16px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
