:root {
  --navy: #0E2B4D; --navy-2: #163a63; --lime: #DFE01A; --orange: #FBB315; --pink: #EF4F99; --cyan: #05A9CE;
  --bg: #f4f2ec; --card: #fff; --ink: #14202e; --mute: #64707d; --line: #e2ded4; --green: #1f9d55; --red: #d64545;
  --r: 12px;
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.4; }
a { color: var(--navy-2); }
button, input, select, textarea { font: inherit; color: inherit; }

[hidden] { display: none !important; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; padding: 10px 20px; background: var(--navy); color: #fff; }
.brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -.3px; }
.brand { display: inline-flex; align-items: center; gap: 9px; }
.hqtag { display: inline-block; background: var(--lime); color: var(--navy); font: 800 19px/0.78 'Bricolage Grotesque', sans-serif; letter-spacing: -.5px;
         padding: 5px 7px 5px 6px; transform: skewX(-6deg) rotate(-2deg); }
.hqtag span { display: inline-block; transform: skewX(6deg) rotate(2deg); }
.loginlogo { display: block; width: 100%; max-width: 300px; margin: 0 auto 18px; }
.top nav { display: flex; gap: 6px; align-items: center; flex: 1; }
.top nav a:not(.btn) { color: #cfd9e6; text-decoration: none; padding: 6px 12px; border-radius: 99px; font-weight: 600; }
.top nav a.on { background: rgba(255,255,255,.12); color: #fff; }
.top nav .btn { margin-left: auto; }
.me { color: #cfd9e6; font-size: 14px; white-space: nowrap; }
.link { background: none; border: 0; color: var(--lime); cursor: pointer; padding: 0 0 0 8px; text-decoration: underline; }

main { max-width: 1180px; margin: 0 auto; padding: 20px; }
h1 { font-size: 28px; margin: 4px 0 16px; letter-spacing: -.5px; }
h2 { font-size: 18px; margin: 0 0 12px; }

.btn { display: inline-block; border: 0; border-radius: 99px; padding: 9px 18px; font-weight: 700; cursor: pointer; text-decoration: none; background: var(--navy); color: #fff; }
.btn.small { padding: 6px 14px; font-size: 14px; }
.btn.lime { background: var(--lime); color: var(--navy); }
.btn.ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
.btn.danger { background: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.filters input, .filters select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; background: #fff; }
.filters input[type=search] { min-width: 240px; flex: 1; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 99px; cursor: pointer; font-weight: 600; color: var(--mute); }
.seg button.on { background: var(--navy); color: #fff; }

/* booking cards */
.month { margin: 22px 0 8px; font-weight: 800; color: var(--mute); text-transform: uppercase; letter-spacing: 1px; font-size: 13px; }
.bk { display: grid; grid-template-columns: 74px 1fr 1fr 170px; gap: 16px; align-items: start; background: var(--card); border-radius: var(--r); padding: 14px 16px; margin-bottom: 8px; cursor: pointer; border-left: 5px solid var(--line); text-decoration: none; color: inherit; }
.bk:hover { box-shadow: 0 2px 10px rgba(14,43,77,.08); }
.bk.st-Confirmed, .bk.st-CustomerDetailsConfirmed { border-left-color: var(--cyan); }
.bk.st-FullAmountPaid { border-left-color: var(--green); }
.bk.st-Unconfirmed, .bk.st-none { border-left-color: var(--orange); }
.bk.st-Cancelled, .bk.st-Postponed { border-left-color: var(--red); opacity: .6; }
.day { text-align: center; background: var(--navy); color: #fff; border-radius: 10px; padding: 6px 0; }
.day b { display: block; font-size: 24px; line-height: 1; }
.day small { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--lime); }
.bk .t { font-weight: 800; font-size: 16px; }
.bk .m { color: var(--mute); font-size: 13.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #eef1f5; color: var(--navy); font-weight: 600; }
.chip.unit { background: #e6f6fa; }
.chip.staff { background: #fde9f2; color: #8a1d4d; }
.money { text-align: right; }
.money .tot { font-weight: 800; font-size: 17px; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; margin-top: 4px; }
.pill.owe { background: #fff1d6; color: #8a5a00; }
.pill.paid { background: #dcf3e5; color: var(--green); }
.status { font-size: 12px; font-weight: 700; color: var(--mute); margin-top: 4px; }

/* calendar */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cal-head h1 { margin: 0; flex: 1; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { font-size: 12px; font-weight: 700; color: var(--mute); text-transform: uppercase; padding: 4px; }
.cal .cell { background: var(--card); min-height: 108px; border-radius: 8px; padding: 6px; font-size: 12px; }
.cal .cell.out { opacity: .45; }
.cal .cell.today { box-shadow: inset 0 0 0 2px var(--pink); }
.cal .n { font-weight: 800; margin-bottom: 4px; }
.cal .ev { display: block; padding: 2px 5px; border-radius: 5px; margin-bottom: 3px; text-decoration: none; color: var(--navy); background: #fff1d6; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal .ev.st-Confirmed, .cal .ev.st-CustomerDetailsConfirmed { background: #d9f1f8; }
.cal .ev.st-FullAmountPaid { background: #dcf3e5; }
.cal .ev.st-Cancelled, .cal .ev.st-Postponed { background: #f3dcdc; text-decoration: line-through; }

/* booking page */
.bhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.bhead h1 { margin: 0; flex: 1; }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.panel { background: var(--card); border-radius: var(--r); padding: 18px; margin-bottom: 16px; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--mute); }
.form label.wide { grid-column: 1 / -1; }
.form input, .form select, .form textarea, table.lines input, .payform input, .payform select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf7; color: var(--ink); font-weight: 400; font-size: 14.5px; width: 100%; }
.form textarea { min-height: 80px; resize: vertical; }
table.lines { width: 100%; border-collapse: collapse; }
table.lines td { padding: 4px; vertical-align: top; }
table.lines td.price { width: 120px; }
table.lines td.x { width: 30px; }
.inc { font-size: 12px; color: var(--mute); padding: 2px 10px 6px; white-space: pre-line; }
.x { background: none; border: 0; color: var(--red); cursor: pointer; font-size: 18px; }
.sum { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin-top: 12px; font-size: 15px; }
.sum .big { font-weight: 800; font-size: 18px; }
.sum .due { color: #8a5a00; font-weight: 800; }
.pay { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.payform { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; margin-top: 10px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { display: inline-flex; flex-direction: row; align-items: center; gap: 5px; background: #f1efe9; padding: 4px 10px; border-radius: 99px; font-weight: 600; color: var(--ink); font-size: 13px; cursor: pointer; }
.checks input { width: auto; }
.activity { font-size: 12.5px; color: var(--mute); }
.activity div { padding: 3px 0; }
.savebar { position: sticky; bottom: 0; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: var(--r); display: flex; gap: 10px; align-items: center; }
.savebar span { flex: 1; }

/* login */
.login { max-width: 380px; margin: 10vh auto; background: var(--card); padding: 28px; border-radius: 16px; }
.login h1 { font-size: 26px; }
.login label { display: block; font-weight: 700; font-size: 13px; color: var(--mute); margin-bottom: 10px; }
.login input { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.login .err { color: var(--red); min-height: 20px; font-size: 14px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 99px; font-weight: 600; z-index: 50; }
.empty { text-align: center; color: var(--mute); padding: 40px; }
.more { text-align: center; margin: 16px; }


/* leads */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-bottom: 14px; }
.tile { text-align: left; border: 0; background: var(--card); border-radius: var(--r); padding: 12px 14px; cursor: pointer; color: var(--navy); }
.tile b { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -.5px; }
.tile span { font-size: 13px; font-weight: 600; color: var(--mute); }
.tile.on { background: var(--navy); color: #fff; }
.tile.on span { color: var(--lime); }
.tile.due { background: #fde9f2; color: #8a1d4d; }
.tile.due.on { background: var(--pink); color: #fff; }
.tile.due.on span { color: #fff; }
.bulkbar { display: flex; gap: 10px; align-items: center; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: var(--r); margin-bottom: 10px; }
.bulkbar select { padding: 6px 10px; border-radius: 99px; border: 0; }
.lead { display: grid; grid-template-columns: 28px minmax(180px, 2fr) 64px 1fr 1.3fr 1.4fr 170px; gap: 12px; align-items: center; background: var(--card); border-radius: var(--r); padding: 10px 14px; margin-bottom: 6px; }
.lead:hover { box-shadow: 0 2px 10px rgba(14,43,77,.08); }
.lead [data-open] { cursor: pointer; }
.lead small { display: block; font-size: 11.5px; color: var(--mute); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.lead .who b { display: block; font-size: 15.5px; }
.lead .who small { text-transform: none; letter-spacing: 0; font-size: 13px; }
.lead em { font-style: normal; color: var(--mute); font-size: 12.5px; }
.lead .ev, .lead .sub { font-size: 14px; }
.ic { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 99px; background: #eef1f5; text-decoration: none; color: var(--navy); margin-right: 3px; font-size: 14px; }
.ic:hover { background: var(--lime); }
.nc { font-weight: 700; font-size: 14px; }
.nc.none { color: var(--mute); font-weight: 400; }
.nc.late { color: var(--red); }
.nc.today { color: #b06d00; }
.next { position: relative; }
.snooze { display: none; gap: 3px; margin-left: 6px; }
.lead:hover .snooze { display: inline-flex; }
.snooze button { border: 0; background: #eef1f5; border-radius: 99px; font-size: 11.5px; font-weight: 700; padding: 2px 7px; cursor: pointer; color: var(--navy); }
.snooze button:hover { background: var(--lime); }
.stat { display: flex; align-items: center; gap: 6px; }
.lst { width: 100%; padding: 6px 8px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 13.5px; }
.lst.s-New { background: #e6f6fa; } .lst.s-Initial { background: #f1efe9; } .lst.s-Sent { background: #fff1d6; }
.lst.s-Ongoing { background: #fde9f2; } .lst.s-Booking { background: #dcf3e5; } .lst.s-Stale, .lst.s-Proposal { background: #eceae4; color: var(--mute); }
.bklink { font-weight: 700; font-size: 13px; white-space: nowrap; }
.drawer-bg { position: fixed; inset: 0; background: rgba(14,43,77,.35); z-index: 30; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--bg); z-index: 31; overflow-y: auto; padding: 20px; box-shadow: -10px 0 30px rgba(0,0,0,.15); }
.dhead { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.dhead h2 { font-size: 24px; margin: 0; }
.dhead .m { color: var(--mute); }
.x.big { font-size: 30px; line-height: 1; color: var(--navy); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.followup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: var(--card); padding: 10px 12px; border-radius: var(--r); }
.followup b { margin-right: 4px; }
.followup input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.followup button { border: 0; background: #eef1f5; border-radius: 99px; padding: 5px 10px; font-weight: 700; font-size: 12.5px; cursor: pointer; color: var(--navy); }
.followup button:hover { background: var(--lime); }
.notebox { display: flex; gap: 8px; margin: 10px 0; align-items: flex-end; }
.notebox textarea { flex: 1; min-height: 54px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
.timeline { background: var(--card); border-radius: var(--r); padding: 6px 14px; }
.timeline div { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; white-space: pre-line; }
.timeline div:last-child { border-bottom: 0; }
.timeline small { display: block; color: var(--mute); font-size: 12px; font-weight: 700; }
.msg { background: #fffbe8; border-radius: var(--r); padding: 10px 14px; margin-top: 10px; white-space: pre-line; font-size: 14px; }
.msg small { display: block; font-weight: 700; color: var(--mute); font-size: 12px; margin-bottom: 4px; }
.drawer .form { background: var(--card); padding: 14px; border-radius: var(--r); }
.history { margin-top: 12px; background: var(--card); border-radius: var(--r); padding: 10px 14px; }
.history a { display: block; padding: 5px 0; font-size: 14px; }

/* settings + conversation */
.steps { background: #f6f4ee; border-radius: var(--r); padding: 10px 16px; }
.steps summary { font-weight: 700; cursor: pointer; }
.steps li { margin: 6px 0; }
code { background: #eef1f5; padding: 1px 6px; border-radius: 5px; font-size: 13px; word-break: break-all; }
.mails { display: flex; flex-direction: column; gap: 6px; }
.mail { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; background: #fff; }
.mail.out { border-left: 4px solid var(--cyan); }
.mail.in { border-left: 4px solid var(--orange); }
.mail .dir { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--mute); margin-right: 6px; }
.mail small { display: block; color: var(--mute); font-size: 12px; margin-top: 2px; }
.mail .prev { color: var(--mute); font-size: 13px; margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mbody { margin-top: 8px; cursor: default; }
.mbody iframe { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-bottom: 6px; }
.drawer .panel { padding: 14px; }

  .lead { grid-template-columns: 24px 1fr auto; }
  .lead .sub { display: none; }
  .lead .ev, .lead .next, .lead .stat { grid-column: 2 / -1; }
  .snooze { display: inline-flex; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
}

/* quotes */
.qhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.qhead h2 { margin: 0; }
.qrow { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.qrow small { display: block; color: var(--mute); font-size: 12.5px; margin-top: 2px; }
.qacts { display: flex; gap: 6px; flex-shrink: 0; }
.qs { font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: #eef1f5; color: var(--navy); margin-left: 4px; text-transform: uppercase; letter-spacing: .3px; }
.qs-sent { background: #e6f6fa; } .qs-viewed { background: #fff1d6; color: #8a5a00; } .qs-accepted { background: #dcf3e5; color: var(--green); }
.qs-changes { background: #fde9f2; color: #8a1d4d; } .qs-expired, .qs-declined { background: #eceae4; color: var(--mute); }
.modal-bg { position: fixed; inset: 0; background: rgba(14,43,77,.45); z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; }
.modal { background: var(--bg); border-radius: 16px; padding: 20px; width: min(560px, 100%); }
.modal.wide { width: min(980px, 100%); }
.tplgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tpl { border: 0; background: var(--card); border-radius: 12px; padding: 0 0 10px; cursor: pointer; text-align: left; text-decoration: none; color: var(--ink); overflow: hidden; display: flex; flex-direction: column; }
.tpl .ph { display: block; height: 100px; background: #ddd center/cover; margin-bottom: 8px; }
.tpl b { padding: 0 10px; font-size: 14px; }
.tpl small { padding: 0 10px; color: var(--mute); }
.tpl.off { opacity: .5; }
.tpl:hover { box-shadow: 0 0 0 3px var(--lime); }
.imggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.imggrid .img { height: 90px; border: 0; border-radius: 8px; background: #ddd center/cover; cursor: pointer; }
.imggrid .img.on, .imggrid .img:hover { box-shadow: 0 0 0 3px var(--pink); }
.imgpick { display: block; height: 110px; border-radius: 8px; background: #eee center/cover; color: var(--mute); display: grid; place-items: center; font-weight: 400; }
.qgrid { grid-template-columns: 1.6fr 1fr; }
.sect summary { cursor: pointer; list-style: none; }
.sect summary h2 { display: inline; }
.sect summary::before { content: '▸ '; color: var(--mute); }
.sect[open] summary::before { content: '▾ '; }
.sect .form { margin-top: 12px; }
.rte { min-height: 90px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 0 0 8px 8px; background: #fbfaf7; color: var(--ink); font-weight: 400; font-size: 14.5px; line-height: 1.5; }
.rte:focus { outline: 2px solid var(--cyan); }
.rte-bar { display: flex; gap: 2px; background: #eef1f5; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; padding: 3px; }
.rte-bar button { border: 0; background: none; width: 30px; height: 26px; border-radius: 5px; cursor: pointer; }
.rte-bar button:hover { background: #fff; }
.tog { flex-direction: row !important; align-items: center; gap: 8px !important; }
.tog input { width: auto !important; }
.sticky { position: sticky; top: 70px; }
.vbtns { display: flex; flex-direction: column; gap: 8px; }
.vars { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 5px; }
.vars small { width: 100%; color: var(--mute); font-weight: 700; }
.vars button { border: 0; background: #eef1f5; border-radius: 99px; padding: 3px 9px; font-size: 12px; cursor: pointer; color: var(--navy); }
.vars button:hover { background: var(--lime); }
.views { margin-top: 14px; font-size: 13px; }
.views small { display: block; color: var(--mute); font-weight: 700; }
.opt { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; }
.ohead { display: flex; gap: 8px; margin-bottom: 6px; }
.otitle { flex: 1; font-weight: 700; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
.opt textarea { width: 100%; margin-top: 4px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; resize: vertical; background: #fbfaf7; }
.otot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.otot input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }

.newitem { font-size: 12.5px; color: var(--mute); margin-top: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.newitem button { border: 0; border-radius: 99px; padding: 3px 10px; font-weight: 700; font-size: 12px; cursor: pointer; background: #eef1f5; color: var(--navy); }
.newitem button:first-of-type { background: var(--lime); }
.savecat { border: 0; background: #eef1f5; border-radius: 99px; width: 24px; height: 24px; cursor: pointer; color: var(--navy); font-weight: 800; margin-top: 4px; }
.catsvc { margin-bottom: 14px; }
.catrow { display: grid; grid-template-columns: 1fr 110px 130px 70px; gap: 8px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.catrow input, .catrow textarea { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf7; font-size: 14px; }
.catrow textarea { margin-top: 4px; font-size: 12.5px; min-height: 34px; }
.catrow.arch { opacity: .5; }
.catrow .flags { font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }
.catrow .flags label { display: flex; gap: 5px; align-items: center; }

.ovr { font-weight: 600; font-size: 11.5px; color: #8a1d4d; background: #fde9f2; border-radius: 99px; padding: 1px 8px; margin-left: 6px; text-transform: none; }
.ovr .link { color: #8a1d4d; font-size: 11.5px; padding: 0 0 0 2px; }
.linkinfo { background: #e6f6fa; border-radius: var(--r); padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }

.upl { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.upl label { cursor: pointer; }

@media (max-width: 860px) {
  .catrow { grid-template-columns: 1fr 90px; }
  .qgrid { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .top { flex-wrap: wrap; gap: 8px 16px; padding: 10px 16px; }
  .me { display: none; }
  main { padding: 16px; }
  .bk { grid-template-columns: 58px 1fr; }
  .bk .who, .bk .money { grid-column: 2; text-align: left; }
  .grid2 { grid-template-columns: 1fr; }
  .cal .cell { min-height: 70px; padding: 3px; }
  .cal .ev { font-size: 10px; }
  .payform { grid-template-columns: 1fr 1fr; }
  .filters input[type=search] { min-width: 0; width: 100%; }
}
