/* The staff venues page (mixkings-web/_src/staff.html): the list and one
   venue's record. The frame, the header and the tabs are the staff pages'
   shared ones (chrome.css); this is the page's palette, plus the three
   states a row can need attention for. */
:root {
  --bg: #f9fbfc;
  --card: #fff;
  --ink: #1f1c59;
  --muted: #6b6b7a;
  --line: #e2e4ef;
  --chip: #eef0f7;
  --ok: #2d7a4f;
  --ok-bg: #e6f3eb;
  --warn: #8a5a00;
  --warn-bg: #fdf2dc;
  --err: #b42318;
  --err-bg: #fdecea;
  --focus: #3a2fa8;
}
* { box-sizing: border-box; }
h2 { font-size: 20px; margin: 0; }
h3 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; }
p { margin: 6px 0; }
a { color: var(--ink); }
.muted { color: var(--muted); font-size: 13.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.state { margin-top: 24px; color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; text-decoration: none;
  font-family: inherit; font-size: 13.5px; font-weight: 600; line-height: 1;
}
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.danger { color: var(--err); border-color: #f0c5c0; }
.btn[disabled] { opacity: .55; cursor: default; }

.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 22px 0 6px; }
.search { flex: 1 1 280px; }
.search input, .who select, .field input, .field textarea {
  width: 100%; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 15px; line-height: 1.4; color: var(--ink); background: #fff;
}
.field textarea { min-height: 120px; padding: 10px 12px; resize: vertical; }
.who { flex: 0 0 auto; }
.seg { display: inline-flex; background: var(--chip); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; color: var(--ink); font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1;
  padding: 9px 12px; border-radius: 999px; cursor: pointer;
}
.seg button[aria-selected="true"] { background: #fff; box-shadow: 0 1px 2px rgba(31, 28, 89, .12); }
.count { margin: 8px 2px 10px; }

.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 960px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; background: #fcfcfe; position: sticky; top: 0; }
tbody tr:hover { background: #fafbff; }
tbody tr:last-child td { border-bottom: 0; }
.sub { display: block; color: var(--muted); font-size: 12.5px; }
.open { font-weight: 700; color: var(--ink); text-decoration: none; }
.open:hover { text-decoration: underline; }
.open:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.chip {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .02em; background: var(--chip); color: var(--ink); white-space: nowrap; margin: 2px 4px 2px 0;
}
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.err { background: var(--err-bg); color: var(--err); }
.chip.out { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.empty { padding: 28px 12px; color: var(--muted); text-align: center; }
.more { display: flex; justify-content: center; margin-top: 14px; }

/* ---- one venue's record ---- */
.back { display: inline-block; margin: 22px 0 4px; font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.back::before { content: "\2190\00a0"; }
.back:hover { color: var(--ink); }
.rhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.rhead h2 { font-size: 24px; line-height: 1.25; }
.rhead .acts { margin-top: 0; }
.rsub { margin-top: 6px; }
.rgrid { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 10px; }
.rside { display: grid; gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 18px; }
.card h3 { margin: 0 0 8px; }
.small { font-size: 12.5px; }
.btn.small { min-height: 30px; padding: 0 12px; font-size: 12.5px; margin-top: 6px; }
.linkish { all: unset; cursor: pointer; color: var(--muted); font-size: 12.5px; text-decoration: underline; margin-left: 6px; }
.linkish:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.links, .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.confirm { margin-top: 12px; padding: 14px; border: 1px solid #f0c5c0; background: #fffafa; border-radius: 12px; display: grid; gap: 10px; }
.field { display: grid; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.msg { min-height: 1.3em; font-size: 13.5px; margin-top: 8px; }
.msg.err { color: var(--err); }
.msg.ok { color: var(--ok); }
.why { margin-top: 2px; }

/* The checklist: computed items show their state; manual ones take a mark. */
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 14px; }
.ck { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; }
.ckmark { width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; }
.ck.done .ckmark { border-color: var(--ok); background: var(--ok); box-shadow: inset 0 0 0 3px #fff; }
.ck.due .ckmark { border-color: var(--warn); }
.ck.late .ckmark { border-color: var(--err); }
.ck.na { opacity: .6; }

/* The history: a note box, a filter, then the entries by day. */
.note textarea {
  width: 100%; min-height: 72px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 14.5px; line-height: 1.45; color: var(--ink); background: #fff; resize: vertical;
}
.note .acts { margin-top: 8px; justify-content: flex-end; }
.seg.small { margin: 14px 0 4px; }
.seg.small button { font-size: 12.5px; padding: 7px 11px; }
.tlday { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; }
.tll { list-style: none; padding: 0; margin: 0; }
.tli { display: grid; grid-template-columns: 78px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tli:last-child { border-bottom: 0; }
.tli p { margin: 0; }
.tlk { font-size: 11.5px; font-weight: 700; letter-spacing: .02em; color: var(--muted); padding-top: 2px; }
.tli.note { background: #fffdf5; margin: 0 -10px; padding: 9px 10px; border-radius: 10px; border-bottom-color: transparent; }
.tli.note .tlk { color: var(--warn); }
.tli.email .tlk { color: var(--focus); }
.tli.staff .tlk { color: var(--ink); }
.tli.err .tlb p { color: var(--err); }
.notebody { white-space: pre-wrap; }
.sub.inline { display: inline; }

/* The preview: full screen over the record. */
body.pvopen { overflow: hidden; }
.pv { position: fixed; inset: 0; z-index: 20; background: #14121a; display: grid; grid-template-rows: auto 1fr; }
.pvbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 16px; background: #1d1a29; color: #efece6; }
.pvbar h2 { font-size: 16px; color: #efece6; margin-right: auto; }
.pvbar .acts { margin-top: 0; }
.pvbar .seg { background: #2b2740; }
.pvbar .seg button { color: #d8d4ea; }
.pvbar .seg button[aria-selected="true"] { background: #efece6; color: #1d1a29; }
.pvstage { position: relative; overflow: hidden; display: grid; place-items: center; }
.pverr { color: #ffb4aa; font-size: 14px; margin: 0 0 12px; }
.pvframe { position: relative; overflow: hidden; background: #fff; border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, .45); }
.pvframe.phone { border-radius: 26px; border: 8px solid #2b2740; box-sizing: content-box; }
.pvframe iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: #fff; }

@media (max-width: 900px) {
  .rgrid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  dl { grid-template-columns: 1fr; }
  dt { margin-top: 6px; }
  .tli { grid-template-columns: 1fr; gap: 2px; }
}

/* Email into the CRM: a received message under its history line, the reply
   form, and the unfiled inbox on the list. */
.mailbody { margin: 6px 0 8px; }
.mailbody pre, .inmail pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; margin: 0 0 6px; padding: 10px 12px; border-left: 3px solid var(--line, #d9d6e6); background: var(--well, #f7f6fb); border-radius: 0 8px 8px 0; max-height: 28em; overflow: auto; }
.note.reply input { width: 100%; box-sizing: border-box; margin-bottom: 8px; font: inherit; padding: 8px 10px; border: 1px solid var(--line, #d9d6e6); border-radius: 8px; }
.inboxbar { margin: 0 0 10px; }
.inboxbar .btn[hidden] { display: none; }
.inbox .rhead { margin-bottom: 8px; }
.inlist { list-style: none; margin: 0; padding: 0; }
.inmail { padding: 12px 0; border-top: 1px solid var(--line, #d9d6e6); }
.inmail:first-child { border-top: 0; }
.inmail p { margin: 0 0 6px; }
.inmail .file { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.inmail .file .field { flex: 1 1 260px; margin: 0; }
.inmail .found { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }

/* The envelope: unread email on the list row and on a received line. */
.namerow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.marks { display: inline-flex; align-items: center; gap: 6px; }
.mail { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); }
.flag { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; font-size: 12px; font-weight: 800; line-height: 1; cursor: default; }
.flag.warn { background: var(--warn-bg); color: var(--warn); }
.flag.err { background: var(--err-bg); color: var(--err); }
.flag .tip { position: absolute; top: calc(100% + 6px); left: 0; margin: 0; padding: 6px 10px; list-style: none; text-align: left; white-space: nowrap; border-radius: 8px; font-size: 12.5px; font-weight: 600; background: var(--card); border: 1px solid var(--line); visibility: hidden; opacity: 0; transition: opacity .12s; z-index: 5; box-shadow: 0 4px 14px rgba(31, 28, 89, .14); pointer-events: none; }
.flag .tip li { padding: 5px 0; border-top: 1px solid var(--line); }
.flag .tip li:first-child { border-top: 0; }
.flag .tip li.warn { color: var(--warn); }
.flag .tip li.err { color: var(--err); }
.flag:hover .tip, .flag:focus-visible .tip { visibility: visible; opacity: 1; }
.flag:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Wide screens need no sideways scroll, so the tooltips may hang past the
   table's edge; narrow ones keep the scroll and clip a tip at the bottom. */
@media (min-width: 900px) { .tablewrap { overflow: visible; } }
.mail .n { font-size: 12px; font-weight: 700; }
.env { display: inline-block; vertical-align: -4px; margin-right: 4px; color: var(--muted); }
.tli.unread .tlb > p:first-child { font-weight: 700; }
.replyslot .note.reply { margin: 8px 0 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The envelope's colours. Closed: the solid fill. Open: the flap lighter. */
:root { --mail: #3a2fa8; --mail-lite: #b9b3ef; }
.env-line { fill: var(--ink); }
.env-fill { fill: var(--mail); }
.env-lite { fill: var(--mail-lite); }
a.mail { text-decoration: none; color: var(--mail); border-radius: 4px; margin: 0; }
a.mail:hover { opacity: .8; }
a.mail:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* The list's Filters dropdown and Sort menu. */
.dd { position: relative; flex: 0 0 auto; }
.dd .menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 20px rgba(31, 28, 89, .14); z-index: 6; }
.dd .menu label { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.dd .menu label:hover { background: var(--chip); }
.dd .menu .linkish { margin: 4px 9px 2px; }
.btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.icon { display: inline-flex; align-items: center; gap: 7px; }

/* The globe: the venue's page in the record's preview. */
a.globe { display: inline-flex; align-items: center; color: var(--muted); border-radius: 4px; text-decoration: none; }
a.globe.live { color: var(--ok); }
a.globe:hover { opacity: .8; }
a.globe:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Page changes: a save's before and after, field by field. */
.diff { margin: 8px 0 4px; display: grid; gap: 8px; }
.chg b { display: block; margin-bottom: 4px; }
.chgcols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chgcols pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 13px; margin: 2px 0 0; padding: 8px 10px; background: var(--well, #f7f6fb); border-left: 3px solid var(--line); border-radius: 0 8px 8px 0; max-height: 16em; overflow: auto; }
@media (max-width: 700px) { .chgcols { grid-template-columns: 1fr; } }
