/* Customer Records — internal tool.
   Palette borrowed from 1800DISCONNECT so it reads as part of the network.
   No framework, no build step, no web fonts. */

:root {
  --bg:#fafafa; --ink:#1a1a1a; --muted:#666; --line:#e2e2e2;
  --accent:#1f4e8c; --accent-dark:#163759;
  --held:#1b6e3b; --released:#8a6b1a; --danger:#b03030; --flag:#b9520b;
}

* { box-sizing:border-box; }
body {
  margin:0;
  font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:var(--bg); color:var(--ink); line-height:1.5; font-size:15px;
}
.container { max-width:1180px; margin:0 auto; padding:0 20px; }

/* ---- header ---- */
.site-header { background:#fff; border-bottom:1px solid var(--line); }
.header-row { display:flex; align-items:center; justify-content:space-between;
              gap:16px; padding:12px 20px; }
.brand { font-weight:700; color:var(--ink); text-decoration:none; font-size:1.05rem; }
.header-nav { display:flex; align-items:center; gap:16px; font-size:0.9rem; }
.header-nav a { color:var(--accent); text-decoration:none; font-weight:600; }
.who { color:var(--muted); }
.admin-tag { font-size:0.58em; background:var(--flag); color:#fff; padding:2px 7px;
             border-radius:3px; vertical-align:middle; letter-spacing:0.05em; }

.site-footer { margin:48px 0 30px; color:var(--muted); font-size:0.82rem; }

h1 { font-size:1.6rem; margin:24px 0 6px; }
h2 { font-size:1.1rem; margin:30px 0 8px; }
.muted { color:var(--muted); }
.small { font-size:0.85rem; }
.term { font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-weight:600; }
a { color:var(--accent); }

/* ---- search ---- */
.searchbar { display:flex; gap:10px; margin:26px 0 6px; }
.searchbar input {
  flex:1; padding:13px 15px; font-size:1.05rem;
  border:1px solid var(--line); border-radius:4px; background:#fff;
}
.searchbar input:focus { outline:2px solid var(--accent); border-color:var(--accent); }
.hint { color:var(--muted); font-size:0.85rem; margin:0 0 22px; }

button.primary {
  background:var(--accent); color:#fff; border:0; border-radius:4px;
  padding:12px 22px; font-size:0.95rem; font-weight:600; cursor:pointer;
}
button.primary:hover { background:var(--accent-dark); }
.linkbtn { background:none; border:0; color:var(--accent); font-weight:600;
           cursor:pointer; font-size:0.9rem; padding:0; }
form.inline { display:inline; }
.row-cta { display:inline-block; padding:8px 14px; border:1px solid var(--accent);
           border-radius:3px; color:var(--accent); text-decoration:none;
           font-weight:600; font-size:0.88rem; background:#fff; cursor:pointer; }

/* ---- tables ---- */
.number-table { width:100%; border-collapse:collapse; background:#fff;
                border:1px solid var(--line); font-size:0.92rem; margin-bottom:10px; }
.number-table th, .number-table td { padding:10px 12px;
                border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
.number-table th { background:#f3f3f3; font-weight:600; font-size:0.82rem; }
.number-table tr:last-child td { border-bottom:0; }
.number-table a { color:var(--accent); text-decoration:none; font-weight:600; }
.number-table a:hover { text-decoration:underline; }
tr.row-released { background:#fcfaf5; }
tr.row-other td { background:#f7f7f7; }

/* ---- pills ---- */
.pill { display:inline-block; padding:2px 8px; border-radius:10px;
        font-size:0.72rem; font-weight:600; white-space:nowrap; }
.pill-held { background:#e6f2ea; color:var(--held); }
.pill-released { background:#f5efdd; color:var(--released); }
.conf-confirmed { background:#e6f2ea; color:var(--held); }
.conf-order { background:#eef2f8; color:var(--accent); }
.conf-unresolved { background:#f8eeee; color:var(--danger); }
.pill-flag { background:#fdf0e2; color:var(--flag); }
/* Who controls the number, per the registry. "elsewhere" is deliberately
   neutral, not red: the customer usually still owns it, they just moved it to
   their own carrier. */
.ctlpill-ours      { background:#e6f2ea; color:var(--held); }
.ctlpill-elsewhere { background:#eef2f8; color:#4a5c78; }
.ctlpill-released  { background:#f5efdd; color:var(--released); }
.ctlpill-unchecked { background:#f2f2f2; color:var(--muted); }
.stat.ctl-ours b      { color:var(--held); }
.stat.ctl-elsewhere b { color:#4a5c78; }
.admin-banner.flagged { background:#fdf0e2; border-color:#e3bb8c; }
.admin-banner.flagged ul { margin:8px 0 0; padding-left:20px; }
.admin-banner.flagged li { margin:3px 0; }

/* ---- stats ---- */
.statrow { display:flex; flex-wrap:wrap; gap:10px; margin:18px 0 6px; }
.stat { background:#fff; border:1px solid var(--line); border-radius:4px;
        padding:12px 18px; min-width:130px; }
.stat b { display:block; font-size:1.15rem; }
.stat span { color:var(--muted); font-size:0.78rem; text-transform:uppercase;
             letter-spacing:0.04em; }

.page-head { display:flex; align-items:flex-start; justify-content:space-between;
             gap:20px; flex-wrap:wrap; }

/* ---- notices ---- */
.notice { background:#fff; border:1px solid var(--line); border-left:3px solid var(--accent);
          padding:12px 16px; margin:16px 0; }
.admin-banner { background:#fff3cd; border:1px solid #ddc77f; border-radius:4px;
                padding:12px 16px; margin:14px 0; font-size:0.92rem; }
.error { background:#f8eeee; border:1px solid #e0bcbc; color:var(--danger);
         padding:10px 14px; border-radius:4px; font-size:0.9rem; }

/* ---- login ---- */
.login-card { max-width:360px; margin:80px auto; background:#fff;
              border:1px solid var(--line); border-radius:6px; padding:30px 32px; }
.login-card h1 { margin:0 0 2px; font-size:1.3rem; }
.login-card label { display:block; margin:16px 0 0; font-size:0.85rem;
                    font-weight:600; color:var(--muted); }
.login-card input { width:100%; padding:10px 12px; margin-top:5px; font-size:1rem;
                    border:1px solid var(--line); border-radius:4px; }
.login-card button { width:100%; margin-top:22px; }

/* ---- admin toolbar ---- */
.admin-tools { display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin:16px 0 10px; }
.admin-tools input[type=text] { padding:8px 12px; border:1px solid var(--line);
                                border-radius:4px; min-width:290px; }
.admin-tools-hint { color:var(--muted); font-size:0.82rem; }
.admin-tools .spacer { flex:1; }
.releaseform { display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; }
.releaseform label { font-size:0.82rem; color:var(--muted); font-weight:600; }
.releaseform input { display:block; padding:8px 10px; border:1px solid var(--line);
                     border-radius:4px; margin-top:4px; }

.pager { display:flex; gap:16px; align-items:center; margin:18px 0 40px; }
.docbar { display:flex; justify-content:space-between; align-items:center;
          margin:22px 0 16px; gap:16px; }

/* ---- sortable table headers (was an inline <style>, which CSP refuses) ---- */
table.adm-table th[data-k] { cursor:pointer; user-select:none; }
table.adm-table th.sort-asc:after  { content:" B2"; font-size:0.7em; }
table.adm-table th.sort-desc:after { content:" BC"; font-size:0.7em; }

/* ---- printable ownership summary ---- */
.doc { background:#fff; border:1px solid var(--line); padding:34px 38px; max-width:800px; }
.doc h1 { margin:0 0 4px; font-size:1.5rem; }
.doc .issued { color:var(--muted); font-size:0.85rem; margin-bottom:22px; }
.doc table { width:100%; border-collapse:collapse; margin:18px 0; }
.doc th, .doc td { padding:9px 10px; border-bottom:1px solid var(--line);
                   text-align:left; font-size:0.92rem; }
.doc th { background:#f3f3f3; font-size:0.8rem; text-transform:uppercase; letter-spacing:.04em; }
.doc .foot { color:var(--muted); font-size:0.82rem; margin-top:22px; line-height:1.5; }
.doc h2 { font-size:1rem; margin:26px 0 4px; }
.doc .checking { color:var(--flag); font-size:0.85rem; margin:0; }

/* Wide tables scroll inside their own box rather than pushing the page sideways. */
.tablewrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }

@media print {
  @page { margin:0.6in 0.55in; }
  html, body { background:#fff; color:#000; font-size:11pt; }
  .site-header, .site-footer, .docbar, .noprint { display:none !important; }
  .container { max-width:none; padding:0; }
  .doc { border:0; padding:0; max-width:none; }
  .doc table { page-break-inside:auto; }
  .doc tr { page-break-inside:avoid; }
  .tablewrap { overflow:visible; }
}

@media (max-width:760px) {
  .header-row { flex-direction:column; align-items:flex-start; }
  .number-table { font-size:0.85rem; }
  .number-table th, .number-table td { padding:8px; }
}
