/* ============================================================
   Uncover Jordan — staff admin
   Inherits the public site's mosaic tokens, then adds a denser
   data layer. Staff screens are read at speed, so the type is
   smaller, the rows are tighter, and colour carries meaning.
   ============================================================ */

.admin-body {
  background: var(--limestone);
  min-height: 100vh;
}

/* ---------------------------------------------------- topbar ---- */
.abar {
  background: var(--basalt);
  color: var(--limestone);
  border-bottom: 3px solid var(--tessera);
}
.abar-in {
  max-width: 1320px; margin: 0 auto;
  padding: 12px clamp(16px, 3vw, 32px);
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.abar .logo-txt { color: #fff; font-size: 17px; }
.abar .logo-txt em { color: var(--tessera); font-style: normal; }
.abar .tagline {
  font-family: var(--mono); font-size: 9px; letter-spacing: .18em;
  text-transform: uppercase; color: #7E8F89; display: block; margin-top: 2px;
}
.abar nav { display: flex; gap: 18px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.abar nav a { color: #BFC9C4; font-size: 14px; font-weight: 500; }
.abar nav a:hover, .abar nav a.on { color: #fff; }
.abar .who {
  font-family: var(--mono); font-size: 11px; color: #7E8F89;
  border-left: 1px solid #33443F; padding-left: 18px;
}
.abar .who strong { color: #BFC9C4; font-weight: 500; display: block; }

.awrap { max-width: 1320px; margin: 0 auto; padding: clamp(20px, 3vw, 34px) clamp(16px, 3vw, 32px) 80px; }

/* ------------------------------------------------------ heads ---- */
.ahead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.ahead h1 { font-family: var(--disp); font-size: clamp(24px, 3.4vw, 32px); font-weight: 400; letter-spacing: -.02em; margin: 0; }
.ahead .k { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--lapis); margin-bottom: 6px; }

/* ------------------------------------------------------ cards ---- */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 22px; }
.stat {
  background: var(--paper); border: 1px solid var(--line-soft);
  border-radius: var(--rad); padding: 14px 16px;
}
.stat .k { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.stat .n { font-family: var(--disp); font-size: 28px; line-height: 1; letter-spacing: -.02em; }
.stat.warn { border-color: #DEC489; background: var(--tessera-soft); }
.stat.warn .n { color: #8A6412; }
.stat.bad { border-color: #DDB0A7; background: #F9E9E5; }
.stat.bad .n { color: var(--madder); }

/* ------------------------------------------------- filter tabs --- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  padding: 7px 13px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--paper); color: var(--muted);
}
.tabs a:hover { border-color: var(--lapis); color: var(--lapis); }
.tabs a.on { background: var(--lapis); border-color: var(--lapis); color: #fff; }

/* ------------------------------------------------------ table ---- */
.panel { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--rad); overflow: hidden; }
.panel + .panel { margin-top: 18px; }
.panel-head {
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); background: var(--limestone-2);
}
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--limestone-2); }
.tbl a.ref { font-family: var(--mono); font-size: 12.5px; color: var(--lapis); font-weight: 500; }
.tbl .sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tbl .age { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tbl .age.late { color: var(--madder); font-weight: 600; }

/* ------------------------------------------------------ pills ---- */
.pill {
  display: inline-block; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px;
  border-radius: 20px; border: 1px solid; white-space: nowrap;
}
.pill.NEW       { color: var(--lapis);  border-color: var(--lapis-tint); background: #EAF2F1; }
.pill.CONTACTED { color: #8A6412;       border-color: #DEC489;           background: var(--tessera-soft); }
.pill.QUOTED    { color: #4A5A34;       border-color: #B4C094;           background: #EEF2E6; }
.pill.ACCEPTED  { color: #2C5A34;       border-color: #A9C6AD;           background: #E6F0E7; }
.pill.LOST      { color: var(--muted);  border-color: var(--line);       background: var(--limestone-2); }
.pill.SPAM      { color: var(--madder); border-color: #DDB0A7;           background: #F9E9E5; }

/* ----------------------------------------------------- detail ---- */
.split { display: grid; gap: 20px; }
@media (min-width: 1000px) { .split { grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); align-items: start; } }
.split > * { min-width: 0; }
.scrollx { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.dl { display: grid; grid-template-columns: 170px 1fr; gap: 0; font-size: 16px; }
.dl dt {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line-soft);
}
.dl dd { margin: 0; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); line-height: 1.55; }
.dl dd.empty { color: #9AA5A0; }
.dl dt:last-of-type, .dl dd:last-of-type { border-bottom: 0; }
@media (max-width: 620px) {
  .dl { grid-template-columns: 1fr; }
  .dl dt { border-bottom: 0; padding-bottom: 0; }
}

.notes { padding: 16px; }
.note-item { border-left: 2px solid var(--lapis-tint); padding: 0 0 0 14px; margin-bottom: 16px; }
.note-item:last-child { margin-bottom: 0; }
.note-item .meta { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-bottom: 4px; }
.note-item p { margin: 0; font-size: 14px; white-space: pre-wrap; }

.flash {
  background: #E6F0E7; border: 1px solid #A9C6AD; color: #2C5A34;
  padding: 11px 15px; border-radius: var(--rad); font-size: 14px; margin-bottom: 18px;
}
.sot {
  border-left: 3px solid var(--tessera); background: var(--tessera-soft);
  padding: 13px 15px; border-radius: 0 var(--rad) var(--rad) 0; font-size: 13.5px; margin-bottom: 16px;
}
.sot strong { display: block; font-family: var(--disp); font-size: 15px; font-weight: 500; margin-bottom: 4px; }

/* ------------------------------------------------------ forms ---- */
.frm { padding: 16px; }
.frm label {
  display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.frm select, .frm textarea, .frm input[type=text], .frm input[type=email], .frm input[type=password] {
  width: 100%; font-family: var(--body); font-size: 14.5px; color: var(--basalt);
  background: var(--limestone-2); border: 1px solid var(--line);
  border-radius: var(--rad); padding: 10px 12px;
}
.frm textarea { min-height: 88px; resize: vertical; }
.frm select:focus, .frm textarea:focus, .frm input:focus { background: var(--paper); border-color: var(--lapis); outline: none; }
.frm .row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }

/* ------------------------------------------------------ login ---- */
.login-shell { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: var(--basalt); }
.login-card {
  width: 100%; max-width: 420px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 6px; padding: 34px 30px;
}
.login-card h1 { font-family: var(--disp); font-size: 26px; font-weight: 400; margin: 0 0 6px; letter-spacing: -.02em; }
.login-card .lead { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.login-err {
  background: #F9E9E5; border: 1px solid #DDB0A7; color: var(--madder);
  padding: 11px 14px; border-radius: var(--rad); font-size: 13.5px; margin-bottom: 18px;
}
.login-out {
  background: #EAF2F1; border: 1px solid var(--lapis-tint); color: var(--lapis);
  padding: 11px 14px; border-radius: var(--rad); font-size: 13.5px; margin-bottom: 18px;
}
.login-card .fld { margin-bottom: 16px; }
.login-foot { margin-top: 22px; font-size: 12.5px; color: var(--muted); text-align: center; }

.empty-state { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty-state h3 { font-family: var(--disp); font-size: 20px; font-weight: 400; margin-bottom: 8px; color: var(--basalt); }
.empty-state p { font-size: 14px; margin: 0; }

/* ============================================================
   Tiles — admin home. Bento grid: size carries hierarchy, so
   the things you open every morning are physically larger.
   ============================================================ */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1000px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .tiles { grid-template-columns: 1fr; } }

.tile {
  border: 1px solid var(--line-soft); border-radius: 6px; padding: 16px;
  background: var(--paper); display: flex; flex-direction: column;
  min-height: 106px; color: var(--basalt); text-decoration: none;
  transition: border-color .16s ease, transform .16s ease;
}
.tile:hover { border-color: var(--lapis); transform: translateY(-1px); }
.tile .t { font-size: 14.5px; font-weight: 600; }
.tile .n { font-family: var(--disp); font-size: 30px; line-height: 1; letter-spacing: -.02em; margin: 4px 0 0; }
.tile .s { font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 7px; }
.tile.wide { grid-column: span 2; }
@media (max-width: 560px) { .tile.wide { grid-column: span 1; } }
.tile.acc  { border-color: var(--lapis); border-width: 1.5px; background: #EDF4F3; }
.tile.acc .n { color: var(--lapis); }
.tile.warn { border-color: #DEC489; background: var(--tessera-soft); }
.tile.warn .n { color: #8A6412; }
.tile.bad  { border-color: #DDB0A7; background: #F9E9E5; }
.tile.bad .n { color: var(--madder); }
.tile.quiet .n { font-size: 19px; color: var(--muted); padding-top: 7px; }

.greet { margin-bottom: 20px; }
.greet h1 { font-family: var(--disp); font-size: clamp(24px, 3.4vw, 32px); font-weight: 400; letter-spacing: -.02em; margin: 0; }

/* filter chips — scroll sideways on mobile rather than wrapping to 3 lines */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
@media (max-width: 700px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; -webkit-overflow-scrolling: touch; }
}
.chip {
  font-family: var(--mono); font-size: 10px; letter-spacing: .07em; text-transform: uppercase;
  padding: 7px 13px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--paper); color: var(--muted); white-space: nowrap; text-decoration: none;
}
.chip:hover { border-color: var(--lapis); color: var(--lapis); }
.chip.on { background: var(--lapis); border-color: var(--lapis); color: #fff; }

/* a suppressed row stays visible and greyed — never hidden, never deleted */
tr.suppressed { opacity: .5; }
tr.suppressed td { font-style: italic; }

.warnbox { border-left: 2.5px solid var(--tessera); background: var(--tessera-soft); padding: 12px 14px; border-radius: 0 4px 4px 0; font-size: 13.5px; margin-bottom: 16px; }
.warnbox ul { margin: 6px 0 0; padding-left: 18px; }
.warnbox li { margin-bottom: 4px; }

/* --- inbox rows --- */
.eqrow{cursor:pointer}
.eqrow:hover{background:#F3F0E7}
/* Three signals, not one: colour alone fails for reduced contrast sensitivity,
   which is the same reason the public form got a type pass. */
.eqrow.unread{background:#FBF7EC}
.eqrow.unread td:first-child{box-shadow:inset 3px 0 0 #D9A94A}
.eqrow.unread:hover{background:#F7F1E0}
.eqrow.unread td:first-child .ref{font-weight:500}
.eqrow.unread td .who,.eqrow.unread td strong{font-weight:500}

/* --- grouped extras --- */
.xgrp{font-size:13px;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);font-weight:500;margin:14px 0 6px}
.xgrp:first-child{margin-top:0}
.xitem{display:flex;gap:9px;align-items:baseline;margin:0;padding:3px 0;font-size:16px;line-height:1.5}
.xtick{color:var(--lapis);flex:0 0 auto}

/* --- grouped extras, scoped to beat .dl dd --- */
.dl dd .xgrp{font-size:12.5px;letter-spacing:.09em;text-transform:uppercase;color:var(--muted);font-weight:500;margin:16px 0 4px;line-height:1.4}
.dl dd div:first-child .xgrp{margin-top:0}
.dl dd .xitem{display:flex;gap:9px;align-items:baseline;margin:0;padding:2px 0;font-size:16px;line-height:1.45}
.dl dd .xtick{color:var(--lapis);flex:0 0 auto;font-size:15px}

/* --- inbox timeline cards --- */
.cardlist{background:var(--card,#fff);border:1px solid var(--line-soft);border-radius:0 0 10px 10px}
.ecard{padding:14px 18px;border-bottom:1px solid var(--line-soft);cursor:pointer}
.ecard:last-child{border-bottom:none}
.ecard:hover{background:#FAF8F2}
.ecard.unread{background:#FBF7EC;box-shadow:inset 3px 0 0 #D9A94A}
.ectop{display:flex;justify-content:space-between;gap:14px;align-items:baseline;flex-wrap:wrap}
.ecmain{margin:0;font-size:16px;display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}
.ecmain b{font-weight:600}
.ecsum{font-size:14px;color:var(--muted)}
.jtl{display:flex;align-items:center;margin-top:9px;flex-wrap:wrap;row-gap:5px}
.jn{display:flex;align-items:center;gap:5px;font-size:12px;color:var(--muted);white-space:nowrap}
.jd{width:8px;height:8px;border-radius:50%;background:#D8D2C4;flex:0 0 auto}
.jn.done{color:#0F6E56;font-weight:500}
.jn.done .jd{background:#1D9E75}
.jn.now{color:#854F0B;font-weight:600}
.jn.now .jd{background:#EF9F27;box-shadow:0 0 0 3px #FAEEDA}
.jc{height:2px;width:18px;background:#D8D2C4;margin:0 5px;flex:0 0 auto}
.jc.done{background:#1D9E75}
@media(max-width:700px){.jc{width:10px}.jn{font-size:11px}}
