/* ============================================================
   Tamarillo Meeting Hub — brand design system
   Palette from Tamarillo Pantone deck. Fonts: Playfair Display + Lato.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=Lato:wght@400;700&display=swap');

/* Branch — Tamarillo's licensed display typeface, used for large titles.
   Falls back to Playfair Display where Branch can't load. */
@font-face {
  font-family: 'Branch';
  src: url('../assets/fonts/Branch.otf') format('opentype'),
       url('../assets/fonts/Branch.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand palette */
  --sage:        #8A9B8E;
  --sage-dark:   #6E8073;
  --sage-deep:   #5E7163;   /* buttons / links — legible with white text */
  --sage-deeper: #4C5B50;   /* hover + deep gradient */
  --sage-tint:   #EAEEE9;
  --teal:        #417571;
  --teal-deep:   #45616B;
  --terracotta:  #B95C3A;
  --terracotta-dark: #9E4A2C;
  --mustard:     #E1B744;
  --pink:        #E1BBB4;
  --sand:        #EFDBB2;

  /* Neutrals (warm) */
  --cream:       #FBF9F5;
  --surface:     #FFFFFF;
  --ink:         #3D3D3D;
  --ink-soft:    #65665C;
  --muted:       #97999B;
  --line:        #E7E2DA;
  --line-soft:   #F0ECE5;

  /* System */
  --radius:      14px;
  --radius-sm:   9px;
  --shadow-sm:   0 1px 2px rgba(61,61,61,.06), 0 1px 3px rgba(61,61,61,.05);
  --shadow-md:   0 4px 16px rgba(61,61,61,.08);
  --shadow-lg:   0 12px 40px rgba(61,61,61,.14);
  --ease:        cubic-bezier(.4, 0, .2, 1);

  --font-display: 'Branch', 'Playfair Display', Georgia, serif;  /* large titles */
  --font-head:   'Playfair Display', Georgia, serif;             /* smaller headings, numbers */
  --font-body:   'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: var(--font-display); font-weight: normal; color: var(--ink); line-height: 1.15; }
h3, h4 { font-family: var(--font-head); font-weight: 600; color: var(--ink); line-height: 1.2; }
a { color: var(--sage-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 15px; }

.hidden { display: none !important; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 700; font-size: 14px; letter-spacing: .01em; line-height: 1;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .06s var(--ease), box-shadow .18s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--sage-deep); color: #fff; }
.btn-primary:hover { background: var(--sage-deeper); }
.btn-accent { background: var(--terracotta); color: #fff; }
.btn-accent:hover { background: var(--terracotta-dark); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { background: var(--line-soft); color: var(--ink); }
.btn-subtle { background: var(--sage-tint); color: var(--sage-deeper); }
.btn-subtle:hover { background: #dfe6dd; }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   Login screen
   ============================================================ */
.login {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr;
}
.login__hero {
  position: relative; overflow: hidden; padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(155deg, #7C8E80 0%, var(--sage-deep) 52%, var(--sage-deeper) 100%);
  color: #fff;
}
.login__hero::after {
  content: ''; position: absolute; right: -120px; bottom: -140px;
  width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(239,219,178,.42), rgba(239,219,178,0) 70%);
}
.login__hero img { width: 230px; position: relative; z-index: 1; }
.login__hero-copy { position: relative; z-index: 1; max-width: 420px; }
.login__hero-copy h1 { color: #fff; font-size: 38px; font-weight: normal; margin-bottom: 14px; letter-spacing: .01em; }
.login__hero-copy p { color: rgba(255,255,255,.82); font-size: 16px; }
.login__hero-foot { position: relative; z-index: 1; font-size: 13px; color: rgba(255,255,255,.6); }

.login__panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login__card { width: 100%; max-width: 380px; text-align: center; }
.login__card .eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: 11px; font-weight: 700; color: var(--sage-deep); margin-bottom: 14px; }
.login__card h2 { font-size: 26px; margin-bottom: 8px; }
.login__card > p { color: var(--ink-soft); margin-bottom: 30px; }

.btn-google {
  width: 100%; background: #fff; color: var(--ink); border: 1px solid var(--line);
  padding: 13px; font-size: 15px; box-shadow: var(--shadow-sm);
}
.btn-google:hover { background: #fafafa; box-shadow: var(--shadow-md); }
.btn-google svg { width: 19px; height: 19px; }

.login__note { margin-top: 22px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.login__banner {
  margin-bottom: 24px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--sand); color: #7a5a1e; font-size: 13px; text-align: left; border: 1px solid #e8cd93;
}
.login__error { margin-top: 18px; color: var(--terracotta-dark); font-size: 13.5px; }

@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login__hero { min-height: 230px; padding: 36px; }
  .login__hero-copy h1 { font-size: 26px; }
}

/* ============================================================
   App shell
   ============================================================ */
.app { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }

.sidebar {
  background: linear-gradient(180deg, var(--sage-deep) 0%, var(--sage-deeper) 100%);
  color: #fff; padding: 24px 16px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar__logo { padding: 6px 8px 26px; }
.sidebar__logo img { width: 150px; }
.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav__item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.78); font-weight: 700; font-size: 14px; background: transparent; border: none;
  text-align: left; width: 100%; transition: background .16s var(--ease), color .16s var(--ease);
}
.nav__item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav__item.is-active { background: rgba(255,255,255,.14); color: #fff; }
.nav__item svg { width: 19px; height: 19px; flex-shrink: 0; }
.sidebar__foot { border-top: 1px solid rgba(255,255,255,.14); padding-top: 16px; margin-top: 8px; }
.sidebar__user { display: flex; align-items: center; gap: 11px; padding: 4px 6px; }
.sidebar__avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--sage); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; overflow: hidden;
}
.sidebar__avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar__user-meta { overflow: hidden; }
.sidebar__user-meta strong { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-meta span { font-size: 11.5px; color: rgba(255,255,255,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.sidebar__signout { margin-top: 12px; width: 100%; background: rgba(255,255,255,.1); color: #fff; font-size: 13px; padding: 9px; }
.sidebar__signout:hover { background: rgba(255,255,255,.2); }

.main { padding: 34px 40px 60px; max-width: 1160px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-head h1 { font-size: 30px; }
.page-head p { color: var(--ink-soft); margin-top: 4px; }
.page-head .eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 700; color: var(--sage-deep); margin-bottom: 6px; }

/* Preview-mode ribbon */
.preview-ribbon {
  background: var(--mustard); color: #4a3a08; text-align: center; font-size: 13px; font-weight: 700;
  padding: 7px 16px; letter-spacing: .01em;
}
.preview-ribbon a { color: #4a3a08; text-decoration: underline; }

@media (max-width: 780px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: 12px 16px; }
  .sidebar__logo { padding: 0 12px 0 0; }
  .sidebar__logo img { width: 120px; }
  .nav { flex-direction: row; gap: 2px; overflow-x: auto; }
  .nav__item span { display: none; }
  .sidebar__foot { border-top: none; padding-top: 0; margin: 0 0 0 auto; }
  .sidebar__user-meta, .sidebar__signout { display: none; }
  .main { padding: 22px 18px 50px; }
}

/* ============================================================
   Cards, grids, stats
   ============================================================ */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 34px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.stat__label { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.stat__value { font-family: var(--font-head); font-size: 34px; font-weight: 600; color: var(--sage-deep); margin-top: 6px; }
.stat__foot { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 16px; }
.section-head h2 { font-size: 20px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm); transition: box-shadow .18s var(--ease), transform .1s var(--ease), border-color .18s var(--ease);
  cursor: pointer; position: relative;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--sage); transform: translateY(-2px); }
.card__title { font-family: var(--font-head); font-size: 18px; font-weight: 600; margin-bottom: 3px; }
.card__sub { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.card__meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12.5px; color: var(--muted); }
.card__meta span { display: inline-flex; align-items: center; gap: 5px; }

.avatar-dot {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 17px; color: #fff; margin-bottom: 14px;
}

/* Pills / tags */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 100px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em; text-transform: capitalize;
}
.pill--boardroom { background: #e7edf0; color: var(--teal-deep); }
.pill--sales { background: var(--sage-tint); color: var(--sage-dark); }
.pill--other { background: #f0ece5; color: var(--ink-soft); }
.pill--lead { background: var(--sand); color: #7a5a1e; }
.pill--active { background: var(--sage-tint); color: var(--sage-dark); }
.pill--dormant { background: #f0ece5; color: var(--muted); }
.pill--prospect { background: #f3e0d9; color: var(--terracotta-dark); }

/* ============================================================
   List / table view
   ============================================================ */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.list__row {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
  padding: 15px 20px; border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background .14s var(--ease);
}
.list__row:last-child { border-bottom: none; }
.list__row:hover { background: var(--cream); }
.list__main strong { font-family: var(--font-head); font-weight: 600; font-size: 16px; }
.list__main .sub { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.list__side { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }

.empty {
  text-align: center; padding: 60px 24px; color: var(--ink-soft);
  border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface);
}
.empty h3 { font-size: 19px; margin-bottom: 6px; }
.empty p { margin-bottom: 18px; }

/* ============================================================
   Detail view
   ============================================================ */
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); background: none; border: none; padding: 0; margin-bottom: 18px; }
.back-link:hover { color: var(--teal); }
.detail-cols { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; margin-top: 26px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.panel + .panel { margin-top: 20px; }
.panel h3 { font-size: 17px; margin-bottom: 14px; }
.field-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.field-row:last-child { border-bottom: none; }
.field-row .k { color: var(--muted); font-weight: 700; }
.field-row .v { text-align: right; color: var(--ink); }
.notes-block { white-space: pre-wrap; font-size: 14.5px; line-height: 1.65; color: var(--ink); }

@media (max-width: 820px) { .detail-cols { grid-template-columns: 1fr; } }

/* ============================================================
   Forms + modal
   ============================================================ */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(45,55,58,.42); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 24px; z-index: 100; animation: fade .16s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: pop .2s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal__head { padding: 22px 26px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; }
.modal__head h2 { font-size: 21px; }
.modal__close { background: none; border: none; font-size: 24px; color: var(--muted); line-height: 1; padding: 0 4px; }
.modal__close:hover { color: var(--ink); }
.modal__body { padding: 22px 26px; }
.modal__foot { padding: 16px 26px 22px; display: flex; justify-content: flex-end; gap: 10px; }

.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label.form-label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.input, .textarea, .select {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-tint); }
.textarea { resize: vertical; min-height: 92px; line-height: 1.55; }

/* Toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 100px; font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow-lg); z-index: 200; animation: toast-in .25s var(--ease);
}
.toast--ok { background: var(--teal); }
.toast--err { background: var(--terracotta-dark); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }

/* Loading */
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--sage); border-radius: 50%; animation: spin .7s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Phase 2 — AI briefings
   ============================================================ */
.hint { font-size: 13px; color: var(--muted); line-height: 1.55; }
.section-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sage-deep); margin: 18px 0 12px; }

.ai-loading { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: 14px; padding: 22px 4px; }

.brief-sec { margin-bottom: 16px; }
.brief-sec h4 { font-family: var(--font-head); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sage-deep); padding-bottom: 5px; border-bottom: 1px solid var(--line-soft); margin-bottom: 8px; }
.briefing-body { font-size: 14.5px; line-height: 1.7; color: var(--ink); }
.briefing-body ul { padding-left: 1.2rem; margin: 0; }
.briefing-body li { margin-bottom: 4px; }
.briefing-body p { margin: 0; }

.research-card {
  background: var(--sage-tint); border: 1px solid var(--line);
  border-left: 3px solid var(--terracotta); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px; margin-bottom: 18px; font-size: 13.5px; line-height: 1.6; color: var(--ink);
}
.research-card p { margin-bottom: 6px; }
.research-card ul { padding-left: 1.1rem; margin: 2px 0 6px; }
.research-card li { margin-bottom: 2px; }
.rc-title { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sage-deep); margin-bottom: 8px; }
.r-sub { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin: 8px 0 2px; }

/* ============================================================
   Glow clients — loyalty tiers + product thumbnails
   ============================================================ */
.pill--rosegold { background: #f6e2d6; color: #9c5a2f; }
.pill--gold     { background: #f4ecc6; color: #856a16; }
.pill--silver   { background: #e7eaee; color: #566370; }
.pill--bronze   { background: #ecdcc7; color: #85512a; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 14px; margin-bottom: 8px; }
.product-card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm);
  transition: box-shadow .16s var(--ease), transform .1s var(--ease), border-color .16s var(--ease);
}
.product-card:hover { box-shadow: var(--shadow-md); border-color: var(--sage); transform: translateY(-2px); text-decoration: none; }
.thumb { aspect-ratio: 1 / 1; background: var(--sage-tint); overflow: hidden; display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-empty { font-size: 11px; color: var(--muted); }
.product-name { padding: 8px 10px; font-size: 12.5px; line-height: 1.35; font-weight: 700; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
