/* App UI shared by the customer account (/account) and the CRM (crm.bidsignal.co).
   Loaded after site.css. */

.h3 { font-size: 1.15rem; font-weight: 800; margin: 0 0 12px; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.small, small.muted { font-size: 13px; }
.warn-text { color: #a15c00; }
.overdue { color: var(--red); font-weight: 700; }
.inline { display: inline; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--violet); cursor: pointer; text-decoration: underline; }
.linkbtn.danger { color: var(--red); }
.linkbtn.small { font-size: 12px; }
.btn-ghost { background: #fff; color: var(--violet); border: 1px solid var(--violet); }
.btn-ghost:hover { background: var(--violet-soft); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 40px 0 28px; }
.flash { margin-top: 16px; }
select, textarea { font: inherit; font-size: 15px; padding: 9px 11px; border: 1px solid #cfcfe0; border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
textarea { resize: vertical; }
input[type="password"] { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid #cfcfe0; border-radius: 8px; }
input[type="date"] { font: inherit; padding: 10px 12px; border: 1px solid #cfcfe0; border-radius: 8px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.empty { padding: 32px 0; }

/* ---------- Customer account ---------- */
.subnav { border-bottom: 1px solid var(--line); background: var(--bg-alt); }
.subnav-inner { display: flex; justify-content: space-between; align-items: center; height: 48px; }
.subnav nav { display: flex; gap: 20px; }
.subnav nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.subnav nav a[aria-current="page"] { color: var(--violet); }
.account { padding: 32px 0 80px; }

.board { display: grid; grid-template-columns: repeat(6, minmax(200px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.column { background: var(--bg-alt); border-radius: 12px; padding: 12px; min-height: 140px; }
.column h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 2px 4px 10px; display: flex; justify-content: space-between; }
.column h2 span { background: #fff; border-radius: 10px; padding: 0 8px; font-size: 12px; }
.column-won h2 { color: var(--green); }
.column-lost h2, .column-no_bid h2 { color: #8a8aa3; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.pcard-title { display: block; font-weight: 700; font-size: 14px; line-height: 1.35; color: var(--ink); text-decoration: none; }
.pcard-title:hover { color: var(--violet); }
.pcard-meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.pcard-due { font-size: 12.5px; margin-top: 6px; font-weight: 600; }
.pcard-due.urgent { color: var(--red); }
.pcard-due.past { color: #8a8aa3; text-decoration: line-through; }
.pcard-flag { font-size: 12px; color: #a15c00; margin-top: 4px; }
.pcard-notes { font-size: 12.5px; color: #33334d; background: var(--bg-alt); border-radius: 6px; padding: 6px 8px; margin: 8px 0 0; }
.pcard details { margin-top: 8px; font-size: 13px; }
.pcard summary { cursor: pointer; color: var(--violet); font-weight: 600; }
.pcard-form { display: grid; gap: 8px; margin: 8px 0; }
.pcard-form label { font-size: 12px; font-weight: 700; color: var(--muted); display: grid; gap: 4px; }
.pcard-form select, .pcard-form textarea { font-size: 13px; padding: 6px 8px; }
.recent { margin-top: 48px; }
.recent-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.recent-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px; border-top: 1px solid var(--line); }
.recent-row:first-child { border-top: 0; }
.recent-title { font-weight: 700; color: var(--ink); text-decoration: none; }
.recent-title:hover { color: var(--violet); }

/* ---------- CRM ---------- */
body.crm { background: #f7f7fb; }
.crm-nav { background: #fff; }
.crm-badge { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; background: var(--ink); color: #fff; border-radius: 4px; padding: 2px 6px; vertical-align: middle; }
.crm-nav nav { display: flex; gap: 22px; align-items: center; }
.crm-nav nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; display: inline; }
.crm-nav nav a[aria-current="page"] { color: var(--violet); }
.crm-main { padding: 28px 0 64px; }
.crm-footer { padding: 24px 0; font-size: 13px; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 16px 0 20px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.tile-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.tile-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.tile-value.small { font-size: 1.2rem; }
.tile-sub { font-size: 13px; color: var(--muted); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-2 + .panel { margin-top: 20px; }
.lead-grid { grid-template-columns: 1.4fr 1fr; }
.health { list-style: none; padding: 0; margin: 0; }
.health li { padding: 8px 0 8px 22px; border-top: 1px solid var(--line); position: relative; font-size: 14.5px; }
.health li:first-child { border-top: 0; }
.health li::before { content: ""; position: absolute; left: 2px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.health li.bad::before { background: var(--red); }
.health li.warn::before { background: #e0a100; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fbfbfd; }
.table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.table tr:first-child td { border-top: 0; }
.table a { color: var(--ink); }
.table a:hover { color: var(--violet); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 10px; background: #ececf4; color: #4a4a66; white-space: nowrap; }
.pill-active, .pill-customer, .pill-won { background: #e3f5ea; color: var(--green); }
.pill-trial, .pill-interested { background: var(--violet-soft); color: var(--violet); }
.pill-past_due { background: #fdecee; color: var(--red); }
.pill-pending, .pill-contacted { background: #fff4dc; color: #8a5a00; }
.pill-canceled, .pill-lost { background: #ececf0; color: #77778f; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.chip { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; font-weight: 600; padding: 6px 12px; border-radius: 16px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; font-family: inherit; }
.chip span { color: var(--muted); font-weight: 500; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.on span { color: #c9c9da; }
.search { display: flex; gap: 8px; margin-left: auto; }
.search input[type="search"] { font: inherit; font-size: 14px; padding: 7px 11px; border: 1px solid #cfcfe0; border-radius: 8px; width: 260px; }
.search select { width: auto; font-size: 14px; padding: 7px 10px; }
.add-lead summary { cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; margin-top: 16px; }
.form-grid .span-2 { grid-column: span 3; }
.stage-switch { display: flex; flex-wrap: wrap; gap: 6px; }
.note-form textarea { margin-bottom: 8px; }
.note-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.note-actions input[type="date"] { width: auto; font-size: 13px; padding: 5px 8px; }
.timeline { list-style: none; padding: 0; margin: 20px 0 0; }
.timeline li { border-left: 2px solid var(--violet-soft); padding: 0 0 18px 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--violet); }
.timeline-when { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; }
.timeline-body { margin-top: 4px; }
.delete-form { margin: 16px 0 8px; }

@media (max-width: 960px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .grid-2, .lead-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .search { margin-left: 0; width: 100%; }
  .search input[type="search"] { flex: 1; width: auto; }
  .board { grid-template-columns: repeat(6, 240px); }
}
@media (max-width: 600px) {
  .crm-nav .nav-inner { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 8px; }
  .crm-nav nav { gap: 12px; font-size: 14px; flex-wrap: wrap; }
  .recent-row { flex-direction: column; align-items: flex-start; }
}

.lead-orders { margin-bottom: 20px; }

/* Sign-in code entry */
.code-input { width: 100%; font-size: 28px !important; font-weight: 700; letter-spacing: 8px; text-align: center; font-family: SFMono-Regular, Consolas, monospace; padding: 12px 14px; border: 1px solid #cfcfe0; border-radius: 8px; }
.code-actions { display: flex; justify-content: space-between; margin-top: 16px; font-size: 14px; }
