/* ==========================================================================
   Vasrue CRM — stylesheet.

   The palette and type are lifted straight off roof/index.html, which in turn
   was lifted off the postcard: navy chrome, orange for the one action that
   matters on a screen, cream for anything you have to read for more than a
   few seconds, Poppins throughout.

   This file is standalone on purpose. It does not import or extend the site's
   styles.css, so the CRM cannot break the public site and a styles.css
   cache-buster bump never has to be coordinated with a CRM upload.
   ========================================================================== */

:root {
  --navy:      #0B1B2B;
  --navy-2:    #102A41;
  --navy-3:    #173956;
  --orange:    #FF7A18;
  --orange-lt: #FF9A3C;
  --cream:     #F7F4EF;
  --slate:     #C9D6E2;
  --slate-2:   #8FA3B5;

  --ink:       #1B2B3A;
  --ink-soft:  #4E5C69;
  --ink-faint: #7A8794;
  --line:      #DCE3EA;
  --line-2:    #EDF1F5;
  --page:      #EEF2F6;

  --ok:        #1B7F4B;
  --ok-bg:     #E7F5EC;
  --warn:      #8A5A00;
  --warn-bg:   #FFF4E0;
  --err:       #8A2118;
  --err-bg:    #FDECEA;
  --lock:      #A8500A;
  --lock-bg:   #FFEDD9;

  --radius:    10px;
  --shadow:    0 1px 2px rgba(11,27,43,.06), 0 8px 24px rgba(11,27,43,.07);
  --shadow-lg: 0 18px 44px rgba(0,0,0,.34);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: #0F5C93; text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; }

/* ---------------------------------------------------------------- layout -- */

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 22px; }

.crm-header {
  background: var(--navy);
  border-bottom: 3px solid var(--orange);
  color: var(--cream);
  position: sticky; top: 0; z-index: 40;
}
.crm-header .wrap {
  display: flex; align-items: center; gap: 20px;
  min-height: 60px; flex-wrap: wrap;
}
.crm-logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--cream) !important; text-decoration: none !important;
  font-weight: 700; font-size: 17px; letter-spacing: -.01em; flex: none;
}
.crm-logo .mark {
  width: 26px; height: 26px; border-radius: 6px; flex: none;
  background: var(--orange); color: var(--navy);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.crm-logo small {
  display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--slate-2); margin-top: 1px;
}

.crm-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.crm-nav a {
  color: var(--slate); text-decoration: none !important;
  font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 7px;
  transition: background .14s ease, color .14s ease;
}
.crm-nav a:hover { background: rgba(247,244,239,.09); color: #fff; }
.crm-nav a.on { background: var(--orange); color: var(--navy); font-weight: 600; }

.crm-who {
  display: flex; align-items: center; gap: 10px;
  padding-left: 14px; margin-left: 4px;
  border-left: 1px solid rgba(247,244,239,.16);
  font-size: 13px; color: var(--slate-2);
}
.crm-who b { color: var(--cream); font-weight: 600; }
.crm-who .role {
  font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  background: rgba(255,122,24,.2); color: var(--orange-lt);
  padding: 2px 7px; border-radius: 4px;
}

main { padding: 26px 0 60px; }

.page-head {
  display: flex; align-items: flex-end; gap: 16px;
  flex-wrap: wrap; margin-bottom: 20px;
}
.page-head h1 { font-size: 27px; }
.page-head .sub { color: var(--ink-soft); font-size: 14px; margin-top: 4px; }
.page-head .spacer { margin-left: auto; }
.crumb {
  font-size: 12px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 6px; display: block;
}

/* ----------------------------------------------------------------- cards -- */

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px;
}
.card.flush { padding: 0; overflow: hidden; }
.card > h2, .card > h3 {
  font-size: 16px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card-head {
  padding: 15px 20px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #FBFCFD;
}
.card-head h2 { font-size: 15.5px; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 20px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-main { grid-template-columns: 1.7fr 1fr; align-items: start; }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-main { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------- stat tiles -- */

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow);
  border-top: 3px solid var(--navy-3);
}
.stat.accent { border-top-color: var(--orange); }
.stat .n { font-size: 27px; font-weight: 700; line-height: 1.05; letter-spacing: -.03em; }
.stat .k {
  font-size: 10.5px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-faint); margin-top: 5px;
}

/* --------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  padding: 10px 16px; border-radius: 7px; border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.btn:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

.btn-primary { background: var(--orange); color: var(--navy) !important; }
.btn-primary:hover { background: var(--orange-lt); }

.btn-navy { background: var(--navy); color: var(--cream) !important; }
.btn-navy:hover { background: var(--navy-2); }

.btn-ghost { background: #fff; color: var(--ink) !important; border-color: var(--line); }
.btn-ghost:hover { background: #F4F7FA; border-color: var(--slate); }

.btn-danger { background: #fff; color: var(--err) !important; border-color: #E5A79F; }
.btn-danger:hover { background: var(--err-bg); }

.btn-sm { font-size: 12.5px; padding: 7px 11px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled {
  opacity: .45; cursor: not-allowed; pointer-events: none;
}

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Spec 53 — the fixed action set on every lead record. */
.action-bar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px; margin-bottom: 4px;
}
.action-bar .btn { width: 100%; }

/* ----------------------------------------------------------------- forms -- */

.field { margin-bottom: 14px; }
.field label, .lbl {
  display: block; font-size: 12.5px; font-weight: 600; color: #24323F; margin-bottom: 5px;
}
.field .hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 5px; }

input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=date], input[type=time], input[type=number], input[type=search],
select, textarea {
  width: 100%; padding: 10px 12px; font-size: 15px; font-family: inherit;
  color: var(--ink); background: #fff;
  border: 1.5px solid #CFD6DD; border-radius: 7px;
}
textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255,122,24,.18);
}
input[readonly], input[disabled], select[disabled], textarea[disabled] {
  background: #F2F5F8; color: var(--ink-soft); cursor: not-allowed;
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
@media (max-width: 620px) { .row-2, .row-3 { grid-template-columns: 1fr; gap: 0; } }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --------------------------------------------------------------- notices -- */

.notice {
  padding: 12px 15px; border-radius: 8px; font-size: 14px; margin-bottom: 16px;
  border: 1.5px solid transparent; line-height: 1.45;
}
.notice-ok    { background: var(--ok-bg);   border-color: #A6D5B8; color: var(--ok); }
.notice-warn  { background: var(--warn-bg); border-color: #E8C787; color: var(--warn); }
.notice-error { background: var(--err-bg);  border-color: #E5A79F; color: var(--err); }
.notice b { font-weight: 700; }

/* Spec 66 — the read-only banner another user sees. */
.lockbanner {
  background: var(--lock-bg); border: 1.5px solid #EFC08A; border-left: 5px solid var(--orange);
  border-radius: 8px; padding: 14px 16px; margin-bottom: 18px;
}
.lockbanner .t {
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--lock); margin-bottom: 5px;
}
.lockbanner .m { font-size: 15px; color: #6B3C05; }
.lockbanner .m b { color: #4A2A03; }
.lockbanner .sub { font-size: 12.5px; color: #8A6224; margin-top: 6px; }

/* Spec 74/75 — the list-view badge. */
.lockbadge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--lock-bg); color: var(--lock);
  border: 1px solid #EFC08A; border-radius: 5px;
  font-size: 11.5px; font-weight: 600; padding: 2px 7px; white-space: nowrap;
}
.lockbadge.is-mine { background: #E7F5EC; color: var(--ok); border-color: #A6D5B8; }

/* ---------------------------------------------------------------- tables -- */

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th {
  text-align: left; font-size: 10.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint);
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: #FBFCFD;
  white-space: nowrap;
}
table.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: #FAFCFE; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .nowrap { white-space: nowrap; }
.tbl-scroll { overflow-x: auto; }

.rowname { font-weight: 600; font-size: 14.5px; }
.rowsub { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; color: var(--ink-faint);
}

/* ----------------------------------------------------------------- pills -- */

.pill {
  display: inline-block; font-size: 11.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px; white-space: nowrap;
  border: 1px solid transparent;
}
.pill-new    { background: #E8F0FA; color: #1B4F86; border-color: #BCD3EC; }
.pill-work   { background: #FFF4E0; color: #8A5A00; border-color: #E8C787; }
.pill-appt   { background: #FFEDD9; color: #A8500A; border-color: #EFC08A; }
.pill-won    { background: #E7F5EC; color: #1B7F4B; border-color: #A6D5B8; }
.pill-dead   { background: #F1F3F5; color: #67717B; border-color: #DDE2E7; }
.pill-quiet  { background: #F1F3F5; color: #67717B; border-color: #DDE2E7; }

/* --------------------------------------------------------- lead detail --- */

.lead-hero {
  background: var(--navy); color: var(--cream);
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px;
  border-left: 5px solid var(--orange); box-shadow: var(--shadow);
}
.lead-hero h1 { font-size: 26px; color: var(--cream); }
.lead-hero .addr { color: var(--slate); font-size: 15px; margin-top: 5px; }
.lead-hero .meta {
  display: flex; gap: 22px; flex-wrap: wrap; margin-top: 16px;
  padding-top: 15px; border-top: 1px solid rgba(247,244,239,.14);
}
.lead-hero .meta div { min-width: 105px; }
.lead-hero .meta small {
  display: block; font-size: 10px; font-weight: 600; letter-spacing: .15em;
  text-transform: uppercase; color: var(--slate-2); margin-bottom: 4px;
}
.lead-hero .meta b { font-size: 14.5px; font-weight: 600; color: #fff; }
.lead-hero a { color: var(--orange-lt); }

/* Spec 57 — the appointment strip on a lead card. */
.appt-strip {
  background: var(--navy-2); border: 1px solid rgba(255,122,24,.35);
  border-left: 4px solid var(--orange); border-radius: 8px;
  padding: 12px 15px; margin-top: 15px; color: var(--cream);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.appt-strip .when { font-size: 16px; font-weight: 700; color: var(--orange-lt); }
.appt-strip .what { font-size: 13.5px; color: var(--slate); }

/* ------------------------------------------------------------- timeline -- */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative; padding: 0 0 18px 30px; border-left: 2px solid var(--line);
  margin-left: 7px;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li:before {
  content: ''; position: absolute; left: -7px; top: 3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--slate);
}
.timeline li.ev-calendar:before { border-color: var(--orange); background: var(--orange); }
.timeline li.ev-note:before     { border-color: var(--navy-3); }
.timeline li.ev-cancel:before   { border-color: #C0473A; background: #C0473A; }
.timeline li.ev-status:before   { border-color: var(--ok); }
.timeline .ts {
  font-size: 11.5px; font-weight: 600; letter-spacing: .05em; color: var(--ink-faint);
}
.timeline .ti { font-weight: 600; font-size: 14.5px; margin-top: 2px; }
.timeline .td { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.timeline .by { color: var(--ink-faint); font-size: 12.5px; margin-top: 3px; }

.note {
  background: #FBFCFD; border: 1px solid var(--line);
  border-left: 3px solid var(--slate); border-radius: 7px;
  padding: 12px 14px; margin-bottom: 10px;
}
.note .head {
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ink-faint); margin-bottom: 5px;
}
.note .head b { color: var(--ink); font-size: 13.5px; font-weight: 600; }
.note .body { white-space: pre-wrap; font-size: 14.5px; line-height: 1.5; }

/* ------------------------------------------------------ appointment list -- */

.appt-row {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 13px 0; border-bottom: 1px solid var(--line-2);
}
.appt-row:last-child { border-bottom: 0; }
.appt-row .t {
  font-size: 17px; font-weight: 700; color: var(--navy);
  min-width: 88px; font-variant-numeric: tabular-nums;
}
.appt-row .who { flex: 1 1 220px; }
.appt-row .who .n { font-weight: 600; font-size: 14.5px; }
.appt-row .who .a { color: var(--ink-soft); font-size: 13px; }
.appt-row .who .k { color: var(--orange); font-size: 12.5px; font-weight: 600; margin-top: 2px; }

/* -------------------------------------------------------------- filters -- */

.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 18px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.filters .field { margin: 0; }
.filters .grow { flex: 1 1 240px; }

.empty {
  text-align: center; padding: 42px 20px; color: var(--ink-faint);
}
.empty .big { font-size: 17px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }

/* ----------------------------------------------------------- login page -- */

body.login-page {
  background: var(--navy);
  background-image:
    radial-gradient(ellipse at 74% 22%, rgba(255,122,24,.17) 0%, rgba(255,122,24,0) 55%),
    linear-gradient(160deg, var(--navy-3) 0%, var(--navy-2) 45%, var(--navy) 100%);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center; padding: 30px 18px;
}
.login-box { width: 100%; max-width: 400px; }
.login-brand { text-align: center; margin-bottom: 22px; color: var(--cream); }
.login-brand .mark {
  width: 46px; height: 46px; border-radius: 11px; margin: 0 auto 12px;
  background: var(--orange); color: var(--navy);
  display: grid; place-items: center; font-size: 21px; font-weight: 700;
}
.login-brand h1 { font-size: 22px; color: var(--cream); }
.login-brand p {
  margin: 6px 0 0; font-size: 11.5px; font-weight: 600;
  letter-spacing: .19em; text-transform: uppercase; color: var(--slate-2);
}
.login-card {
  background: var(--cream); border-radius: 12px; padding: 26px;
  box-shadow: var(--shadow-lg);
}
.login-card h2 { font-size: 18px; margin-bottom: 4px; color: var(--navy); }
.login-card .lede { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 18px; }
.login-foot {
  text-align: center; margin-top: 18px; font-size: 13px; color: var(--slate-2);
}
.login-foot a { color: var(--slate); }

/* ----------------------------------------------------- public booking --- */

body.public-page { background: var(--page); }
.pub-hero {
  background: var(--navy); color: var(--cream);
  border-bottom: 4px solid var(--orange); padding: 34px 0;
}
.pub-hero h1 { font-size: clamp(24px, 4.4vw, 34px); color: var(--cream); max-width: 20ch; }
.pub-hero p { color: var(--slate); margin: 10px 0 0; max-width: 52ch; font-size: 15.5px; }
.pub-eyebrow {
  font-size: 11.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--orange-lt); display: flex; align-items: center; gap: 11px; margin: 0 0 14px;
}
.pub-eyebrow:before { content: ''; width: 34px; height: 3px; background: var(--orange); flex: none; }

.slot-day { margin-bottom: 20px; }
.slot-day h3 { font-size: 15px; margin-bottom: 10px; color: var(--navy); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
/* Rendered as a <button> so a slot can be chosen with JavaScript switched
   off — hence the explicit font and width resets. */
.slot {
  display: block; width: 100%; text-align: center; padding: 11px 6px;
  border: 1.5px solid var(--line); border-radius: 7px; background: #fff;
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.2;
  color: var(--ink) !important;
  cursor: pointer; text-decoration: none !important;
  transition: border-color .14s ease, background .14s ease;
}
.slot:hover { border-color: var(--orange); background: #FFF6EE; }
.slot:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.slot.is-on { border-color: var(--orange); background: var(--orange); color: var(--navy) !important; }

/* ---------------------------------------------------------------- misc --- */

.crm-footer {
  border-top: 1px solid var(--line); margin-top: 40px; padding: 18px 0 30px;
  font-size: 12.5px; color: var(--ink-faint);
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
}
.crm-footer .spacer { margin-left: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.divider { height: 1px; background: var(--line-2); margin: 18px 0; }

.kv { display: grid; grid-template-columns: 128px 1fr; gap: 7px 14px; font-size: 14px; }
.kv dt { color: var(--ink-faint); font-size: 12.5px; padding-top: 1px; }
.kv dd { margin: 0; font-weight: 500; }

@media (max-width: 700px) {
  .crm-header .wrap { padding-top: 10px; padding-bottom: 10px; }
  .crm-nav { width: 100%; margin-left: 0; }
  .crm-who { margin-left: auto; border-left: 0; padding-left: 0; }
  .page-head .spacer { width: 100%; margin: 0; }
}

@media print {
  .crm-header, .crm-footer, .action-bar, .btn, .filters { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}
