/* BRDG Desk - shared styles.
   Direction (Refero, 15 Oct 2026): Perplexity AI - calm light workspace, charcoal on a soft canvas, ONE teal accent
   for selected/active state only, large rounded composer as the focal point, 16px cards with a single hairline shadow.
   Borrowed narrowly: status pills for approvals (shadcn / Aboard approvals) - their tints exist only inside pills. */
:root {
  --canvas: #faf8f5; --surface: #faf8f5; --text: #27251e; --text-2: #5f5d57; --text-3: #8b8a84;
  --border: #d1d1cd; --accent: #016a71; --ink: #27251e; --on-ink: #faf8f5;
  --st-pending-bg: #efece6; --st-pending: #5f5d57;
  --st-ok-bg: #e3efe6; --st-ok: #1f5f33;
  --st-no-bg: #f5e4e1; --st-no: #8a2c20;
  --shadow: rgba(0, 0, 0, 0.08) 0 1px 2px 0;
  --r-card: 16px; --r-input: 12px; --r-btn: 6px; --r-pill: 9999px;
}
:root:not([data-theme="light"]) { color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #1b1a17; --surface: #22211d; --text: #ece9e2; --text-2: #b4b1a8; --text-3: #8a877f;
    --border: #3a3832; --accent: #4fb3ba; --ink: #ece9e2; --on-ink: #1b1a17;
    --st-pending-bg: #2c2a25; --st-pending: #b4b1a8; --st-ok-bg: #1d3325; --st-ok: #8fd1a2; --st-no-bg: #3b1f1a; --st-no: #f0a99f;
    --shadow: rgba(0, 0, 0, 0.4) 0 1px 2px 0;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--text);
  font: 400 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-text-size-adjust: 100%;
}
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 720px; margin-inline: auto; padding-inline: 16px; }
header.bar { position: sticky; top: 0; z-index: 5; background: var(--canvas); border-bottom: 1px solid var(--border); }
header.bar .wrap { display: flex; align-items: center; gap: 8px; min-height: 56px; }
.brand { font-weight: 500; letter-spacing: 0.01em; white-space: nowrap; margin-right: 4px; }
.who { margin-left: auto; color: var(--text-2); font-size: 14px; white-space: nowrap; }
@media (max-width: 520px) { .who { display: none; } header.bar .wrap { padding: 0 8px; } .link { margin-left: auto; } }
.link { background: none; border: 0; padding: 8px; color: var(--text-2); font-size: 14px; cursor: pointer; border-radius: var(--r-btn); min-height: 44px; white-space: nowrap; }
.link:hover { color: var(--text); }
nav.tabs { display: flex; gap: 4px; }
nav.tabs button {
  background: none; border: 0; padding: 8px 12px; min-height: 44px; border-radius: var(--r-btn);
  color: var(--text); cursor: pointer; font-size: 14px; font-weight: 500; white-space: nowrap;
}
nav.tabs button[aria-selected="true"] { background: var(--accent); color: var(--on-ink); }
main { padding-block: 24px 260px; }
h1 { font-size: 24px; line-height: 1.25; font-weight: 500; margin: 8px 0 4px; }
.sub { color: var(--text-2); margin: 0 0 24px; font-size: 14px; }
.cards { display: grid; gap: 8px; grid-template-columns: 1fr; margin-bottom: 24px; }
@media (min-width: 560px) { .cards { grid-template-columns: 1fr 1fr; } }
.card {
  text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 12px 16px; box-shadow: var(--shadow); cursor: pointer; min-height: 44px; font-size: 14px;
}
.card:hover { border-color: var(--accent); }
.msg { margin: 0 0 16px; scroll-margin-bottom: 260px; }
.msg .who-l { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.msg.user .body { background: var(--st-pending-bg); border-radius: var(--r-card); padding: 8px 12px; display: inline-block; max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.bot .body { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px 16px; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.msg .body p { margin: 0 0 8px; } .msg .body p:last-child { margin-bottom: 0; }
.msg .body ul { margin: 0 0 8px; padding-left: 20px; }
.msg.note .body { color: var(--text-2); font-size: 14px; background: none; border: 0; box-shadow: none; padding: 0; }
.composer { position: fixed; left: 0; right: 0; bottom: 0; background: linear-gradient(to top, var(--canvas) 78%, transparent); padding: 16px 0 12px; }
.composer form { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea {
  flex: 1; resize: none; min-height: 48px; max-height: 160px; padding: 12px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-input); line-height: 1.4;
}
.composer textarea::placeholder { color: var(--text-3); }
.send { width: 48px; height: 48px; border: 0; border-radius: var(--r-input); background: var(--ink); color: var(--on-ink); cursor: pointer; font-size: 18px; flex: none; }
.send:disabled { opacity: 0.45; cursor: default; }
.hint { color: var(--text-3); font-size: 12px; margin: 8px 0 0; text-align: center; }
.pill { display: inline-block; border: 1px solid var(--border); border-radius: var(--r-pill); padding: 2px 10px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.pill.st-pending { background: var(--st-pending-bg); border-color: transparent; color: var(--st-pending); }
.pill.st-approved, .pill.st-done, .pill.st-answered { background: var(--st-ok-bg); border-color: transparent; color: var(--st-ok); }
.pill.st-denied { background: var(--st-no-bg); border-color: transparent; color: var(--st-no); }
.ticket { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px 16px; margin: 0 0 8px; box-shadow: var(--shadow); }
.ticket .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 4px; }
.ticket .id { font-weight: 500; }
.ticket .meta { color: var(--text-2); font-size: 14px; }
.ticket .note { margin-top: 8px; font-size: 14px; border-left: 2px solid var(--accent); padding-left: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn { border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-btn); padding: 8px 16px; min-height: 44px; cursor: pointer; font-weight: 500; }
.btn.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn:disabled { opacity: 0.5; cursor: default; }
.field { width: 100%; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-input); }
.mt { margin-top: 12px; }
.login { max-width: 360px; margin: 20vh auto 0; }
.login h1 { font-size: 20px; }
.err { color: var(--st-no); font-size: 14px; min-height: 20px; margin: 8px 0; }
.ticket .err { min-height: 0; margin: 4px 0 0; }
.empty { color: var(--text-2); padding: 24px 0; text-align: center; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.filters button { border: 1px solid var(--border); background: none; border-radius: var(--r-pill); padding: 4px 14px; min-height: 36px; cursor: pointer; font-size: 14px; }
.filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-ink); }
.qa { margin: 0 0 12px; font-size: 14px; }
.qa .q { font-weight: 500; } .qa .a { color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: no-preference) { .card, .btn { transition: border-color 0.12s; } }
