/* Front desk. Dense and keyboard-friendly — this is used one-handed while
   someone is standing at the counter. */

body { font-size: 15px; }

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.bar h1 { margin: 0; font-size: 1.1rem; letter-spacing: 0.04em; text-transform: uppercase; }
.bar nav { display: flex; align-items: center; gap: 1rem; }
.bar a { color: var(--st-assigned); text-decoration: none; font-weight: 600; }
.bar a:hover { text-decoration: underline; }

.conn { font-size: 0.8rem; color: var(--text-dim); }
.conn.is-down { color: var(--overdue); font-weight: 700; }

.layout {
  display: grid;
  grid-template-columns: 22rem minmax(0, 1fr) 18rem;
  gap: 1rem;
  padding: 1rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.panel h2 {
  margin: 0 0 0.7rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.panel h2:not(:first-child) { margin-top: 1.6rem; }
.count { color: var(--text); font-weight: 400; letter-spacing: 0; }

label { display: grid; gap: 0.25rem; font-size: 0.75rem; color: var(--text-dim); }

input, select, button, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
}

input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--st-assigned);
  outline-offset: 1px;
}

button { cursor: pointer; font-weight: 600; }
button:hover { background: var(--line); }

.primary { background: var(--st-assigned); border-color: var(--st-assigned); color: #08111f; }
.primary:hover { filter: brightness(1.1); background: var(--st-assigned); }
.ghost { background: transparent; }

.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.grid-form .wide { grid-column: 1 / -1; }
.inline-form { display: flex; gap: 0.4rem; margin-bottom: 0.6rem; }
.inline-form input { min-width: 0; flex: 1; }

.error { color: var(--overdue); font-size: 0.85rem; margin: 0.3rem 0 0; }

.jobs { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.jobs th {
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 0.4rem 0.4rem;
  font-weight: 700;
}
.jobs td { padding: 0.35rem 0.4rem; border-top: 1px solid var(--line); vertical-align: middle; }
.jobs tbody tr:hover { background: var(--surface-2); }
.jobs select { padding: 0.25rem; font-size: 0.85rem; }
.jobs .ro { font-family: var(--mono); font-size: 0.8rem; color: var(--text-dim); }
.jobs .vehicle { font-weight: 600; white-space: nowrap; }
.jobs .work { color: var(--text-dim); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jobs .elapsed { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.row-overdue  .due { color: var(--overdue); font-weight: 700; }
.row-due_soon .due { color: var(--due-soon); font-weight: 700; }

.pill {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #08111f;
  background: var(--status, var(--st-waiting));
}

.tech-dot {
  display: inline-block;
  width: 0.7em; height: 0.7em;
  border-radius: 50%;
  margin-right: 0.35rem;
  background: var(--tech, var(--st-assigned));
}

.chips, .admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }

.chips li, .admin-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.admin-list .muted { opacity: 0.45; }
.link-danger { background: none; border: none; color: var(--overdue); padding: 0.1rem 0.3rem; }
.link-danger:hover { background: none; text-decoration: underline; }

dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 1.5rem;
  min-width: 18rem;
}
dialog::backdrop { background: rgba(4, 7, 12, 0.8); }
dialog h2 { margin-top: 0; }
dialog form { display: grid; gap: 0.8rem; }

.pin-flag {
  margin-left: 0.4rem;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 0.25rem;
}

/* "Waiting Approval" is long enough to wrap and stretch its row. */
.pill { white-space: nowrap; }
.jobs td:has(> .pill) { white-space: nowrap; }

/* The add-tech row has three controls; let the name field breathe. */
#new-tech { flex-wrap: wrap; }
#new-tech input[name="name"] { flex: 1 1 8rem; }
#new-tech input[name="pin"] { flex: 0 0 4.5rem; }

.bar-brand { display: flex; align-items: center; gap: 0.7rem; }
.bar-brand img { height: 28px; width: auto; max-width: 180px; object-fit: contain; }

.logo-row { display: flex; align-items: center; gap: 0.8rem; min-height: 1rem; }

/* The board is dark, so preview the logo against the board's background
   rather than against this panel — a white-on-white wordmark is a real
   mistake to catch here instead of on the wall. */
.logo-preview {
  max-height: 52px;
  max-width: 220px;
  object-fit: contain;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
}

input[type="color"] { padding: 0.15rem; height: 2.2rem; cursor: pointer; }
input[type="file"] { padding: 0.3rem; font-size: 0.8rem; }

.primary { background: var(--brand); border-color: var(--brand); }
.primary:hover { background: var(--brand); }
.bar a { color: var(--brand); }

/* ---- settings dialog ----------------------------------------------------- */

.settings-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  overflow: hidden;
  display: none;
}
.settings-dialog[open] { display: flex; flex-direction: column; }

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.5rem;
}
.settings-head h2 { margin: 0; font-size: 1.1rem; }

.settings-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--line);
}
.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.6rem 0.9rem;
  color: var(--text-dim);
}
.tab:hover { background: none; color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--brand); }

.settings-body { padding: 1rem 1.25rem 1.25rem; overflow-y: auto; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.tab-panel h3 {
  margin: 1.2rem 0 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.tab-panel h3:first-of-type { margin-top: 0.5rem; }

.hint { margin: 0 0 1rem; color: var(--text-dim); font-size: 0.85rem; line-height: 1.45; }

.settings-table { width: 100%; border-collapse: collapse; margin-bottom: 0.6rem; font-size: 0.9rem; }
.settings-table th {
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 0.4rem 0.35rem;
}
.settings-table td { padding: 0.4rem; border-top: 1px solid var(--line); vertical-align: middle; }
.settings-table tr.muted td { opacity: 0.45; }
.settings-table .strong { font-weight: 600; }
.settings-table .sub { display: block; font-weight: 400; font-size: 0.78rem; color: var(--text-dim); }
.settings-table .actions { text-align: right; white-space: nowrap; }
.settings-table .actions button { padding: 0.25rem 0.55rem; font-size: 0.8rem; }
.settings-table select { width: 100%; }

#new-bay select { flex: 0 0 11rem; }
#new-tech input[type="color"] { flex: 0 0 2.6rem; height: auto; }

/* Main console is two columns now that admin moved into Settings. */
.layout { grid-template-columns: 22rem minmax(0, 1fr); }
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } }

/* VIN: monospace so a service writer can read it back character by character. */
.vin, input.vin { font-family: var(--mono); letter-spacing: 0.04em; }
.jobs .vehicle .sub { display: block; font-weight: 400; font-size: 0.78rem; color: var(--text-dim); }
.hint + form, .error.wide { grid-column: 1 / -1; }

.jobs .elapsed.is-running { color: var(--st-in_progress); font-weight: 700; }

.warn {
  margin: 0 0 1rem;
  padding: 0.6rem 0.8rem;
  border-left: 4px solid var(--due-soon);
  background: var(--surface-2);
  border-radius: 6px;
  font-size: 0.88rem;
}
.ok { color: var(--st-in_progress); font-size: 0.9rem; margin: 0; }
.hint.small { margin-top: 1rem; font-size: 0.78rem; }
.hint code { font-family: var(--mono); font-size: 0.95em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; }

/* A quiet nudge on the Settings button while the default password is in use. */
#open-settings.needs-attention { border-color: var(--due-soon); color: var(--due-soon); }

label.check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--text); margin-bottom: 0.8rem; }
label.check input { width: 1.1rem; height: 1.1rem; }
.hours-table input[type="time"] { width: 100%; }
.hours-table input[type="checkbox"] { width: 1.1rem; height: 1.1rem; }
.hours-table input:disabled { opacity: 0.35; }
.hours-table.is-off { opacity: 0.45; }
#hours-form .primary { margin-top: 0.6rem; width: 100%; }

/* ---- intercom ------------------------------------------------------------ */

.intercom { display: grid; gap: 0.5rem; margin-bottom: 1.4rem; }

.ptt {
  min-height: 3.4rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--surface-2);
  border: 2px solid var(--line);
  border-radius: 12px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.ptt:hover { border-color: var(--brand); background: var(--surface-2); }
.ptt.is-held, .ptt.is-connecting { border-color: var(--due-soon); color: var(--due-soon); }
/* On air: unmistakable. */
.ptt.is-live { background: var(--overdue); border-color: var(--overdue); color: #1a0505; }

.ic-status { margin: 0; min-height: 1.2em; font-size: 0.82rem; color: var(--text-dim); }
.ic-status.is-warning { color: var(--due-soon); }

.ic-incoming {
  position: fixed;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.4rem;
  font-size: 1.05rem;
  background: var(--surface-2);
  border: 2px solid var(--st-in_progress);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.ic-dot {
  width: 0.7rem; height: 0.7rem; border-radius: 50%;
  background: var(--st-in_progress);
  animation: ic-pulse 0.9s ease-in-out infinite;
}
@keyframes ic-pulse { 50% { opacity: 0.25; transform: scale(0.8); } }
@media (prefers-reduced-motion: reduce) { .ic-dot { animation: none; } }

/* A long target name must not push the controls out of the panel. */
.intercom > * { width: 100%; min-width: 0; }
/* On a narrower desk monitor the floor table scrolls rather than clips. */
.wide-panel { overflow-x: auto; }

.announce-events { border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem 0.8rem 0.1rem; margin: 0 0 0.8rem; }
.announce-events legend { font-size: 0.75rem; color: var(--text-dim); padding: 0 0.3rem; }
#announce-form .primary { margin-top: 0.4rem; width: 100%; }

.tone-row { margin: 0.2rem 0 0.6rem; }
.tone-pick { display: flex; gap: 0.4rem; }
.tone-pick select { flex: 1; }
.custom-sound { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin: 0 0 0.2rem; }
.upload-btn {
  display: inline-block; cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 0.35rem 0.7rem;
}
.upload-btn:hover { border-color: var(--brand); }

/* Seven settings tabs: keep each label on one line and let the row wrap. */
.settings-tabs { flex-wrap: wrap; }
.tab { white-space: nowrap; }

.update-bar {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  padding: 0.5rem 1rem; font-weight: 600;
  background: var(--surface-2); border-bottom: 2px solid var(--brand);
}
.update-bar .primary { padding: 0.3rem 1rem; }

/* ---- About ------------------------------------------------------------------ */
.about { text-align: center; padding: 1rem 0 0.5rem; }
.about-name { margin: 0; font-size: 2rem; font-weight: 800; letter-spacing: 0.02em; }
.about-descriptor { margin: 0.2rem 0 1.2rem; color: var(--text-dim); }
.about-facts { display: grid; grid-template-columns: auto auto; justify-content: center; gap: 0.3rem 1rem; margin: 0 0 1.2rem; font-size: 0.9rem; }
.about-facts dt { color: var(--text-dim); text-align: right; }
.about-facts dd { margin: 0; text-align: left; font-family: var(--mono); }
.about-facts a { color: var(--brand); font-family: var(--font); }
.about-dedication { margin: 1rem auto 0; max-width: 34rem; padding: 1rem 1.2rem; border-left: 3px solid var(--brand); background: var(--surface-2); border-radius: 6px; font-style: italic; line-height: 1.5; }

.demo-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.45rem 1rem; font-size: 0.9rem;
  background: var(--surface-2); border-bottom: 2px solid var(--due-soon);
}
.demo-actions { display: flex; gap: 0.6rem; align-items: center; }
.demo-actions .primary { padding: 0.3rem 0.9rem; border-radius: 8px; text-decoration: none; font-weight: 700; }
