/* installpro.app colors (from installpro-app-brand) */
:root {
  --navy: #0F2747;
  --blue: #1E5FD0;
  --teal: #0D9488;         /* ".app" in the logo on white */
  --bright-teal: #14B8A6;  /* highlights only, not for text */
  --light-teal: #2DD4BF;
  --panel: #F1F5F9;
  --border: #E2E8F0;
  --muted: #475569;
  --white: #FFFFFF;

  /* What the light and dark modes change. */
  --text: #0F2747;
  --surface: #FFFFFF;     /* cards, inputs */
  --surface-2: #F8FAFC;   /* hover, read-only fields */
  --selected: #EFF6FF;    /* chosen items */
  --link: #1E5FD0;        /* links and link-style buttons */

  --workflow: #1E5FD0;
  --convert: #B45309;
  --deploy: #0F766E;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--panel);
}

h1, h2 { font-weight: 800; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 24px; }
h2 { font-size: 15px; }
.muted { color: var(--muted); }

button {
  font: inherit;
  font-weight: 600;
  color: var(--white);
  background: var(--blue);
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.45; cursor: default; filter: none; }
button.small { padding: 5px 10px; font-size: 13px; }

/* ---------- Sign in page ---------- */

.signin-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.signin-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 32px;
  box-shadow: 0 10px 30px rgba(15, 39, 71, 0.08);
}

.signin-logo { height: 40px; width: auto; display: block; margin-bottom: 28px; }
.signin-card .muted { margin: 6px 0 22px; }

.signin-card form { display: grid; gap: 6px; }
.signin-card label { font-weight: 600; font-size: 14px; margin-top: 8px; }
.signin-card input {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}
.signin-card input:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(30, 95, 208, 0.15);
}
.signin-card button { margin-top: 18px; }

.notice {
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  color: #78350F;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 8px;
  font-size: 14px;
}
.notice.error {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: #7F1D1D;
}
.notice.ok {
  background: #CCFBF1;
  border-color: #5EEAD4;
  color: #134E4A;
}

/* Text for screen readers only */
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Console layout ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 32px;
  background: var(--navy);
  padding: 0 24px;
  height: 60px;
}
.topbar-logo { height: 30px; width: auto; display: block; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a, .signout {
  color: #CBD5E1;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
}
.topbar nav a:hover, .signout:hover { color: var(--white); background: rgba(255,255,255,0.08); filter: none; }
.topbar form { margin: 0; }
.signout { background: none; font-size: 15px; }
.who { color: #CBD5E1; font-size: 14px; margin-right: -24px; text-align: right; line-height: 1.25; }
.who small { display: block; font-size: 12px; color: #94A3B8; }
.topbar nav a.active { color: var(--white); box-shadow: inset 0 -2px 0 var(--bright-teal); border-radius: 0; }

.workspace {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 60px);
}

.customer-list {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 16px;
}
.list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.empty { color: var(--muted); font-size: 14px; }

.customer-detail { display: grid; place-items: center; padding: 32px; }
.placeholder { text-align: center; max-width: 360px; }
.placeholder img { margin-bottom: 14px; }
.placeholder .muted { margin-top: 8px; }

/* Phones: tabs on their own row, list stacked above the detail area */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; justify-content: space-between; gap: 0; padding: 10px 16px 0; height: auto; }
  .topbar-logo { height: 24px; }
  .topbar nav { order: 3; flex-basis: 100%; margin: 6px -12px 0; }
  .topbar nav a { white-space: nowrap; }
  .who { display: none; }
  .workspace { grid-template-columns: 1fr; min-height: 0; }
  .customer-list { border-right: 0; border-bottom: 1px solid var(--border); }
}

/* ---------- Full-width pages (Companies, Users, ...) ---------- */

.page { max-width: 960px; margin: 0 auto; padding: 32px 24px; display: grid; gap: 20px; }
.page-head .muted { margin: 6px 0 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.card h2 { margin-bottom: 12px; }

.inline-form { display: flex; gap: 10px; }
.inline-form input {
  flex: 1;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  min-width: 0;
}
.inline-form input:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px rgba(30, 95, 208, 0.15); }

table.list { width: 100%; border-collapse: collapse; }
table.list th {
  text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--muted); padding: 0 12px 10px;
  border-bottom: 1px solid var(--border);
}
table.list td { padding: 12px; border-bottom: 1px solid var(--border); }
table.list tr:last-child td { border-bottom: 0; }

@media (max-width: 720px) {
  .page { padding: 20px 16px; }
  .inline-form { flex-direction: column; }
}

/* ---------- Users and password pages ---------- */

a { color: var(--link); }
.page.narrow { max-width: 480px; }
.crumb { margin: 0 0 4px; font-size: 14px; }
.crumb a { text-decoration: none; }
.small { font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; margin: 12px 0 0; }

a.who { text-decoration: none; }
a.who:hover { color: var(--white); }

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}
.grid-form label, .stack-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.grid-form input, .grid-form select, .stack-form input {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
}
.grid-form input:focus, .grid-form select:focus, .stack-form input:focus {
  outline: none; border-color: var(--link); box-shadow: 0 0 0 3px rgba(30, 95, 208, 0.15);
}
.grid-form-button button { width: 100%; }

.stack-form { display: grid; gap: 4px; }
.stack-form label { margin: 10px 0 2px; }
.stack-form button { margin-top: 18px; }

a.button {
  display: inline-block; font-weight: 600; color: var(--white); background: var(--blue);
  border-radius: 8px; padding: 11px 16px; text-decoration: none;
}

/* Status labels */
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.pill.on { background: #CCFBF1; color: #115E59; }
.pill.wait { background: #FEF3C7; color: #78350F; }
.pill.off { background: #E2E8F0; color: #475569; }
.pill.id-pill { background: #E0F2FE; color: #075985; font-weight: 600; margin-left: 4px; vertical-align: 1px; }
tr.off td { color: var(--muted); }

/* Buttons that look like links (Reset password, Switch off) */
td.actions { text-align: right; white-space: nowrap; }
td.actions form { display: inline; margin: 0; }
button.link {
  background: none; color: var(--link); padding: 4px 6px; font-weight: 500; font-size: 14px;
}
button.link:hover { text-decoration: underline; filter: none; }
button.link.danger { color: #B91C1C; }

/* The temporary password box */
.card.temp { border-color: #5EEAD4; background: #F0FDFA; }
.temp-details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0 0; }
.temp-details dt { color: var(--muted); font-size: 14px; }
.temp-details dd { margin: 0; }
.temp-password {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 18px; font-weight: 600; letter-spacing: 0.06em;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px;
  user-select: all;
}

@media (max-width: 720px) {
  table.list th.actions, td.actions { text-align: left; white-space: normal; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; }
  table.list thead { display: none; }
  table.list tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  table.list tr:last-child { border-bottom: 0; }
  table.list td { border: 0; padding: 3px 4px; }
}

/* ---------- Feedback ---------- */

.topbar nav a.push-right { margin-left: auto; }
.count {
  display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px;
  border-radius: 999px; background: var(--bright-teal); color: var(--navy);
  font-size: 12px; font-weight: 700; text-align: center; line-height: 20px;
}

.stack-form textarea {
  width: 100%; font: inherit; padding: 10px 12px; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; resize: vertical;
}
.stack-form textarea:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px rgba(30, 95, 208, 0.15); }

.kinds { border: 0; padding: 0; margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 8px; }
.stack-form label.kind {
  display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500;
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; cursor: pointer;
}
.stack-form label.kind:has(input:checked) { border-color: var(--link); background: var(--selected); }

.filter { display: flex; gap: 6px; }
.filter a {
  text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
}
.filter a.on { color: var(--white); background: var(--navy); border-color: var(--text); }

.section-title { margin-top: 8px; }
.card.message { display: grid; gap: 10px; }
.card.message.done { opacity: 0.7; }
.message-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.message-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pill.kind-problem { background: #FEE2E2; color: #991B1B; }
.pill.kind-suggestion { background: #DBEAFE; color: #1E40AF; }
.pill.kind-question { background: #FEF3C7; color: #78350F; }

.reply { border-left: 3px solid var(--bright-teal); background: var(--panel); border-radius: 0 8px 8px 0; padding: 10px 14px; }
.reply-label { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--teal); }

.owner-tools summary { cursor: pointer; color: var(--link); font-weight: 500; font-size: 14px; }
.owner-tools .stack-form { margin-top: 8px; }
.owner-tools .stack-form button { margin-top: 8px; justify-self: start; }
.done-form { margin: 0; }
.done-form button.link { padding-left: 0; }

/* ---------- Customers ---------- */

a.button.small { padding: 5px 10px; font-size: 13px; }
.customer-list .list-filter {
  width: 100%; font: inherit; font-size: 14px; padding: 8px 10px; margin-bottom: 10px;
  border: 1px solid var(--border); border-radius: 8px; color: var(--text);
}
.customer-list .list-filter:focus { outline: none; border-color: var(--link); }
.customer-list ul { list-style: none; margin: 0; padding: 0; }
.customer-list li a {
  display: block; padding: 9px 10px; border-radius: 8px; color: var(--text);
  text-decoration: none; font-weight: 500; overflow-wrap: anywhere;
}
.customer-list li a:hover { background: var(--panel); }
.customer-list li a.on { background: var(--selected); color: var(--link); box-shadow: inset 3px 0 0 var(--blue); }

.customer-detail:has(.detail) { display: block; place-items: initial; }
.detail { max-width: 900px; display: grid; gap: 16px; }
.detail h1 { overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.detail h3 { font-size: 14px; margin: 16px 0 4px; }
.back-link { display: none; }
.code-box { margin: 4px 0 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.customer-form .two-col label { margin-top: 10px; }

details.card.edit summary { cursor: pointer; list-style: none; }
details.card.edit summary::-webkit-details-marker { display: none; }
details.card.edit summary h2 { display: inline; color: var(--link); }
details.card.edit summary h2::before { content: "▸ "; }
details.card.edit[open] summary h2::before { content: "▾ "; }
details.card.edit[open] summary { margin-bottom: 8px; }

[hidden] { display: none !important; }

@media (max-width: 720px) {
  .customer-detail { padding: 20px 16px; }
  .workspace.has-selection .customer-list { display: none; }
  .back-link { display: block; }
  .two-col { grid-template-columns: 1fr; }
}
.workspace.no-list { grid-template-columns: 1fr; }
.workspace.no-list .detail { margin: 0 auto; width: 100%; }

/* ---------- Printers and locations ---------- */

.printers { display: grid; gap: 12px; }
.printers .hint { margin: -6px 0 4px; }
.sub-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.sub-card h3 { margin: 0 0 4px; font-size: 15px; }
.location + .location { border-top: 1px solid var(--border); padding-top: 12px; }
.location-name { font-size: 15px; margin: 0 0 6px; }
.printer-list code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; }
.printer-list td { vertical-align: top; }
tr.edit-row td { padding: 0 0 12px; border-bottom: 1px solid var(--border); }
a.link-button { color: var(--link); text-decoration: none; font-size: 14px; font-weight: 500; padding: 4px 6px; }
a.link-button:hover { text-decoration: underline; }
.host-port { grid-template-columns: 1fr 110px; }

.location-tools summary { cursor: pointer; color: var(--link); font-size: 14px; font-weight: 500; }
.location-tools[open] { display: grid; gap: 10px; }
.location-tools[open] summary { margin-bottom: 2px; }
.location-tools .inline-form input { padding: 7px 10px; }
.add-location { border-top: 1px solid var(--border); padding-top: 12px; }
.rename-first { align-items: center; }
.rename-first label { font-size: 14px; color: var(--muted); white-space: nowrap; }

@media (max-width: 720px) {
  .host-port { grid-template-columns: 1fr 1fr; }
  .rename-first { align-items: stretch; }
}
.printers .list-head { margin-bottom: 0; }

/* ---------- Driver Library ---------- */

.section-block { display: grid; gap: 12px; }
.section-block > .hint { margin: -8px 0 0; }
.driver-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
a.driver-card { display: grid; gap: 6px; color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.driver-card:hover { border-color: var(--link); box-shadow: 0 4px 14px rgba(15, 39, 71, 0.08); }
a.driver-card.retired { opacity: 0.65; }
.driver-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.driver-card p { margin: 0; }
.arch-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.arch-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 14px; }
.arch-list .arch { font-weight: 600; min-width: 118px; }

details.card.upload summary { cursor: pointer; list-style: none; }
details.card.upload summary::-webkit-details-marker { display: none; }
details.card.upload summary h2 { display: inline; color: var(--link); }
details.card.upload[open] summary { margin-bottom: 8px; }
.stack-form input[type=file] { padding: 8px; background: var(--panel); }
.progress-bar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }

.list-filter.wide {
  width: 100%; font: inherit; font-size: 14px; padding: 8px 10px; margin: 4px 0 10px;
  border: 1px solid var(--border); border-radius: 8px; color: var(--text);
}
ul.names { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
ul.names li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
ul.names li:last-child { border-bottom: 0; }
.manage-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.manage-actions form { margin: 0; }
.manage-actions button.link { padding-left: 0; }

/* ---------- Choosing a printer's driver ---------- */

fieldset.driver-choice { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 12px 0 4px; background: var(--surface); display: grid; gap: 6px; }
fieldset.driver-choice legend { font-weight: 600; font-size: 14px; padding: 0 4px; }
.suggestions { display: grid; gap: 6px; }
.suggestions p { margin: 0; }
.stack-form label.choice {
  display: flex; gap: 10px; align-items: flex-start; margin: 0; font-weight: 400;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
}
.stack-form label.choice:has(input:checked) { border-color: var(--link); background: var(--selected); }
.stack-form label.choice input { margin-top: 3px; }
.other-driver { padding-left: 30px; }
.other-driver .list-filter.wide { margin: 0 0 6px; }
.other-driver select { width: 100%; font: inherit; font-size: 14px; border: 1px solid var(--border); border-radius: 8px; padding: 4px; color: var(--text); }
.other-driver select optgroup { font-weight: 600; color: var(--muted); }
.driver-cell { font-size: 14px; min-width: 200px; }
.driver-cell .pill { margin-top: 4px; }
.stack-form label.choice input { width: auto; flex: none; padding: 0; }
.stack-form label.kind input { width: auto; padding: 0; }

/* ---------- Driver versions ---------- */
.older-versions { color: var(--muted); }
a.pill.update { background: #DBEAFE; color: #1E40AF; text-decoration: none; }
a.pill.update:hover { text-decoration: underline; }
.move-form { margin: 12px 0 0; }
.stack-form select {
  width: 100%; font: inherit; padding: 10px 12px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
}
.stack-form select:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px rgba(30, 95, 208, 0.15); }
.other-driver select { padding: 4px; }

/* ---------- Default printer settings ---------- */
fieldset.defaults { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 12px 0 4px; background: var(--surface); }
fieldset.defaults legend { font-weight: 600; font-size: 14px; padding: 0 4px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.three-col label { margin-top: 0 !important; }
fieldset.defaults .hint { margin: 10px 0 0; }
.defaults-summary { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 500; color: var(--deploy); background: #CCFBF1; border-radius: 6px; padding: 1px 7px; }
@media (max-width: 720px) { .three-col { grid-template-columns: 1fr; } }

/* ---------- PCs ---------- */
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.status-dot.on { background: var(--bright-teal); box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18); }
.status-dot.off { background: #CBD5E1; }
.pc-list td { vertical-align: top; font-size: 14px; }
.pc-location select { font: inherit; font-size: 14px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); background: var(--surface); }
.pcs { display: grid; gap: 12px; }
.pcs .list-head { margin-bottom: 0; }
.pcs .hint { margin: -6px 0 4px; }

/* ---------- The user portal ---------- */
body.portal { background: var(--panel); }
.portal-top { background: var(--navy); padding: 14px 24px; }
.portal-logo { height: 28px; display: block; }
.portal-main { max-width: 880px; margin: 0 auto; padding: 32px 24px 48px; display: grid; gap: 22px; }
.portal-head h1 { font-size: 26px; }
.portal-head .muted { margin: 6px 0 0; }
.portal-location { display: grid; gap: 12px; }
.portal-location h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; }
.portal-printer {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px;
}
.portal-printer.unavailable { opacity: 0.7; }
.printer-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: #E6FFFA; color: var(--deploy); }
.printer-text h3 { margin: 0; font-size: 16px; font-weight: 700; }
.printer-text p { margin: 2px 0 0; }
.portal-printer button { min-width: 96px; }
.portal-printer .not-here { max-width: 150px; margin: 0; }
.portal-note { text-align: center; }
.portal-message { text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 40px 24px; }
.portal-message img { margin-bottom: 12px; }
.portal-message .muted { max-width: 460px; margin: 10px auto 0; }
@media (max-width: 720px) {
  .portal-grid { grid-template-columns: 1fr; }
  .portal-printer { grid-template-columns: auto 1fr; }
  .portal-printer button, .portal-printer .not-here { grid-column: 1 / -1; max-width: none; }
}

/* Support view banner (the owner viewing a company's console). */
.support-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  padding: 10px 24px; background: #0E7490; color: #fff; font-size: 14px; }
.support-banner.control { background: #B45309; }
.support-banner .support-mode { margin-left: 8px; opacity: 0.92; }
.support-banner .support-actions { display: flex; align-items: center; gap: 14px; }
.support-banner form { margin: 0; }
.support-banner .link.light { color: #fff; text-decoration: underline; }
.support-banner .button.light { background: #fff; color: #0F2744; }

/* "Cancel" under a form's main button. */
.form-cancel { margin: 0; text-align: center; font-size: 14px; }

.card > .hint + table.list { margin-top: 14px; }

/* Setup page (from a customer's setup link) and "Set up a PC". */
.setup-card { max-width: 640px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 32px; text-align: center; }
.setup-card h1 { margin: 12px 0 6px; }
.setup-card .button.big { display: inline-block; font-size: 16px; padding: 12px 22px; margin: 18px 0 8px; }
.setup-steps { text-align: left; margin: 18px 0; padding-left: 22px; display: grid; gap: 10px; line-height: 1.5; }
.setup-card .hint { text-align: left; }
.copy-row { display: flex; gap: 8px; align-items: center; margin: 6px 0 4px; }
.copy-row input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.switch-form { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.client-steps { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.copy-row input { padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }

/* Support conversations. */
.filter-tabs { display: flex; gap: 6px; }
.filter-tabs a { font-size: 14px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: inherit; text-decoration: none; }
.filter-tabs a.on { background: #0F2744; border-color: #0F2744; color: #fff; }
.conversation-list { list-style: none; margin: 0; padding: 0; }
.conversation-list li { border-top: 1px solid var(--border); }
.conversation-list li:first-child { border-top: 0; }
.conversation-list a { display: flex; justify-content: space-between; gap: 16px; padding: 12px 4px; color: inherit; text-decoration: none; }
.conversation-list a:hover { background: var(--surface-2); }
.conversation-list .conv-main { display: grid; gap: 2px; min-width: 0; }
.conversation-list .conv-side { display: grid; justify-items: end; gap: 4px; white-space: nowrap; }
.conversation-list li.done strong { color: var(--muted); }
.new-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2563EB; margin-right: 8px; vertical-align: 2px; }
.page.narrow-wide { max-width: 760px; }
.conv-actions { display: flex; align-items: center; gap: 12px; }
.conv-actions form { margin: 0; }
.button.secondary { background: var(--surface); color: #1D4ED8; border: 1px solid #93C5FD; }
.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.msg { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; max-width: 88%; }
.msg.mine { justify-self: end; background: var(--selected); border-color: #BFDBFE; }
.msg-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.msg-body { margin: 6px 0 0; }
.shots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.shots img { max-width: 220px; max-height: 160px; border-radius: 8px; border: 1px solid var(--border); display: block; }
.choice-row { display: flex; gap: 16px; flex-wrap: wrap; }
.choice-row .choice { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.conv-actions .link, .conv-actions .button { white-space: nowrap; }

/* ---------- Dark mode (the moon/sun button in the top bar) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --text: #E2E8F0;
  --muted: #94A3B8;
  --panel: #0B1424;
  --surface: #111C2E;
  --surface-2: #16233A;
  --selected: #1A3354;
  --border: #26354D;
  --blue: #3B82F6;
  --link: #60A5FA;
  --teal: #2DD4BF;
  --deploy: #5EEAD4;
}
:root[data-theme="dark"] .topbar, :root[data-theme="dark"] .portal-top { background: #060D1A; border-bottom: 1px solid var(--border); }
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { background-color: var(--surface); color: var(--text); }
:root[data-theme="dark"] .pill.on, :root[data-theme="dark"] .defaults-summary { background: #134E4A; color: #99F6E4; }
:root[data-theme="dark"] .pill.wait, :root[data-theme="dark"] .pill.kind-question { background: #422006; color: #FCD34D; }
:root[data-theme="dark"] .pill.off { background: #1E293B; color: #CBD5E1; }
:root[data-theme="dark"] .pill.id-pill { background: #0C4A6E; color: #BAE6FD; }
:root[data-theme="dark"] .pill.kind-problem { background: #450A0A; color: #FCA5A5; }
:root[data-theme="dark"] .pill.kind-suggestion, :root[data-theme="dark"] a.pill.update { background: #172554; color: #93C5FD; }
:root[data-theme="dark"] .notice { background: #422006; border-color: #92400E; color: #FDE68A; }
:root[data-theme="dark"] .notice.error { background: #450A0A; border-color: #991B1B; color: #FECACA; }
:root[data-theme="dark"] .notice.ok { background: #042F2E; border-color: #115E59; color: #99F6E4; }
:root[data-theme="dark"] .card.temp { background: #042F2E; border-color: #115E59; }
:root[data-theme="dark"] .printer-icon { background: #134E4A; color: #5EEAD4; }
:root[data-theme="dark"] .msg.mine { background: #172554; border-color: #1E3A8A; }
:root[data-theme="dark"] .status-dot.off { background: #475569; }
:root[data-theme="dark"] button.link.danger { color: #F87171; }
:root[data-theme="dark"] .button.secondary { color: #93C5FD; border-color: #1E3A8A; }
:root[data-theme="dark"] .filter-tabs a.on, :root[data-theme="dark"] .filter a.on { background: #E2E8F0; border-color: #E2E8F0; color: #0B1424; }
:root[data-theme="dark"] img.brand-dark-invert { filter: invert(1) hue-rotate(180deg); }

/* The light/dark button in the top bar. */
.theme-toggle { margin: 0; }
.theme-toggle button { background: none; color: #CBD5E1; padding: 6px; display: grid; place-items: center; border-radius: 8px; }
.theme-toggle button:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* Installing from the printer page. */
.install-form { display: grid; justify-items: end; gap: 4px; margin: 0; }
.install-status { margin: 0; color: var(--muted); max-width: 220px; text-align: right; }
.install-status:empty { display: none; }
.install-status.done { color: var(--deploy); font-weight: 600; }
.install-status.done::before { content: "✓ "; }
.install-status.failed { color: #B91C1C; }
:root[data-theme="dark"] .install-status.failed { color: #F87171; }
.install-details { margin-top: 4px; font-size: 13px; }
.install-details summary { cursor: pointer; color: var(--muted); }
.install-details pre { white-space: pre-wrap; word-break: break-word; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin: 6px 0 0; max-height: 260px; overflow: auto; }
.install-box { display: grid; justify-items: end; gap: 4px; }
.install-box form { margin: 0; }
button.secondary { background: var(--surface); color: var(--link); border: 1px solid var(--border); }
tr.open-pc td { border-bottom: 0; background: var(--surface-2); }
tr.pc-printers-row td { background: var(--surface-2); padding-top: 0; }
.pc-printers { display: grid; gap: 6px; }
.pc-printer { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.pc-printer-state { display: flex; gap: 8px; align-items: center; }
.pc-printer-actions { display: flex; gap: 6px; justify-content: flex-end; min-width: 150px; }
.pc-printer-actions form { margin: 0; }
.failed-note { color: #B91C1C; cursor: help; }
:root[data-theme="dark"] .failed-note { color: #F87171; }

/* Long lists on the customer page stay about 8 rows tall and scroll inside. */
.scroll-box.capped { max-height: 480px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.scroll-box.capped table.list thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); padding-top: 10px; }
.scroll-box.capped ul.plain { margin: 0; padding: 4px 12px; }
.pcs .list-filter.wide, .card .list-filter.wide { margin: 4px 0 10px; }
.scroll-box.capped .conversation-list { padding: 0 8px; }

/* Deleting. */
details.card.danger-zone summary h2 { display: inline; color: #B91C1C; }
details.card.danger-zone { border-color: #FCA5A5; }
.danger-card { border-color: #FCA5A5; }
button.danger:not(.link) { background: #B91C1C; color: #fff; }
a.danger-link { color: #B91C1C; }
:root[data-theme="dark"] details.card.danger-zone summary h2, :root[data-theme="dark"] a.danger-link { color: #F87171; }
:root[data-theme="dark"] details.card.danger-zone, :root[data-theme="dark"] .danger-card { border-color: #7F1D1D; }

/* The test site says so in the top bar, so it's never mistaken for the real one. */
.test-badge { background: #F59E0B; color: #111827; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; padding: 3px 8px; border-radius: 999px; margin-left: 10px; white-space: nowrap; }
[data-live="release"] > .card + .card { margin-top: 16px; }

/* Edit details and Delete customer sit at the bottom of the Contact box. */
.contact-card { display: flex; flex-direction: column; }
.contact-actions { margin-top: auto; padding-top: 16px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
/* While the Contact box is a form, the box beside it keeps its own height. */
.detail-grid.top-aligned { align-items: start; }
