/* ============================================================================
   Executive Assistant — dashboard theme.
   EDIT COLORS/SPACING HERE: every color and size is a token below. Change a
   value once and it applies everywhere. (e.g. --primary is the green buttons.)
   ============================================================================ */
:root {
  /* surfaces */
  --bg: #0f1216;
  --surface: #161b22;
  --surface-2: #1b222b;
  --border: #232a33;
  /* text */
  --text: #e7ebf0;
  --muted: #8b949e;
  --link: #7cc4ff;
  /* actions */
  --primary: #238636;
  --primary-hover: #2ea043;
  --danger: #da3633;
  --danger-hover: #f85149;
  --secondary: #30363d;
  --secondary-hover: #3d444d;
  /* risk accents (left border on approval cards) */
  --risk-low: #3fb950;
  --risk-medium: #d29922;
  --risk-high: #f85149;
  /* component fills (themable) */
  --input-bg: #0d1117;
  --ok-bg: #12261a;
  --warn-bg: #2b2410;
  --err-bg: #3d1418;
  --secondary-text: #fff;
  /* shape */
  --radius: 12px;
  --radius-sm: 9px;
  --maxw: 720px;
  --gap: 12px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.55 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; }
h2 { font-size: 24px; font-weight: 700; margin: 8px 0 18px; letter-spacing: -0.01em; }
/* Section headers read as distinct "eyebrows" — clearly not body text, so a
   screen full of same-size bold text stops looking flat/cluttered. Card titles
   keep their own look (see .card h3 below). */
h3 { font-size: 13px; font-weight: 700; text-transform: uppercase;
     letter-spacing: 0.06em; color: var(--muted); margin: 28px 0 10px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 18px; }
.muted { color: var(--muted); font-size: 14px; }
.spacer { height: 8px; }

/* Collapsible groups — tuck less-used settings/detail behind a tap so the
   screen isn't a wall of controls. Native <details>, zero JS. */
details.group {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); margin: 12px 0; padding: 0 16px;
}
details.group > summary {
  cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::after { content: "⌄"; color: var(--muted); font-size: 18px; }
details.group[open] > summary { border-bottom: 1px solid var(--border); }
details.group[open] { padding-bottom: 16px; }
details.group > summary + * { margin-top: 14px; }

/* --- top nav --------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.tabs { display: flex; gap: 4px; margin-left: 4px; flex: 1; overflow-x: auto; }
.tabs a {
  color: var(--muted); padding: 7px 12px; border-radius: 999px;
  white-space: nowrap; font-size: 15px;
}
.tabs a:hover { color: var(--text); text-decoration: none; background: var(--surface-2); }
.tabs a.active { color: var(--text); background: var(--surface-2); }

/* --- buttons --------------------------------------------------------------- */
.btn, button, input[type=submit] {
  font: inherit; font-weight: 600;
  padding: 10px 16px; border: 0; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff; cursor: pointer;
  display: inline-block; text-align: center;
}
.btn:hover, button:hover { background: var(--primary-hover); text-decoration: none; }
.btn.secondary, button.secondary { background: var(--secondary); color: var(--secondary-text); }
.btn.secondary:hover, button.secondary:hover { background: var(--secondary-hover); }
.btn.danger, button.danger { background: var(--danger); }
.btn.danger:hover, button.danger:hover { background: var(--danger-hover); }
.btn.sm, button.sm { padding: 7px 12px; font-size: 14px; }
button:disabled { opacity: .55; cursor: default; }
button:disabled:hover { background: var(--secondary); }
.form-inline { display: inline; }
.row { display: flex; gap: var(--gap); flex-wrap: wrap; align-items: center; }
.row.mt { margin-top: var(--gap); }

/* --- cards ----------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px; margin: 12px 0;
}
.card .title { font-weight: 700; }
.card.risk-low { border-left: 4px solid var(--risk-low); }
.card.risk-medium { border-left: 4px solid var(--risk-medium); }
.card.risk-high { border-left: 4px solid var(--risk-high); }
.pill {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted);
}
.empty { text-align: center; color: var(--muted); padding: 46px 0; }
pre.digest { white-space: pre-wrap; margin: 0; font: 14px/1.5 ui-monospace, monospace; }

/* --- forms ----------------------------------------------------------------- */
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 4px; }
input[type=email], input[type=password], input[type=text], select, textarea {
  width: 100%; padding: 12px; font: inherit;
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--secondary); border-radius: var(--radius-sm);
}
textarea { min-height: 160px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.check input { width: auto; }
.check label { margin: 0; color: var(--text); }
.auth { max-width: 380px; margin: 6vh auto; }

/* --- paste button ----------------------------------------------------------- */
.paste-btn { margin-top: 8px; }

/* --- footer ---------------------------------------------------------------- */
.foot { text-align: center; color: var(--muted); font-size: 12px;
  padding: 22px 16px 28px; }

/* --- flash ----------------------------------------------------------------- */
.flash { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; }
.flash.ok { background: var(--ok-bg); border: 1px solid var(--risk-low); }
.flash.err { background: var(--err-bg); border: 1px solid var(--risk-high); }

/* --- landing --------------------------------------------------------------- */
.hero { text-align: center; padding: 8vh 0 4vh; }
.hero h1 { font-size: 34px; margin: 0 0 10px; }
.hero p { color: var(--muted); font-size: 18px; max-width: 520px; margin: 0 auto 22px; }
.features { display: grid; gap: 12px; grid-template-columns: 1fr; margin-top: 20px; }
@media (min-width: 560px) { .features { grid-template-columns: 1fr 1fr; } }
.hero-logo { width: 72px; height: 72px; margin: 0 auto 18px; display: block; border-radius: 20px; }

/* --- brand mark in nav ----------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-mark { border-radius: 7px; display: block; }

/* --- grids / cards --------------------------------------------------------- */
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .grid.two { grid-template-columns: 1fr 1fr; } }
@media (min-width: 720px) { .grid.three { grid-template-columns: 1fr 1fr 1fr; } }
.card h3 { margin: 0 0 6px; font-size: 17px; text-transform: none;
           letter-spacing: 0; color: var(--text); }
.card.linkable:hover { border-color: var(--secondary-hover); }
.stack > * + * { margin-top: 10px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* --- badges / status ------------------------------------------------------- */
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px;
  border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge.ok { background: var(--ok-bg); color: var(--risk-low); }
.badge.warn { background: var(--warn-bg); color: var(--risk-medium); }
.badge.off { background: var(--err-bg); color: var(--risk-high); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot.ok { background: var(--risk-low); }
.dot.off { background: var(--risk-high); }

/* --- integration / connect logos ------------------------------------------- */
.logo-tile { width: 34px; height: 34px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 18px; background: var(--surface-2); }

/* --- tables / lists -------------------------------------------------------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.evt { display: flex; gap: 12px; align-items: baseline; }
.evt .when { color: var(--muted); font-size: 13px; min-width: 128px; flex: none; }
.task-done { text-decoration: line-through; color: var(--muted); }

/* --- plans ----------------------------------------------------------------- */
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; }
.plan.current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.plan .price { font-size: 30px; font-weight: 700; margin: 6px 0 2px; }
.plan .price small { font-size: 14px; font-weight: 400; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 12px 0; flex: 1; }
.plan ul li { padding: 5px 0; color: var(--text); font-size: 14px; }
.plan ul li::before { content: "✓"; color: var(--risk-low); margin-right: 8px; }

/* --- steps (onboarding) ---------------------------------------------------- */
.step { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--border); }
.step .num { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.step.done .num { background: var(--primary); color: #fff; }
.help { font-size: 13px; color: var(--muted); margin-top: 4px; }


/* ============================================================================
   Color schemes — per-user, picked in Settings. Each theme only overrides
   tokens; components never change. body[data-theme] is set by base.html.
   ============================================================================ */
body[data-theme="daylight"] {
  --bg: #f5f7fa; --surface: #ffffff; --surface-2: #eef1f5; --border: #d8dee6;
  --text: #1c2128; --muted: #5b6470; --link: #0b63ce;
  --primary: #1a7f37; --primary-hover: #116329;
  --secondary: #dfe5ec; --secondary-hover: #cfd8e3; --secondary-text: #1c2128;
  --danger: #d1242f; --danger-hover: #a40e26;
  --risk-low: #1a7f37; --risk-medium: #9a6700; --risk-high: #d1242f;
  --input-bg: #ffffff; --ok-bg: #dcfae6; --warn-bg: #fff3d1; --err-bg: #ffe1e0;
}
body[data-theme="ocean"] {
  --bg: #0a1424; --surface: #101d33; --surface-2: #16263f; --border: #1f3352;
  --link: #79b8ff; --primary: #2f6feb; --primary-hover: #4c84f3;
  --secondary: #22345a; --secondary-hover: #2c4270;
  --input-bg: #081020; --ok-bg: #0e2a3a; --warn-bg: #2b2410; --err-bg: #3d1425;
}
body[data-theme="violet"] {
  --bg: #120f1d; --surface: #191430; --surface-2: #221b40; --border: #2c2450;
  --link: #c4b5fd; --primary: #7c3aed; --primary-hover: #8b5cf6;
  --secondary: #2e2554; --secondary-hover: #3a2f6a;
  --input-bg: #0e0b18; --ok-bg: #1b2036; --warn-bg: #2b2410; --err-bg: #3d1430;
}
body[data-theme="sunset"] {
  --bg: #171210; --surface: #211915; --surface-2: #2b2019; --border: #3a2b20;
  --link: #fdba74; --primary: #ea7317; --primary-hover: #f08c2e;
  --secondary: #3a2d22; --secondary-hover: #4a3a2c;
  --input-bg: #120d0a; --ok-bg: #1e2a1a; --warn-bg: #332a10; --err-bg: #3d1a14;
}


body[data-theme="rose"] {
  --bg: #1a1016; --surface: #241521; --surface-2: #2e1a2a; --border: #3d2238;
  --link: #f9a8d4; --primary: #db2777; --primary-hover: #ec4899;
  --secondary: #3a2434; --secondary-hover: #4a2e42;
  --input-bg: #140c11; --ok-bg: #1c2a20; --warn-bg: #2b2410; --err-bg: #3d1420;
}
body[data-theme="crimson"] {
  --bg: #160f10; --surface: #201415; --surface-2: #2a1a1b; --border: #3a2426;
  --link: #fca5a5; --primary: #dc2626; --primary-hover: #ef4444;
  --secondary: #382426; --secondary-hover: #452e30;
  --input-bg: #100b0c; --ok-bg: #16281c; --warn-bg: #2b2410; --err-bg: #421318;
}
body[data-theme="royal"] {
  --bg: #0d1230; --surface: #141a3f; --surface-2: #1b234f; --border: #262f63;
  --link: #ffd166; --primary: #2b4acb; --primary-hover: #3d5ce0;
  --secondary: #232c58; --secondary-hover: #2d3868;
  --risk-medium: #ffd166;
  --input-bg: #0a0e26; --ok-bg: #12283a; --warn-bg: #332a10; --err-bg: #3d1425;
}
body[data-theme="forest"] {
  --bg: #0c1510; --surface: #122017; --surface-2: #18291e; --border: #22382a;
  --link: #fcd34d; --primary: #15803d; --primary-hover: #16a34a;
  --secondary: #21332a; --secondary-hover: #2b4034;
  --input-bg: #08100b; --ok-bg: #12261a; --warn-bg: #332a10; --err-bg: #3d1418;
}
body[data-theme="gold"] {
  --bg: #121212; --surface: #1b1b1b; --surface-2: #242424; --border: #333;
  --link: #fcd34d; --primary: #b8860b; --primary-hover: #d4a017;
  --secondary: #2e2a20; --secondary-hover: #3a3428;
  --risk-medium: #fcd34d;
  --input-bg: #0d0d0d; --ok-bg: #14261a; --warn-bg: #332a10; --err-bg: #3d1418;
}
body[data-theme="steel"] {
  --bg: #101418; --surface: #171d24; --surface-2: #1f2731; --border: #2c3743;
  --link: #9fc5ee; --primary: #4a7ab5; --primary-hover: #5b8dc9;
  --secondary: #2a3542; --secondary-hover: #354251;
  --input-bg: #0b0f13; --ok-bg: #12261e; --warn-bg: #2b2410; --err-bg: #3d1418;
}
body[data-theme="teal"] {
  --bg: #0a1717; --surface: #102020; --surface-2: #162a2a; --border: #213838;
  --link: #5eead4; --primary: #0d9488; --primary-hover: #14b8a6;
  --secondary: #1f3434; --secondary-hover: #294242;
  --input-bg: #071111; --ok-bg: #10261f; --warn-bg: #2b2410; --err-bg: #3d1418;
}

/* --- theme picker (Settings) ------------------------------------------------ */
.theme-row { gap: 8px; }
.theme-chip { display: inline-flex; align-items: center; gap: 8px; margin: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 14px; cursor: pointer; color: var(--text);
  font-size: 14px; }
.theme-chip input { width: auto; accent-color: var(--primary); }
.swatch { width: 18px; height: 18px; border-radius: 50%; display: inline-block;
  border: 1px solid rgba(128,128,128,.4); }
.sw-midnight { background: linear-gradient(135deg, #0f1216 50%, #238636 50%); }
.sw-daylight { background: linear-gradient(135deg, #f5f7fa 50%, #1a7f37 50%); }
.sw-ocean    { background: linear-gradient(135deg, #0a1424 50%, #2f6feb 50%); }
.sw-violet   { background: linear-gradient(135deg, #120f1d 50%, #7c3aed 50%); }
.sw-sunset   { background: linear-gradient(135deg, #171210 50%, #ea7317 50%); }

.sw-rose     { background: linear-gradient(135deg, #1a1016 50%, #db2777 50%); }
.sw-crimson  { background: linear-gradient(135deg, #160f10 50%, #dc2626 50%); }
.sw-royal    { background: linear-gradient(135deg, #0d1230 50%, #ffd166 50%); }
.sw-forest   { background: linear-gradient(135deg, #0c1510 50%, #fcd34d 50%); }
.sw-gold     { background: linear-gradient(135deg, #121212 50%, #d4a017 50%); }
.sw-steel    { background: linear-gradient(135deg, #101418 50%, #9fc5ee 50%); }
.sw-teal     { background: linear-gradient(135deg, #0a1717 50%, #14b8a6 50%); }

/* --- floating chat button ---------------------------------------------------- */
.chat-fab { position: fixed; right: 18px; bottom: 18px; z-index: 50;
  width: 54px; height: 54px; border-radius: 50%; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 24px; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.chat-fab:hover { background: var(--primary-hover); text-decoration: none; }

/* --- chat page --------------------------------------------------------------- */
.chat-log { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: 15px;
  white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--primary); color: #fff;
  border-bottom-right-radius: 4px; }
.msg.eve { align-self: flex-start; background: var(--surface-2); color: var(--text);
  border-bottom-left-radius: 4px; }
.chat-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

/* --- guided tours ------------------------------------------------------------ */
.guide-target { outline: 3px solid var(--primary); outline-offset: 3px;
  border-radius: 8px; }
.guide-bubble { background: var(--surface); border: 1px solid var(--primary);
  border-radius: var(--radius); padding: 12px 14px; margin-top: 10px;
  font-size: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.guide-step { color: var(--muted); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }

/* --- phone navigation: bottom tab bar --------------------------------------
   The top pill-tabs scroll horizontally with no visual hint, so on a phone 8
   of 11 destinations were effectively invisible. Under 900px the top tabs and
   Log out hide; four thumb-reachable tabs + a More menu take over. */
main.wrap { padding-bottom: 84px; } /* the chat bubble never covers the last button */
.bottom-nav { display: none; }
@media (max-width: 899px) {
  .tabs, .nav .form-inline { display: none; }
  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; align-items: stretch;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 3px; padding: 4px 0; border-radius: 10px;
    color: var(--muted); font-size: 11px; font-weight: 600;
  }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav a.active { color: var(--text); }
  .bottom-nav svg { width: 22px; height: 22px; }
  main.wrap { padding-bottom: 108px; }
  .chat-fab { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  .foot { padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
}

/* The More page: tappable rows, iOS-settings style. */
.menu-list { padding: 0; overflow: hidden; }
.menu-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; color: var(--text); font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.menu-list a:last-child { border-bottom: 0; }
.menu-list a:hover { background: var(--surface-2); text-decoration: none; }

/* Quiet destructive: Reject on approval cards is an outline, so each card has
   ONE loud button (Approve). Filled red stays for true points of no return
   (delete account, erase a person). */
.btn.danger.ghost, button.danger.ghost {
  background: transparent; color: var(--danger-hover);
  box-shadow: inset 0 0 0 1px var(--danger);
}
.btn.danger.ghost:hover, button.danger.ghost:hover { background: var(--danger); color: #fff; }

/* Landing: the product, in a phone, above the fold. */
.phone-frame {
  max-width: 290px; margin: 30px auto 6px;
  border: 9px solid #05070a; border-radius: 34px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45), 0 0 0 1px var(--border);
  overflow: hidden; background: #05070a;
}
.phone-frame img { display: block; width: 100%; }

/* Landing: the privacy promise — a selling point, not fine print. */
.promise {
  border: 1px solid var(--primary); background: var(--surface);
  border-radius: var(--radius); padding: 22px 20px; margin: 24px auto 0;
  max-width: 560px; text-align: center;
}
.promise h2 { margin: 0 0 8px; font-size: 20px; }
.promise p { margin: 0 0 8px; }

/* First-run AI-key reminder (and any future modal). */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, .55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal { max-width: 380px; width: 100%; margin: 0; }
