/* Angels staff portal. Palette from the site: navy #0f2d44, steel blue #4285a9 / #156d95, champagne #d7c5af. */
:root {
  --navy: #0f2d44; --navy-2: #0a1e2e; --blue: #156d95; --blue-2: #4285a9; --sky: #e9f3f8; --gold: #d7c5af; --gold-2: #7a6248;
  --cream: #faf7f2; --ink: #10202e; --muted: #4b5d6b; --line: rgba(15, 45, 68, .13); --good: #1f7a4d; --amber: #a85d00; --bad: #b3261e;
  --r: 14px; --shadow: 0 2px 12px rgba(10, 30, 46, .07);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--cream); color: var(--ink); font: 400 15px/1.5 "Plus Jakarta Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { color: var(--navy); line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-2); margin-top: 20px; }
a { color: var(--blue); }
.muted { color: var(--muted); } .small { font-size: 13px; } .block { display: block; } .grow { flex: 1; }
.error { color: var(--bad); font-weight: 600; min-height: 1em; margin: 6px 0; }
.error:empty { display: none; }
code { font: 600 14px ui-monospace, SFMono-Regular, Menlo, monospace; }
label { display: grid; gap: 6px; font-weight: 600; color: var(--navy); margin: 12px 0; }
input, select, textarea { font: inherit; color: var(--ink); padding: 10px 12px; border: 1px solid rgba(15, 45, 68, .25); border-radius: 10px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(66, 133, 169, .45); outline-offset: 1px; }
textarea { resize: vertical; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; appearance: none; border: 1px solid var(--navy); background: var(--navy); color: #fff;
  font: 700 14px/1 "Plus Jakarta Sans", system-ui, sans-serif; padding: 12px 18px; border-radius: 999px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--navy-2); }
.btn:disabled { opacity: .5; cursor: progress; }
.btn--ghost { background: #fff; color: var(--navy); border-color: rgba(15, 45, 68, .25); }
.btn--ghost:hover { background: var(--sky); }
.btn--small { padding: 8px 13px; font-size: 13px; }
.link { appearance: none; border: 0; background: none; padding: 4px 2px; color: var(--blue); font: 600 13px "Plus Jakarta Sans", sans-serif; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link.danger, .danger { color: var(--bad); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.stack { display: grid; gap: 4px; }
.stack-lg { display: grid; gap: 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.pill { display: inline-block; font: 700 11.5px/1 "Plus Jakarta Sans", sans-serif; padding: 5px 9px; border-radius: 999px; background: #eef1f3; color: var(--muted); white-space: nowrap; }
.p-waiting { background: #fff1dc; color: var(--amber); }
.p-staff { background: #e3f3ea; color: var(--good); }
.p-ai { background: var(--sky); color: var(--blue); }
.p-closed { background: #eef1f3; color: var(--muted); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #c2410c; color: #fff; font-size: 11.5px; font-weight: 800; margin-left: 6px; }
.badge[hidden] { display: none; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: #f3ece2; color: var(--gold-2); font-size: 12px; font-weight: 700; }
.tag button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; font-size: 14px; line-height: 1; }
.toasts { position: fixed; z-index: 50; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(520px, calc(100vw - 24px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.toast--bad { background: var(--bad); }
.boot { display: grid; place-items: center; min-height: 100vh; }

/* Sign-in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(66, 133, 169, .25), transparent), linear-gradient(160deg, #0a1e2e, #164466); }
.narrow { width: min(440px, 100%); }
.auth .card { padding: 30px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; color: var(--navy); font-weight: 800; text-decoration: none; }
.brand img { height: auto; }
.auth .btn[type=submit] { width: 100%; margin-top: 8px; padding: 14px; }
.code { font: 700 22px/1 ui-monospace, Menlo, monospace; letter-spacing: .25em; text-align: center; }
.qr { display: grid; justify-items: center; gap: 8px; margin: 14px 0; text-align: center; }
.qr img { image-rendering: pixelated; border: 8px solid #fff; box-shadow: var(--shadow); border-radius: 8px; }
.secret { display: block; margin-top: 6px; padding: 8px; background: #f4f6f8; border-radius: 8px; word-break: break-all; }
.codes { columns: 2; padding-left: 22px; }
.codes li { margin: 6px 0; }

/* Portal frame */
.portal { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px; padding: 10px 20px; background: #fff; border-bottom: 1px solid var(--line); }
.top .brand { margin: 0; }
.tabs { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; }
.tabs a { padding: 10px 14px; border-radius: 10px; color: var(--muted); font-weight: 700; text-decoration: none; white-space: nowrap; }
.tabs a:hover { background: var(--sky); color: var(--navy); }
.tabs a[aria-current=page] { background: var(--navy); color: #fff; }
.who { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.who small { color: var(--gold-2); font-weight: 700; }
#view { padding: 24px 20px 40px; max-width: 1280px; width: 100%; margin: 0 auto; outline: none; }
.page-head { margin-bottom: 18px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr.off { opacity: .6; }
.table tr.global td { background: #faf7f2; }
.actions { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: flex-end; }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 12px; }
.inline-form label { flex: 1 1 200px; margin: 0; }
.prefix { display: flex; align-items: center; gap: 4px; font-weight: 500; color: var(--muted); }
.prefix input { flex: 1; }
.upload { position: relative; overflow: hidden; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.media { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-top: 14px; }
.media figure { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.media figcaption { padding: 8px; display: grid; gap: 6px; }
.media input { padding: 6px 8px; font-size: 13px; }
.log { list-style: none; padding: 0; margin: 0; max-height: 360px; overflow: auto; font-size: 13.5px; }
.log li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.tips li { margin: 6px 0; }
.dlg { width: min(640px, calc(100vw - 24px)); border: 0; border-radius: 18px; padding: 24px; box-shadow: 0 30px 90px rgba(0, 0, 0, .4); }
.dlg::backdrop { background: rgba(10, 30, 46, .55); }
.history, .shortcuts { list-style: none; padding: 0; margin: 0 0 12px; max-height: 50vh; overflow: auto; }
.history li, .shortcuts li { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.shortcuts p { margin: 0; flex: 1 1 260px; font-size: 13.5px; color: var(--muted); }

/* Live chat inbox */
.inbox { display: grid; grid-template-columns: 330px minmax(0, 1fr) 290px; gap: 0; height: calc(100vh - 110px); min-height: 520px;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.col-list { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; }
.list-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 6px; }
.list-head h1 { font-size: 20px; margin: 0; }
.col-list > input { margin: 6px 16px; width: auto; }
.presence { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; font: 700 13px "Plus Jakarta Sans", sans-serif; cursor: pointer; color: var(--muted); }
.presence i { width: 9px; height: 9px; border-radius: 50%; background: #9aa6b0; }
.presence[aria-pressed=true] { color: var(--good); border-color: rgba(31, 122, 77, .35); background: #effaf3; }
.presence[aria-pressed=true] i { background: #22a565; box-shadow: 0 0 0 4px rgba(34, 165, 101, .18); }
.filters { display: flex; gap: 4px; padding: 6px 12px 10px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.filters button { border: 0; background: none; padding: 6px 10px; border-radius: 999px; font: 700 12.5px "Plus Jakarta Sans", sans-serif; color: var(--muted); cursor: pointer; white-space: nowrap; }
.filters button[aria-selected=true] { background: var(--sky); color: var(--navy); }
.threads { overflow-y: auto; flex: 1; }
.trow { display: grid; gap: 4px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 12px 16px; cursor: pointer; font: inherit; border-left: 4px solid transparent; }
.trow:hover { background: #f7fafc; }
.trow.is-on { background: var(--sky); border-left-color: var(--blue); }
.trow.s-waiting { border-left-color: var(--amber); }
.trow-top { display: flex; justify-content: space-between; gap: 8px; color: var(--navy); }
.trow-top small { color: var(--muted); white-space: nowrap; }
.trow-msg { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.unread { margin-left: auto; background: var(--blue); color: #fff; border-radius: 999px; padding: 2px 7px; font-weight: 800; font-size: 11.5px; }
.empty { padding: 24px 16px; color: var(--muted); text-align: center; }
.empty.big { margin: auto; max-width: 340px; }
.cb { display: grid; gap: 4px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cb.is-new { background: #fffaf2; }
.cb .btn { justify-self: start; margin-top: 4px; }
.thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thread-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.thread-head h2 { margin: 0; font-size: 17px; }
.thread-head small { color: var(--muted); }
.thread-head select { width: auto; padding: 7px 10px; font-size: 13px; }
.msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: #f7f9fb; }
.msg { max-width: 76%; padding: 10px 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); align-self: flex-start; }
.msg p { margin: 2px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .who { font-size: 11.5px; font-weight: 800; color: var(--gold-2); text-transform: uppercase; letter-spacing: .05em; }
.msg small { color: var(--muted); font-size: 11.5px; }
.m-staff { align-self: flex-end; background: var(--navy); color: #fff; border-color: var(--navy); }
.m-staff .who, .m-staff small { color: rgba(255, 255, 255, .7); }
.m-ai { background: var(--sky); border-color: transparent; }
.m-system { align-self: center; background: none; border: 0; text-align: center; color: var(--muted); font-size: 13px; max-width: 90%; }
.m-alert { border: 2px solid var(--bad); background: #fff3f2; }
.typing { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue-2); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.composer { position: relative; padding: 12px 16px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.composer .muted { margin: 0; }
.suggest { position: absolute; bottom: 100%; left: 16px; right: 16px; margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 -10px 30px rgba(10, 30, 46, .12); }
.suggest[hidden] { display: none; }
.suggest li { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.suggest li:hover, .suggest li[aria-selected=true] { background: var(--sky); }
.details { border-left: 1px solid var(--line); padding: 4px 16px 20px; overflow-y: auto; font-size: 14px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.pages { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tags input { padding: 6px 10px; font-size: 13px; }
.notes { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.notes li { background: #fffaf0; border: 1px solid #f0e3c8; border-radius: 10px; padding: 8px 10px; }
.notes p { margin: 0 0 2px; white-space: pre-wrap; }
.notes small { color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-top: 14px; }
.check input { width: auto; }

/* Forms */
.forms-body { margin-top: 14px; }
#view > .filters { border-bottom: 0; padding: 0; }
.inbox--two { grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - 230px); }
.list-head h2 { font-size: 17px; margin: 0; }
.list-tools { padding: 0 16px 10px; border-bottom: 1px solid var(--line); }
.list-tools select { width: 100%; padding: 8px 10px; font-size: 13.5px; }
.enquiry-body { overflow-y: auto; padding: 16px 18px 24px; display: grid; gap: 16px; align-content: start; }
.enquiry-body .card { margin: 0; }
.enquiry-body h3 { margin: 0 0 6px; font-size: 15px; }
.workflow .grid2 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.pre { white-space: pre-wrap; }

@media (max-width: 1100px) {
  .inbox { grid-template-columns: 300px minmax(0, 1fr); }
  .details { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); max-height: 280px; }
  .inbox { height: auto; }
  .thread { height: 70vh; }
}
@media (max-width: 760px) {
  .top { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .tabs { order: 3; flex-basis: 100%; }
  #view { padding: 16px 12px 32px; }
  .inbox { grid-template-columns: 1fr; }
  .col-list { border-right: 0; max-height: 45vh; }
  .msg { max-width: 92%; }
  .table thead { display: none; }
  .table tr { display: grid; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: 4px 0; }
  .actions { justify-content: flex-start; }
}
@media print {
  .top, .toasts, .btn, .link { display: none !important; }
  .auth { background: none; }
}
