/* ============================================================
   TradesMind Design System — shared.css
   Version 1.1 — 11 May 2026
   Import this file into every page.
   ============================================================ */

/* ── Fonts ──
   Fraunces (serif): headings, splash, marketing copy.
   Inter (sans): UI body — all interactive surfaces.
   Space Mono: numeric / code / token displays. */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;1,9..144,400&family=Inter:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ── Brand Tokens ── */
:root {
  /* Backgrounds */
  --bg:           #0D1F2D;
  --bg-deep:      #060E16;
  --bg-card:      #111D2B;
  --bg-input:     #0A1520;
  --bg-overlay:   rgba(6,14,22,0.85);

  /* Borders */
  --border:       #1E3048;
  --border-light: #1E3A50;

  /* Primary accent — teal — nav, pills, badges, text highlights */
  --teal:         #02C39A;
  --teal-dim:     rgba(2,195,154,0.12);
  --teal-border:  rgba(2,195,154,0.25);
  --teal-glow:    rgba(2,195,154,0.15);

  /* CTA — cyan — all buttons and primary actions.
     CANONICAL VALUE. Do not change to teal — Tim's brief.
     Last touched 11 May 2026 after a teal regression that bit prod. */
  --btn:          #4DD9E8;
  --btn-text:     #0D1F2D;
  --btn-dim:      rgba(77,217,232,0.12);
  --btn-border:   rgba(77,217,232,0.3);
  --btn-glow:     rgba(77,217,232,0.15);

  /* Purple — new features, coming soon, progress */
  --purple:       #7B2FBE;
  --purple-dim:   rgba(123,47,190,0.12);
  --purple-border:rgba(123,47,190,0.2);

  /* Blue — setup states */
  --blue:         #378ADD;
  --blue-dim:     rgba(55,138,221,0.12);
  --blue-border:  rgba(55,138,221,0.2);

  /* Destructive — red — delete, cancel, sign out */
  --red:          #E53E3E;
  --red-bg:       rgba(229,62,62,0.1);
  --red-border:   rgba(229,62,62,0.3);

  /* Amber — warnings, provisional state */
  --amber:        #F59E0B;
  --amber-dim:    rgba(245,158,11,0.15);
  --amber-border: rgba(245,158,11,0.3);

  /* Text */
  --text:         #E8EDF2;
  --text-mid:     #8899AA;
  --text-dim:     #6A7F8A;
  --text-muted:   #4A6070;
  --text-dark:    #2A4A5A;

  /* Green (briefing card) */
  --green-bg:     #0A2535;
  --green-border: #2ABFCC;

  /* Type stack */
  --font-serif:   'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'Space Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Spacing */
  --pad:          16px;
  --pad-sm:       12px;
  --pad-xs:       8px;
  --radius:       16px;
  --radius-sm:    12px;
  --radius-xs:    8px;
  --radius-pill:  24px;
}

/* ── Base ── */
html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #060E16;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  color: var(--text);
}

/* ── App Shell ── */
.app {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  max-width: 430px;
  margin: 0 auto;
}

/* Desktop phone shell */
@media (min-width: 431px) {
  body { background: #040A10; }
  .app {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: min(844px, 95vh);
    border-radius: 36px;
    border: 2px solid var(--border-light);
    box-shadow: 0 0 80px rgba(0,0,0,0.7);
  }
  .fixed-top { border-radius: 36px 36px 0 0; overflow: hidden; }
  .fixed-bottom { border-radius: 0 0 36px 36px; overflow: hidden; }
}

/* ── Fixed Top ── */
.fixed-top {
  flex-shrink: 0;
  background: var(--bg);
  z-index: 10;
}

/* ── Scrollable Centre ── */
.scroll-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: var(--pad-sm) var(--pad-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.scroll-body::-webkit-scrollbar { display: none; }

/* ── Fixed Bottom ── */
.fixed-bottom {
  flex-shrink: 0;
  background: var(--bg-input);
  border-top: 1px solid var(--border);
  z-index: 10;
}

/* ── Top Bar ── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(env(safe-area-inset-top), 16px) 18px 8px;
}
.menu-btn {
  width: 34px; height: 34px;
  background: #162B3E;
  border-radius: var(--radius-xs);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; border: none; cursor: pointer;
}
.menu-btn span {
  width: 14px; height: 1.5px;
  background: var(--text-mid);
  border-radius: 2px; display: block;
}
.date-text { font-size: 11px; color: var(--text-mid); }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--teal));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: white;
  border: 1.5px solid var(--teal);
}

/* ── Page Title Bar (for inner pages) ── */
.page-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(env(safe-area-inset-top), 16px) 18px 12px;
  border-bottom: 1px solid var(--border);
}
.back-btn {
  width: 34px; height: 34px;
  background: #162B3E;
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; color: var(--text-mid);
  flex-shrink: 0;
}
.page-title {
  font-size: 17px; font-weight: 600; color: var(--text);
  flex: 1;
}
.page-badge {
  font-size: 9px; font-weight: 700;
  background: var(--teal-dim);
  color: var(--teal);
  border: 1px solid var(--teal-border);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Greeting ── */
.greeting {
  padding: 4px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.greeting-label {
  font-size: 9px; color: var(--teal);
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 3px;
}
.greeting-name { font-size: 19px; font-weight: 600; color: white; margin-bottom: 2px; }
.greeting-sub { font-size: 11px; color: var(--text-mid); }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: var(--pad);
}
.card-teal {
  background: linear-gradient(135deg, #0A2535 0%, #111D2B 100%);
  border-color: var(--green-border);
}
.card-eyebrow {
  font-size: 9px; color: var(--teal);
  letter-spacing: 1px; text-transform: uppercase;
  font-weight: 700; margin-bottom: 7px;
  display: flex; align-items: center; gap: 5px;
}
.card-dot {
  width: 6px; height: 6px;
  border-radius: 50%; background: var(--teal);
  animation: pulse 2s infinite;
}
.card-title { font-size: 17px; font-weight: 600; color: white; margin-bottom: 5px; }
.card-body { font-size: 11px; color: var(--text-mid); line-height: 1.55; margin-bottom: 12px; }
.card-body span { color: var(--teal); }

/* ── Buttons ── */
.btn {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 700;
  border: none; cursor: pointer;
  transition: opacity 0.15s;
}
.btn:active { opacity: 0.85; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--btn);
  color: var(--btn-text);
}
.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-light);
}
.btn-ghost {
  background: transparent;
  color: var(--teal);
  border: 2px solid var(--teal);
}
.btn-sm {
  padding: 10px 16px;
  font-size: 12px;
  width: auto;
}

/* ── Progress bars ── */
.prog-track {
  height: 5px; background: var(--border);
  border-radius: 3px; overflow: hidden;
}
.prog-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(to right, var(--purple), var(--teal));
}
.prog-track-lg {
  height: 8px; background: #1A2D3F;
  border-radius: 4px; overflow: hidden;
}
.prog-fill-lg {
  height: 100%; border-radius: 4px;
  background: linear-gradient(to right, var(--purple), var(--teal));
}
.prog-track-sm {
  height: 3px; background: #1A2D3F;
  border-radius: 2px; overflow: hidden;
}
.prog-fill-sm {
  height: 100%; border-radius: 2px;
  background: linear-gradient(to right, var(--purple), var(--teal));
}

/* ── Badges ── */
.badge {
  border-radius: 6px; padding: 3px 7px;
  font-size: 8px; font-weight: 800;
  letter-spacing: 0.2px; white-space: nowrap;
}
.badge-live    { background: var(--teal-dim);   color: var(--teal); border: 1px solid var(--teal-border); }
.badge-setup   { background: var(--blue-dim);   color: var(--blue); border: 1px solid var(--blue-border); }
.badge-feed    { background: rgba(255,255,255,0.04); color: var(--text-muted); border: 1px solid var(--border); }
.badge-coming  { background: var(--purple-dim); color: #9D4EDD; border: 1px solid var(--purple-border); }
.badge-new     { background: var(--btn-dim);    color: var(--btn); border: 1px solid var(--btn-border); }

/* ── Pills ── */
.pill {
  border-radius: var(--radius-pill);
  padding: 3px 9px; font-size: 9px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 3px;
}
.pill-dot { width: 5px; height: 5px; border-radius: 50%; }
.pill-on  { background: var(--teal-dim); border: 1px solid var(--teal-border); color: var(--teal); }
.pill-on .pill-dot { background: var(--teal); }
.pill-off { background: #0E1E2E; border: 1px solid #2A4A5A; color: var(--text-mid); }
.pill-off .pill-dot { background: #3A5A6A; }

/* ── Input dock ── */
.input-dock { padding: 10px 13px 10px; }
.hint-row { display: flex; gap: 6px; margin-bottom: 9px; overflow-x: auto; scrollbar-width: none; }
.hint-row::-webkit-scrollbar { display: none; }
.hint {
  background: #162B3E; border-radius: var(--radius-pill);
  padding: 4px 10px; font-size: 10px;
  color: var(--teal); border: 1px solid rgba(2,195,154,0.2);
  white-space: nowrap; cursor: pointer; flex-shrink: 0;
}
.input-row { display: flex; align-items: center; gap: 8px; }
.text-wrap {
  flex: 1; background: var(--bg-card);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 14px; height: 44px; gap: 8px;
}
.text-inner {
  flex: 1; background: transparent;
  border: none; outline: none;
  font-size: 12px; color: var(--text);
}
.text-inner::placeholder { color: var(--text-muted); }
.send-btn {
  width: 30px; height: 30px;
  border-radius: 50%; background: var(--btn);
  border: none; display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer;
}
.or-div { font-size: 10px; color: var(--text-dark); }
.orb {
  width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, var(--btn), #0A9AAF);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 7px var(--btn-glow);
  cursor: pointer;
}

/* ── Bottom Nav ── */
.bottom-nav {
  background: var(--bg-input);
  padding: 8px 8px max(env(safe-area-inset-bottom), 12px);
  display: flex; justify-content: space-around;
}
.nav-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px; cursor: pointer;
}
.nav-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-xs); color: var(--text-mid);
}
.nav-icon.active { background: var(--teal-glow); color: var(--teal); }
.nav-icon.dim    { color: #2A3A46; }
.nav-label       { font-size: 9px; color: var(--text-mid); }
.nav-label.active { color: var(--teal); }
.nav-label.dim   { color: #2A3A46; }

/* ── Form elements ── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-label { font-size: 11px; color: var(--text-mid); }
.form-input {
  background: #1E2140; border: 1px solid #2A2D4A;
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-size: 14px; color: var(--text);
  outline: none; width: 100%;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus { border-color: var(--teal); }

/* ── List rows ── */
.list-row {
  display: flex; align-items: flex-start;
  gap: 10px; padding: 11px 12px;
  border-bottom: 1px solid #162230;
}
.list-row:last-child { border-bottom: none; }
.list-icon {
  width: 34px; height: 34px;
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 15px; margin-top: 1px;
}
.list-icon-teal   { background: var(--teal-dim); }
.list-icon-blue   { background: var(--blue-dim); }
.list-icon-purple { background: var(--purple-dim); }
.list-icon-muted  { background: rgba(255,255,255,0.04); }
.list-body { flex: 1; min-width: 0; }
.list-top {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 6px; margin-bottom: 3px;
}
.list-name { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.3; }
.list-name.dim    { color: var(--text-mid); font-weight: 500; }
.list-name.dimmer { color: var(--text-dim); font-weight: 500; }
.list-sub  { font-size: 9px; color: var(--text-dim); line-height: 1.4; margin-bottom: 6px; }

/* ── Divider ── */
.divider { height: 1px; background: var(--border); margin: 4px 0; }
.section-label {
  font-size: 9px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px;
  font-weight: 700; padding: 12px 0 6px;
}

/* ── Animations ── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease forwards; }

/* ── Utility ── */
.text-teal   { color: var(--teal); }
.text-cyan   { color: var(--btn); }
.text-purple { color: var(--purple); }
.text-muted  { color: var(--text-muted); }
.text-mid    { color: var(--text-mid); }
.fw-700      { font-weight: 700; }
.fw-600      { font-weight: 600; }
.text-center { text-align: center; }
.mt-8        { margin-top: 8px; }
.mt-12       { margin-top: 12px; }
.mt-16       { margin-top: 16px; }
.mb-8        { margin-bottom: 8px; }
.mb-12       { margin-bottom: 12px; }
.gap-8       { gap: 8px; }
.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
