/*
  Styles of the sales entrance page.

  The sign-in view uses the tokens of static/login.html. The Assignments page and the
  contact panel follow the design mockup of the SDR program. System fonts only: the
  Content-Security-Policy of the sales entrance permits fonts from 'self' only.
  The page has no style attributes. The script changes classes only.
*/
:root {
  --indigo: #051964; --indigo-600: #1e3a8f;
  --coral: #f55064; --coral-600: #e23a50;
  --peri: #6991f0; --peri-tint: #eef3ff;
  --slate: #56689b; --slate-700: #33456e;
  --canvas: #f5f7fc; --line: #e3e9f5;
  --shadow-sm: 0 1px 2px rgba(5,25,100,.06), 0 1px 3px rgba(5,25,100,.05);
  --shadow-md: 0 6px 20px rgba(5,25,100,.12);
  --bad-bg: #fff5f6; --bad-line: #f6ccd2; --bad-ink: #a51e33;
  --warn-bg: #fffaf0; --warn-line: #f0e0bd; --warn-ink: #8a6410;

  /* The Assignments page. */
  --ink: #16191D; --ink-2: #3D4552; --ink-3: #4A5260; --ink-4: #5F6773;
  --page: #F3F4F6; --card: #FFFFFF; --rule: #D9DCE1; --rule-2: #E6E8EC; --rule-3: #EEF0F2;
  --field: #B7BDC6; --head-bg: #FAFAFB; --chip: #ECEEF1;
  --blue: #1E4FA8; --blue-dark: #163C80; --blue-tint: #E6EEFB; --row-open: #F3F7FE;
  --orange-bg: #FDF1E7; --orange: #8A3D04;
  --violet-bg: #EFEAFB; --violet: #5B3BA8;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--canvas); color: #1a1a1a; font-size: 14px; line-height: 1.45;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.work { background: var(--page); color: var(--ink); }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ── the top bar ─────────────────────────────────────────────────────────── */
.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 20px;
  background: #fff; border-bottom: 1px solid var(--line);
}
body.work .top { border-bottom-color: var(--rule); }
.top .mark { height: 30px; width: auto; display: block; }
.top .product {
  font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: #6b7cb8;
  font-weight: 700; padding-top: 2px;
}
.top .grow { flex: 1 1 auto; }
.top .who { color: var(--slate-700); font-size: 13px; }
.top .who + .link { margin-left: 4px; }
.weeknav { display: flex; align-items: center; gap: 4px; }
.weeknav .label { padding: 0 10px; font-weight: 500; white-space: nowrap; }
.iconbtn {
  width: 44px; height: 44px; flex: none; border: 1px solid var(--rule); border-radius: 6px;
  background: #fff; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; color: var(--ink-2); font: inherit;
}
.iconbtn:disabled { opacity: .4; cursor: default; }
.iconbtn svg { width: 16px; height: 16px; }

main { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }
body.work main { max-width: 1240px; padding: 20px 24px 48px; }
.center { display: grid; place-items: center; padding-top: 6vh; }

/* ── sign-in ─────────────────────────────────────────────────────────────── */
.card {
  width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 26px; box-shadow: var(--shadow-md);
}
h1 { color: var(--indigo); font-weight: 800; font-size: 20px; margin: 0 0 4px; }
.sub { color: var(--slate); font-size: 13px; margin: 0 0 18px; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--slate-700); margin: 0 0 5px; }
input[type=email], input[type=password] {
  width: 100%; padding: 9px 11px; font: inherit; color: #1a1a1a; background: #fff;
  border: 1px solid #ced7ea; border-radius: 8px;
}
#signin input:focus { border-color: var(--peri); box-shadow: 0 0 0 3px rgba(105,145,240,.15); outline: none; }
.field { margin-bottom: 15px; }
button.go {
  width: 100%; padding: 10px 14px; font: inherit; font-weight: 700; color: #fff;
  background: var(--coral); border: 1px solid var(--coral); border-radius: 8px; cursor: pointer;
}
button.go:hover:not(:disabled) { background: var(--coral-600); border-color: var(--coral-600); }
button.go:disabled { opacity: .55; cursor: default; }
button.link {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 700;
  color: var(--indigo-600); cursor: pointer; text-decoration: underline;
  min-height: 44px; display: inline-flex; align-items: center;
}
button.link:hover { color: var(--coral-600); }
.foot { margin: 14px 0 0; font-size: 13px; color: var(--slate); }

.msg {
  border-radius: 8px; padding: 9px 11px; font-size: 13px; margin: 0 0 15px; display: none;
  white-space: pre-wrap;
}
.msg.shown { display: block; }
.msg.bad { background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad-ink); }
.msg.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); }
.msg.ok { background: var(--blue-tint); border: 1px solid #cfdcf5; color: var(--blue-dark); }

/* ── the Assignments page ────────────────────────────────────────────────── */
.page { display: flex; flex-direction: column; gap: 16px; }
.page h1 { margin: 0; font-size: 22px; font-weight: 600; color: var(--ink); }
.page .lead { color: var(--ink-3); margin: 2px 0 0; }
.page .msg { margin: 0; }

.stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stat {
  flex: 1 1 140px; background: var(--card); border: 1px solid var(--rule); border-radius: 8px;
  padding: 10px 14px; display: flex; flex-direction: column; gap: 2px;
}
.stat .k { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.stat .v { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--ink-3); }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  min-height: 44px; padding: 0 14px; border-radius: 6px; font: inherit; font-size: 14px;
  font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: var(--ink); border: 1px solid var(--rule);
}
.tab .n {
  font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
  background: var(--chip); color: var(--ink-2);
}
.tab[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab[aria-pressed="true"] .n { background: var(--ink-2); color: #fff; }

.blank {
  background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: 32px;
  text-align: center; color: var(--ink-3); margin: 0;
}

.system {
  background: var(--card); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden;
}
.system .top-line {
  padding: 12px 16px 4px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
}
.tag {
  font-family: var(--mono); font-size: 12px; color: var(--ink-2); background: var(--chip);
  border-radius: 4px; padding: 2px 7px; white-space: nowrap;
}
.system h2 { margin: 0; font-size: 16px; font-weight: 600; }
.system .place { color: var(--ink-3); }
.system .open { color: var(--ink-3); font-size: 13px; margin-left: auto; }
.system .points {
  padding: 4px 16px 12px; display: flex; flex-wrap: wrap; gap: 4px 28px; font-size: 13px;
  color: var(--ink-2);
}
.points b, .talk b { font-weight: 600; color: var(--ink); }
/* position: the screen-reader text in the rows stays inside the scroll box. */
.scroll { position: relative; overflow-x: auto; border-top: 1px solid var(--rule-2); }
.grid { min-width: 1140px; }
.row {
  display: grid; gap: 12px; align-items: center; padding: 6px 16px;
  grid-template-columns: minmax(190px, 1.5fr) minmax(130px, 1fr) 100px 132px
    minmax(170px, 1.3fr) 56px minmax(150px, 1.2fr) 96px;
  border-top: 1px solid var(--rule-3); background: #fff;
}
.row.head {
  padding: 8px 16px; background: var(--head-bg); font-size: 12px; font-weight: 600;
  color: var(--ink-3); border-top: 0;
}
.row.open { background: var(--row-open); }
.who-btn {
  min-height: 44px; display: flex; flex-direction: column; align-items: flex-start;
  justify-content: center; gap: 1px; background: none; border: 0; padding: 4px 0;
  text-align: left; cursor: pointer; font: inherit; font-size: 14px; color: inherit;
}
.who-btn .nm { font-weight: 600; color: var(--blue); }
.who-btn .tt { font-size: 13px; color: var(--ink-3); }
.stale-note { font-size: 12px; color: var(--orange); font-weight: 500; }
.cell { font-size: 13px; color: var(--ink-2); }
.cell.mono { font-family: var(--mono); color: var(--ink); }
.cell.mail { color: var(--ink); overflow-wrap: anywhere; }
.cell.missing { color: var(--ink-4); font-style: italic; }
.cell.late { color: var(--orange); font-weight: 500; }

.chip {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px;
  font-weight: 600; white-space: nowrap;
}
.chip.research { background: var(--orange-bg); color: var(--orange); }
.chip.call { background: var(--blue-tint); color: #1E4FA8; }
.chip.follow_up { background: var(--violet-bg); color: var(--violet); }
.chip.done { background: var(--chip); color: var(--ink-2); }

.dots { display: flex; align-items: center; gap: 4px; }
.dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
  border: 1.5px solid #8A919C;
}
.dot.on { background: var(--blue); border-color: var(--blue); }
.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.btn {
  min-height: 44px; padding: 0 14px; border-radius: 6px; font: inherit; font-size: 14px;
  font-weight: 600; cursor: pointer; border: 1px solid var(--rule); background: #fff;
  color: var(--ink-2);
}
.btn.primary { border-color: var(--blue); background: var(--blue); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn.secondary { border-color: var(--blue); color: var(--blue); }
.btn.danger { border-color: var(--bad-ink); color: var(--bad-ink); }
.btn.small { font-size: 13px; padding: 0 12px; }
.btn.wide { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"], .toggle[aria-disabled="true"] {
  opacity: .55; cursor: default;
}

/* Paper time. */
.paper .top-line { padding-bottom: 8px; }
.paper-form {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 0 16px 12px;
}
.paper-form .f { min-width: 160px; }
.paper .msg { margin: 0 16px 12px; }
.paper-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 4px 16px;
  border-top: 1px solid var(--rule-3); font-size: 13px;
}
.paper-row .grow { flex: 1 1 auto; }
.top .btn { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }

/* The past weeks. */
.entries { min-width: 900px; }
.entries .row {
  grid-template-columns: 110px 80px minmax(150px, 1fr) minmax(150px, 1fr) 150px
    minmax(120px, 1fr) minmax(220px, 2fr);
  align-items: start; padding: 10px 16px;
}
.entries .row.head { align-items: center; padding: 8px 16px; }

/* ── the contact panel ───────────────────────────────────────────────────── */
.scrim {
  position: fixed; inset: 0; z-index: 10; background: rgba(22, 25, 29, .16); border: 0;
  padding: 0; margin: 0; cursor: default;
}
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 11; width: min(560px, 100%);
  background: #fff; color: var(--ink); box-shadow: -10px 0 30px rgba(22, 25, 29, .16);
  display: flex; flex-direction: column;
}
.panel .p-head {
  padding: 16px 20px 14px; border-bottom: 1px solid var(--rule-2); display: flex; gap: 12px;
  align-items: flex-start;
}
.panel .p-id { flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.panel .p-sys { font-size: 12px; color: var(--ink-3); }
.panel h2 { margin: 0; font-size: 20px; font-weight: 600; outline: none; }
.panel .p-role { color: var(--ink-2); }
.panel .p-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.panel .p-tries { font-size: 12px; color: var(--ink-3); }
.panel .p-body {
  flex: 1 1 auto; overflow-y: auto; padding: 16px 20px 20px; display: flex;
  flex-direction: column; gap: 20px;
}
.panel .p-foot {
  border-top: 1px solid var(--rule-2); padding: 12px 20px; display: flex; flex-wrap: wrap;
  gap: 10px; justify-content: flex-end; align-items: center;
}
.panel .p-foot .grow { flex: 1 1 auto; }
.sec { display: flex; flex-direction: column; gap: 8px; }
.sec h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.talk { font-size: 13px; }
.small { font-size: 12px; color: var(--ink-3); }
.warn-line { font-size: 13px; color: var(--orange); font-weight: 500; }
.notice {
  border-radius: 6px; padding: 10px 12px; font-size: 13px; font-weight: 500;
  background: var(--blue-tint); color: var(--blue-dark);
}
.notice.warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); }
.notice.bad { background: var(--bad-bg); color: var(--bad-ink); border: 1px solid var(--bad-line); }
.ext { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.ext svg { width: 14px; height: 14px; }

.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 0; }
.f input, .f select, .f textarea {
  min-height: 44px; width: 100%; padding: 8px 10px; border: 1px solid var(--field);
  border-radius: 6px; font: inherit; font-size: 14px; font-weight: 400; color: var(--ink);
  background: #fff;
}
.f textarea { min-height: 96px; line-height: 1.45; resize: vertical; padding: 10px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 400; color: var(--ink); margin: 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; }

.toggle {
  display: flex; align-items: center; gap: 10px; min-height: 44px; background: none; border: 0;
  padding: 0; cursor: pointer; font: inherit; font-size: 14px; color: var(--ink); text-align: left;
}
.toggle .track {
  position: relative; display: inline-block; width: 40px; height: 22px; border-radius: 11px;
  flex: none; background: var(--field);
}
.toggle .knob {
  position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: left .12s;
}
.toggle[aria-pressed="true"] .track { background: var(--blue); }
.toggle[aria-pressed="true"] .knob { left: 21px; }

.results { display: flex; flex-wrap: wrap; gap: 8px; }
.result {
  min-height: 44px; padding: 0 14px; border-radius: 22px; font: inherit; font-size: 13px;
  font-weight: 500; cursor: pointer; background: #fff; color: var(--ink);
  border: 1px solid var(--field);
}
.result[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }
.result:disabled { opacity: .45; cursor: default; }

.entry {
  border-top: 1px solid var(--rule-3); padding-top: 10px; display: flex; flex-direction: column;
  gap: 3px;
}
.entry .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--ink-3); align-items: center; }
.entry .meta b { font-weight: 600; color: var(--ink); }
.entry .meta .grow { flex: 1 1 auto; }
.entry .text { font-size: 13px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.entry .edit { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.entry .edit .acts { display: flex; gap: 8px; }
.confirm {
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 6px;
  background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad-ink); font-size: 13px;
}
.confirm .acts { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 640px) {
  .top { padding: 10px 12px; }
  body.work main { padding: 16px 12px 40px; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .weeknav .label { padding: 0 4px; }
}
@media print {
  .top, .tabs, .scrim, .panel { display: none !important; }
}
