/* Screen-only theme. Physical labels and print rules stay in style.css. */
:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #14171c;
  background: #f8f9fb;
  --green: #175bea;
  --muted: #596372;
  --line: #dfe4ec;
  --blue: #175bea;
}
:root[data-text-size="small"] {
  font-size: 14px;
}
:root[data-text-size="large"] {
  font-size: 18px;
}
body {
  -webkit-font-smoothing: antialiased;
}
aside {
  background: #fff;
  color: #14171c;
  border-right: 1px solid var(--line);
  padding: 32px 20px;
}
.brand {
  letter-spacing: -0.3px;
}
.brand small {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 2px;
}
.brandmark {
  background: var(--blue);
  color: #fff;
  border-radius: 6px;
  font-weight: 500;
}
.nav-caption {
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 1.1px;
}
nav a {
  color: #363e49;
  font-size: 0.9rem;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 12px;
}
nav a:hover {
  background: #f6f8fc;
  color: var(--blue);
}
nav .selected {
  color: var(--blue);
  background: #edf3ff;
  border-color: #d9e5ff;
}
.aside-bottom,
.aside-bottom small {
  color: var(--muted);
}
.aside-bottom {
  font-size: 0.8rem;
}
.aside-bottom small {
  font-size: 0.7rem;
}
.dot {
  background: var(--blue);
}
.topbar {
  color: var(--muted);
  font-size: 0.8rem;
}
.local-pill {
  color: var(--blue);
  background: #edf3ff;
  font-size: 0.7rem;
  border-radius: 5px;
}
h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.8px;
}
h2 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.25px;
}
h3 {
  font-size: 0.95rem;
}
p,
.page-heading p {
  color: #414a57;
  font-size: 1rem;
  line-height: 1.65;
}
.eyebrow,
.step {
  color: var(--blue);
  font-size: 0.68rem;
  letter-spacing: 1.2px;
}
button,
.button {
  font-size: 0.875rem;
  border-radius: 6px;
  font-weight: 550;
}
.primary {
  background: var(--blue);
  color: white;
}
.primary:hover {
  background: #124bc7;
}
.secondary {
  background: #fff;
  color: var(--blue);
  border-color: #d5dfef;
}
.secondary:hover {
  background: #edf3ff;
}
.link {
  font-size: 0.8rem;
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.panel,
.stats > div {
  border-radius: 8px;
  border-color: var(--line);
  box-shadow: none;
}
.stats > div:last-child {
  background: #fff;
}
.stats > div {
  border-top: 2px solid #b8cefa;
}
.stats span {
  color: #414a57;
  font-size: 0.8rem;
}
.stats strong {
  color: #14171c;
  font-size: 2.25rem;
  font-weight: 500;
  letter-spacing: -1px;
}
.stats small {
  color: var(--muted);
  font-size: 0.72rem;
}
table {
  font-size: 0.875rem;
}
th {
  color: #525e70;
  background: #f8f9fc;
  font-size: 0.68rem;
  letter-spacing: 0.5px;
}
td {
  border-color: var(--line);
}
td small {
  color: var(--muted);
  font-size: 0.75rem;
}
.code,
.back,
.qr-destination a {
  color: var(--blue);
}
.back {
  font-size: 0.875rem;
}
.badge,
.badge.ready {
  background: #edf3ff;
  color: #174fb8;
  font-size: 0.72rem;
  border-radius: 5px;
}
.badge.waiting {
  background: #fff5e6;
  color: #7e520a;
}
.badge.done {
  background: #f0f2f5;
  color: #525e70;
}
label {
  color: #232831;
  font-size: 0.875rem;
}
input,
textarea,
select {
  color: #14171c;
  background: #fff;
  border-color: #cdd5e0;
  font-size: 1rem;
  border-radius: 5px;
}
input::placeholder,
textarea::placeholder {
  color: #697586;
  opacity: 1;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px #175bea14;
}
.required {
  color: var(--blue);
}
.hint,
.muted {
  color: var(--muted);
  font-size: 0.8rem;
}
.form-panel small {
  color: var(--muted);
  font-size: 0.75rem;
}
.error {
  color: #b42d2d;
  font-size: 0.875rem;
}
.note-card,
.address,
.parts-totals > div {
  background: #f2f6fd;
  border-radius: 6px;
}
.note-card,
.note-card p,
.address {
  font-size: 0.875rem;
}
.timeline > div {
  border-color: #ccdafa;
  border-width: 1px;
  font-size: 0.875rem;
}
.read-grid dt {
  color: var(--muted);
  font-size: 0.8rem;
}
.read-grid dd {
  font-size: 1rem;
}
.parts-totals span {
  font-size: 0.875rem;
}
.parts-totals strong {
  font-size: 1.5rem;
}
.empty-icon {
  color: var(--blue);
}
footer {
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.6px;
}
.login-wrap {
  background: #f8f9fb;
}
.login-brand {
  color: #14171c;
}
.login-brand span {
  color: var(--blue);
}
.login-card {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 2px solid var(--blue);
  border-radius: 8px;
  max-width: 480px;
}
.login-card h1 {
  font-size: 2rem;
}
.login-card small {
  color: var(--muted);
  font-size: 0.75rem;
}
#toast {
  background: #17263f;
  font-size: 0.875rem;
  border-radius: 6px;
}
.search-examples button,
.print-instructions li {
  font-size: 0.875rem;
}
.print-instructions li,
.dimension,
.qr-destination small {
  color: var(--muted);
}
.preview-area {
  background: #f0f3f8;
}
.text-size-control {
  max-width: 340px;
}
.workday-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.workday-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.workday-title h2 {
  margin: 0;
}
.workday-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
}
.workday-list a:hover strong {
  text-decoration: underline;
}
.workday-list a div {
  min-width: 0;
}
.workday-list strong {
  color: var(--blue);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}
.workday-list span {
  display: block;
  font-size: 0.875rem;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.workday-list small {
  flex-shrink: 0;
  text-align: right;
}
.workday-empty {
  padding: 16px 0;
  margin: 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}
@media (max-width: 1100px) {
  .workday-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
@media (max-width: 760px) {
  aside {
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  nav {
    justify-content: flex-start;
    gap: 5px;
  }
  nav a {
    font-size: 0.8rem;
    padding: 9px;
  }
  .brand {
    font-size: 0.875rem;
  }
  h1 {
    font-size: 1.8rem;
  }
  .stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .stats > div {
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .stats strong {
    margin: 0;
    font-size: 1.75rem;
  }
  .stats span {
    font-size: 0.875rem;
  }
  .filters select {
    font-size: 0.875rem;
  }
  .panel-title h2 {
    font-size: 1rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .workday-list a {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .workday-list small {
    text-align: left;
  }
  .topbar {
    font-size: 0.7rem;
  }
  footer {
    font-size: 0.6rem;
  }
}
.history-entry {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.history-entry:last-child {
  border-bottom: 0;
}
#payment-form,
#checks-form,
#backup-now {
  margin-top: 22px;
}
#payment-form button,
#checks-form button,
#order-form > button,
#receive-order button,
#backup-config button {
  margin-top: 16px;
  margin-right: 8px;
}
.order-line {
  padding: 22px 0;
  border-block: 1px solid var(--line);
  margin-bottom: 16px;
}
#receive-order input {
  min-width: 90px;
  max-width: 130px;
}
.checks-read {
  display: grid;
  gap: 12px;
}
.checks-read > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
#backup-tools dd {
  margin: 6px 0 18px;
}
@media (min-width: 761px) {
  aside {
    overflow-y: auto;
  }
  .nav-caption {
    margin-top: 30px;
  }
}
#checks-form > label,
#order-form > label {
  margin-top: 20px;
}
.intake-notes {
  margin-top: 20px;
}
.preserve-lines {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#repair button[name="action"] {
  margin-top: 12px;
}
.receipt-preview {
  width: 100%;
  height: 850px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f6fa;
}
@media (max-width: 760px) {
  .receipt-preview {
    height: 520px;
  }
}

/* Accessi V2: campi separati e checkbox senza dimensioni dei campi di testo. */
.access-form {
  display: grid;
  gap: 14px;
}
.access-form .access-active {
  display: flex;
  align-items: center;
  gap: 10px;
}
.access-form .access-active input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 0;
}

.draft-panel .access-active {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.draft-panel .access-active input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  flex-shrink: 0;
  margin: 0;
}
.draft-panel [data-candidates] button {
  margin: 10px 0;
}

.invoice-line {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.invoice-consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 20px 0;
}
.invoice-consent input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 2px 0;
  flex-shrink: 0;
}
#invoice-upload button {
  margin-top: 16px;
}

.development-update-notice {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 10000;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid #2563eb;
  border-radius: 12px;
  background: #eff6ff;
  color: #172554;
  box-shadow: 0 4px 20px #0002;
}

/* Fit every application table to its container, including narrow phone screens. */
main,
.panel,
.table-scroll {
  min-width: 0;
}
.table-scroll {
  max-width: 100%;
  overflow-x: visible;
}
table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  white-space: normal;
}
th,
td {
  overflow-wrap: anywhere;
  white-space: normal;
  padding: 14px clamp(4px, 1vw, 14px);
  vertical-align: top;
}
table :is(a, .code, .badge, button, input, select, textarea) {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
table :is(input, select, textarea) {
  width: 100%;
}
@media (max-width: 760px) {
  th,
  td {
    padding: 10px 4px;
  }
  th {
    letter-spacing: 0;
  }
  td .badge,
  td button,
  td .button {
    padding: 6px 3px;
  }
}

/* Numeric columns have a bounded width; descriptions share the remaining space. */
.inventory-table .part-description {
  width: auto;
}
.inventory-table .part-compatibility {
  width: 30%;
}
.inventory-table .part-availability {
  width: 136px;
}
.inventory-table .part-cost {
  width: 108px;
}
.inventory-table .part-actions {
  width: 100px;
}
.inventory-table .availability-heading {
  white-space: nowrap;
  letter-spacing: 0;
}
.availability-short {
  display: none;
}
.table-scroll {
  container-type: inline-size;
}
@container (max-width: 700px) {
  .responsive-table,
  .responsive-table tbody {
    display: block;
    width: 100%;
  }
  .responsive-table colgroup {
    display: none;
  }
  .responsive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .responsive-table tbody tr {
    display: block;
    padding: 12px;
    margin: 0 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  .responsive-table tbody td {
    display: grid;
    grid-template-columns: minmax(100px, 34%) minmax(0, 1fr);
    gap: 4px 12px;
    padding: 8px 0;
    border: 0;
    font-size: 14px;
    line-height: 1.45;
  }
  .responsive-table tbody td::before {
    content: attr(data-column);
    grid-column: 1;
    grid-row: 1;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    overflow-wrap: normal;
  }
  .responsive-table tbody td > * {
    grid-column: 2;
  }
  .responsive-table tbody td > small {
    margin: 0;
  }
  .responsive-table :is(.badge, button, .button) {
    width: fit-content;
    padding: 6px 8px;
  }
}
@media (max-width: 600px) {
  .filters select { flex: 1 1 100%; width: 100%; }
}
