[hidden] { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, sans-serif; background: #f4f6f8; color: #1f2933; font-size: 15px; }
a { color: #1f5fa8; }
header.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; background: #17324d; color: #fff; }
header.top a { color: #cfe3ff; }
.brand { font-weight: 700; font-size: 18px; }
.who { font-size: 14px; }
nav.tabs { display: flex; flex-wrap: wrap; gap: 2px; background: #fff; border-bottom: 1px solid #d9dee3; padding: 0 16px; }
nav.tabs a { padding: 12px 14px; text-decoration: none; color: #3e4c59; border-bottom: 3px solid transparent; }
nav.tabs a.active { color: #17324d; border-bottom-color: #2f80ed; font-weight: 600; }
nav.tabs a.soon { color: #9aa5b1; }
nav.tabs small { font-size: 10px; text-transform: uppercase; background: #eef1f4; padding: 1px 5px; border-radius: 6px; }
main { max-width: 1200px; margin: 0 auto; padding: 20px 24px 60px; }
h1 { font-size: 24px; margin: 8px 0 16px; }
h2 { font-size: 17px; margin: 16px 0 10px; }
.card { background: #fff; border: 1px solid #d9dee3; border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.muted { color: #7b8794; }
.heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
label { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; color: #3e4c59; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid #c3cad1; border-radius: 6px; font: inherit; background: #fff; }
input[type=checkbox] { display: inline; width: auto; }
button, .button { display: inline-block; background: #2f80ed; color: #fff; border: 0; border-radius: 6px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { background: #1f6bd1; }
button.small { padding: 5px 10px; font-size: 13px; }
button.secondary { background: #e4e7eb; color: #3e4c59; }
form.inline { display: inline-flex; align-items: flex-end; gap: 6px; margin: 4px 0; }
form.inline label, form.inline input, form.inline select { margin: 0; }
form.inline input, form.inline select { width: auto; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row label { flex: 1 1 200px; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.grid .wide { grid-column: 1 / -1; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.filters { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.filters label { margin: 0; } .filters input { width: 320px; margin: 0; }
label.check { display: flex; align-items: center; gap: 6px; font-weight: 400; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #d9dee3; border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eef1f4; vertical-align: top; }
th { background: #f8f9fa; font-size: 13px; color: #616e7c; }
tr.faded td { color: #9aa5b1; }
td.overdue { color: #c0392b; font-weight: 600; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; background: #e4e7eb; }
.pill.assigned { background: #e3efff; color: #1f5fa8; }
.pill.in-progress { background: #fff4d6; color: #8a5a00; }
.pill.completed { background: #dcf5e3; color: #1d7a3d; }
.pill.cancelled { background: #f1f1f1; color: #7b8794; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.flash.ok { background: #dcf5e3; color: #1d5e33; }
.flash.error { background: #fde2e1; color: #9b1c1c; }
dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0 0 12px; }
dt { color: #7b8794; } dd { margin: 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
figure { margin: 0; background: #fff; border: 1px solid #d9dee3; border-radius: 8px; overflow: hidden; }
figure img { width: 100%; height: 170px; object-fit: cover; display: block; background: #eef1f4; }
figcaption { padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
figcaption select { width: 100%; }
@media (max-width: 800px) { .grid, .two { grid-template-columns: 1fr; } }
.secondary-btn { background: #e4e7eb; color: #3e4c59; } .secondary-btn:hover { background: #d3d8de; }
.small-btn { padding: 6px 12px; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 8px; }
.stat { background: #fff; border: 1px solid #d9dee3; border-radius: 8px; padding: 14px 18px; }
.stat .num { font-size: 24px; font-weight: 700; color: #17324d; }
.pill.open { background: #e3efff; color: #1f5fa8; }
.pill.vendor-assigned { background: #ece4ff; color: #5b3cc4; }
.pill.scheduled { background: #e0f4f7; color: #0e6b78; }
.prio { font-size: 12px; font-weight: 600; }
.prio.emergency { color: #c0392b; } .prio.high { color: #b35c00; } .prio.low { color: #7b8794; }
table.plain { margin-top: 12px; border: 0; }
.ai-banner { border-left: 5px solid #9aa5b1; }
.ai-banner.good { border-left-color: #27ae60; } .ai-banner.good strong { color: #1d7a3d; }
.ai-banner.bad { border-left-color: #c0392b; } .ai-banner.bad strong { color: #9b1c1c; }
.cond { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: #eef1f4; }
.cond.good { background: #dcf5e3; color: #1d7a3d; } .cond.fair { background: #fff4d6; color: #8a5a00; }
.cond.poor { background: #ffe5cc; color: #a34700; } .cond.damaged { background: #fde2e1; color: #9b1c1c; }
.cond-card { display: grid; grid-template-columns: 300px 1fr; gap: 18px; }
.cond-card img { width: 100%; height: 220px; object-fit: cover; border-radius: 6px; background: #eef1f4; }
.findings { margin: 6px 0 12px; padding-left: 18px; } .findings li { margin-bottom: 4px; }
.sev { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 1px 6px; border-radius: 6px; background: #eef1f4; }
.sev.severe { background: #fde2e1; color: #9b1c1c; } .sev.moderate { background: #ffe5cc; color: #a34700; } .sev.minor { background: #fff4d6; color: #8a5a00; }
details summary { cursor: pointer; color: #1f5fa8; }
code { background: #eef1f4; padding: 1px 6px; border-radius: 4px; }
@media (max-width: 800px) { .cond-card { grid-template-columns: 1fr; } }
.stats.four { grid-template-columns: repeat(4, 1fr); }
.hist-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 10px; }
.thumbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 6px; }
.thumbs img { width: 100%; height: 140px; object-fit: cover; border-radius: 6px; background: #eef1f4; }
.empty { padding: 30px; text-align: center; background: #f8f9fa; border-radius: 6px; margin-top: 6px; }
.change { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 12px; background: #eef1f4; color: #3e4c59; }
.change.worse { background: #fde2e1; color: #9b1c1c; } .change.better { background: #dcf5e3; color: #1d7a3d; }
@media (max-width: 800px) { .hist-grid, .stats.four { grid-template-columns: 1fr; } }
.organizer { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.tree { background: #fff; border: 1px solid #d9dee3; border-radius: 8px; padding: 8px 0; position: sticky; top: 10px; max-height: 88vh; overflow-y: auto; }
.tree .node { display: flex; justify-content: space-between; gap: 8px; padding: 6px 14px; text-decoration: none; color: #3e4c59; font-size: 14px; }
.tree .node span { color: #7b8794; font-size: 12px; margin-left: auto; }
.tree .node.top { font-weight: 600; border-bottom: 1px solid #eef1f4; padding: 9px 14px; }
.tree .node.cat { font-weight: 700; color: #17324d; margin-top: 8px; }
.tree .node.sub { padding-left: 28px; }
.tree .node:hover { background: #f4f6f8; }
.tree .node.on { background: #e3efff; color: #1f5fa8; }
.flag { color: #a34700; font-size: 11px; }
.movebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: #fff; border: 1px solid #d9dee3; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; position: sticky; top: 0; z-index: 5; }
.inline-label { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; }
.inline-label select { width: auto; margin: 0; }
figure { position: relative; }
.pickwrap { position: absolute; top: 6px; left: 6px; margin: 0; background: rgba(255,255,255,.9); border-radius: 4px; padding: 2px 5px; }
.pickwrap input { width: 18px; height: 18px; margin: 0; }
.chip { display: inline-block; background: #eef1f4; border-radius: 10px; padding: 1px 8px; margin: 2px 2px 0 0; font-size: 11px; }
.group-list details { background: #fff; border: 1px solid #d9dee3; border-radius: 8px; margin-bottom: 8px; padding: 8px 14px; }
.group-list summary { font-weight: 600; color: #17324d; }
.group-list .gallery { margin-top: 10px; }
@media (max-width: 800px) { .organizer { grid-template-columns: 1fr; } .tree { position: static; max-height: none; } }
button.danger { background: #c0392b; color: #fff; } button.danger:hover { background: #a93226; }
.danger-zone { border-color: #f1b0ab; margin-top: 30px; } .danger-zone h2 { color: #9b1c1c; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.video-card { display: grid; grid-template-columns: 130px 1fr; gap: 14px; background: #fff; border: 1px solid #d9dee3; border-radius: 8px; padding: 12px; }
.video-card img.qr { width: 130px; height: 130px; image-rendering: pixelated; border: 1px solid #eef1f4; }
.video-card .url { font-size: 12px; word-break: break-all; margin-top: 4px; }
.subnav { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid #d9dee3; }
.subnav a { padding: 8px 14px; text-decoration: none; color: #3e4c59; border-bottom: 3px solid transparent; }
.subnav a.on { color: #17324d; border-bottom-color: #2f80ed; font-weight: 600; }
.pill.inv-draft { background: #eef1f4; color: #3e4c59; }
.pill.inv-unpaid { background: #e3efff; color: #1f5fa8; }
.pill.inv-partly-paid { background: #fff4d6; color: #8a5a00; }
.pill.inv-overdue { background: #fde2e1; color: #9b1c1c; }
.pill.inv-paid { background: #dcf5e3; color: #1d7a3d; }
.pill.inv-void { background: #f1f1f1; color: #7b8794; text-decoration: line-through; }
table.lines td, table.fees td { padding: 4px 6px; } table.lines input, table.lines select, table.fees input { margin: 0; }
table.lines td.amt { text-align: right; font-weight: 600; padding-top: 12px; }
input.money { text-align: right; }
.totals { margin: 14px 0; margin-left: auto; width: 280px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { border-top: 2px solid #17324d; font-size: 16px; }
@media (max-width: 800px) { .video-grid { grid-template-columns: 1fr; } }
.bar { height: 12px; background: #eef1f4; border-radius: 6px; overflow: hidden; margin: 10px 0 4px; }
.bar > div { height: 100%; width: 0; background: #2f80ed; transition: width .3s; }
.condbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.condbar .cf { text-decoration: none; padding: 6px 12px; border-radius: 16px; background: #fff; border: 1px solid #d9dee3; color: #3e4c59; font-size: 14px; }
.condbar .cf span { color: #7b8794; font-size: 12px; margin-left: 4px; }
.condbar .cf.on { background: #17324d; color: #fff; border-color: #17324d; } .condbar .cf.on span { color: #cfe3ff; }
.condbar .cf-damaged { border-color: #f1b0ab; } .condbar .cf-poor { border-color: #f5c99a; }
.cond-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ccard img.open { cursor: zoom-in; }
.ccard textarea, .ccard select { font-size: 13px; padding: 5px 7px; margin-top: 2px; }
.ccard.edited { border-color: #9fd8b0; }
.ccard.changed { border: 2px solid #f2a93b; box-shadow: 0 0 0 3px #fff4d6; }
#viewer { border: 0; border-radius: 10px; padding: 0; width: min(1100px, 95vw); max-height: 92vh; }
#viewer::backdrop { background: rgba(15, 25, 35, .7); }
.v-wrap { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; padding: 16px; }
.v-wrap img { width: 100%; max-height: 80vh; object-fit: contain; background: #111; border-radius: 6px; }
@media (max-width: 800px) { .v-wrap { grid-template-columns: 1fr; } }
.code-input { font-size: 22px; letter-spacing: 4px; text-align: center; font-family: Consolas, monospace; }
.setup-qr { margin: 10px 0; } .setup-qr img { image-rendering: pixelated; border: 1px solid #d9dee3; border-radius: 6px; }
ol.steps li { margin-bottom: 14px; } code.key { font-size: 15px; letter-spacing: 1px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.codes code { font-size: 18px; padding: 8px 12px; text-align: center; letter-spacing: 2px; background: #f4f6f8; border: 1px dashed #c3cad1; }
@media print { header, nav, .flash, button, .button { display: none !important; } }

/* ---------- logo and camera ---------- */
header.top .brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
header.top .logo { width: 30px; height: 30px; border-radius: 7px; }
.camera-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; margin-bottom: 14px;
  background: #f4f8ff; border: 1px dashed #9cc0f0; border-radius: 8px; }
.camera-btn { font-size: 17px; padding: 12px 20px; cursor: pointer; }
.cam-room { margin: 0; } .cam-room select { width: auto; }
#camera-status { flex-basis: 100%; }
.cam-thumbs { display: flex; gap: 6px; flex-wrap: wrap; flex-basis: 100%; }
.cam-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 3px solid #c3cad1; }
.cam-thumbs img.pending { opacity: .5; } .cam-thumbs img.ok { border-color: #27ae60; } .cam-thumbs img.bad { border-color: #c0392b; }

/* ---------- phones and small tablets ---------- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  header.top { padding: 10px 14px; flex-wrap: wrap; gap: 4px; }
  header.top .brand { font-size: 16px; }
  header.top .who { font-size: 13px; }
  nav.tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0 6px; scrollbar-width: none; }
  nav.tabs::-webkit-scrollbar { display: none; }
  nav.tabs a { white-space: nowrap; padding: 12px 10px; }
  main { padding: 12px 12px 60px; }
  h1 { font-size: 21px; }
  .card { padding: 14px; }
  /* 16px text stops iPhones from zooming in when you tap a box */
  input, select, textarea { font-size: 16px; }
  button, .button { min-height: 40px; }
  .heading { flex-wrap: wrap; }
  .row { gap: 8px; } .row label { flex: 1 1 100% !important; }
  .filters { flex-wrap: wrap; } .filters label, .filters input { width: 100%; }
  dl { grid-template-columns: 1fr; gap: 0 0; } dt { margin-top: 6px; }
  .stats, .stats.four { grid-template-columns: 1fr 1fr; }
  .stat .num { font-size: 19px; }
  /* wide tables scroll sideways instead of squashing */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { padding: 8px; }
  /* the assignment list turns into cards */
  table.responsive { display: block; border: 0; background: transparent; overflow: visible; }
  table.responsive tr:first-child { display: none; }
  table.responsive tr { display: block; background: #fff; border: 1px solid #d9dee3; border-radius: 8px; margin-bottom: 10px; padding: 8px 12px; }
  table.responsive td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 0; text-align: right; }
  table.responsive td::before { content: attr(data-label); color: #7b8794; font-size: 13px; text-align: left; }
  table.responsive td.primary { display: block; text-align: left; font-size: 16px; padding-bottom: 6px; border-bottom: 1px solid #eef1f4; margin-bottom: 4px; }
  table.responsive td.primary::before { content: none; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  figure img { height: 130px; }
  .cond-grid { grid-template-columns: 1fr; }
  .cond-grid figure img { height: 200px; }
  .tree { max-height: 38vh; overflow-y: auto; }
  .movebar { position: static; }
  .condbar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; } .condbar .cf { white-space: nowrap; }
  .video-card { grid-template-columns: 90px 1fr; } .video-card img.qr { width: 90px; height: 90px; }
  .totals { width: 100%; }
  .subnav { overflow-x: auto; } .subnav a { white-space: nowrap; }
  .camera-btn { flex: 1 1 100%; text-align: center; }
  .v-wrap { padding: 10px; }
}
@media (max-width: 760px) {
  table.responsive tbody { display: block; width: 100%; }
  table.responsive tr { width: 100%; box-sizing: border-box; }
  .filters label.check { display: flex; width: auto; align-items: center; gap: 8px; }
  .filters label.check input { width: auto; }
  .camera-fab { display: flex !important; }
}
.camera-fab { display: none; position: fixed; right: 16px; bottom: 18px; z-index: 50; align-items: center; gap: 8px;
  background: #2f80ed; color: #fff; border-radius: 30px; padding: 14px 20px; font-size: 17px; font-weight: 700;
  box-shadow: 0 6px 18px rgba(23, 50, 77, .35); cursor: pointer; border: 0; }
.backup-alert a { margin-left: 8px; font-weight: 600; }

/* Inquiries (website chat) */
nav.tabs .badge, .badge { background: #c0392b; color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.pill.inq-new { background: #fde2e1; color: #9b1c1c; }
.pill.inq-contacted { background: #fff4d6; color: #8a5a00; }
.pill.inq-converted { background: #dcf5e3; color: #1d7a3d; }
.pill.inq-closed { background: #f1f1f1; color: #7b8794; }
.transcript { display: flex; flex-direction: column; gap: 6px; max-height: 520px; overflow-y: auto; }
.transcript .t-user { background: #e3efff; padding: 6px 10px; border-radius: 6px; }
.transcript .t-bot { padding: 6px 10px; }
