:root {
  color-scheme: light;
  --ink: #12211f;
  --muted: #60716d;
  --line: #d9e4e0;
  --paper: #ffffff;
  --soft: #eef7f4;
  --brand: #0f766e;
  --brand-dark: #0b544f;
  --warn: #b45309;
  --bad: #b91c1c;
  --shadow: 0 12px 30px rgba(20, 45, 40, 0.12);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: #f7faf9;
  color: var(--ink);
}

body.auth-open {
  overflow: hidden;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 15% 12%, rgba(64, 189, 170, 0.24), transparent 30%),
    radial-gradient(circle at 88% 88%, rgba(45, 116, 130, 0.25), transparent 32%),
    linear-gradient(145deg, #073f3c, #102f38 62%, #142b35);
}

.auth-card {
  width: min(460px, 100%);
  padding: clamp(24px, 5vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 26px 70px rgba(0, 20, 24, 0.35);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.auth-brand img {
  width: 142px;
  max-height: 54px;
  object-fit: contain;
}

.auth-brand p {
  margin: 0;
  color: var(--brand-dark);
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.auth-heading h1 {
  margin: 5px 0 8px;
  font-size: clamp(1.8rem, 7vw, 2.35rem);
}

.auth-heading p {
  margin: 0 0 24px;
  color: var(--muted);
}

.auth-kicker {
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.login-form {
  display: grid;
  gap: 15px;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 68px;
}

.password-toggle {
  position: absolute;
  top: 5px;
  right: 5px;
  min-height: 34px;
  padding: 0 12px;
  color: var(--brand-dark);
  background: var(--soft);
  font-size: 0.78rem;
}

.context-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.context-choice legend {
  grid-column: 1 / -1;
  margin-bottom: 6px;
  color: #29433f;
  font-size: 0.88rem;
  font-weight: 700;
}

.context-choice label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid #bed0cb;
  border-radius: 8px;
  background: #f7faf9;
  cursor: pointer;
}

.context-choice label:has(input:checked) {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--soft);
}

.context-choice input {
  width: auto;
  min-height: auto;
  margin: 0 8px 0 0;
  accent-color: var(--brand);
}

.login-submit {
  margin-top: 2px;
  min-height: 50px;
}

.login-error {
  min-height: 19px;
  margin: -5px 0 0;
  color: var(--bad);
  font-size: 0.86rem;
  font-weight: 700;
}

.record-tools{display:grid;grid-template-columns:minmax(230px,1fr) minmax(260px,1.4fr) auto auto;gap:10px;align-items:center;margin:0 0 18px;padding:15px;border:1px solid #9fc5c8;border-radius:12px;background:#eef8f7}.record-tools>div:first-child{display:grid;gap:3px}.record-tools small{color:var(--muted)}.record-tools input{min-height:42px}.record-completion{padding:7px 10px;border-radius:999px;background:#dde7e8;color:#40585c;font-size:.78rem;font-weight:800;white-space:nowrap}.record-completion.complete{background:#d9f2e8;color:#08725b}.record-completion.incomplete{background:#ffe5df;color:#a33427}.record-results{grid-column:1/-1;display:grid;gap:7px;max-height:300px;overflow:auto}.record-result{display:grid;grid-template-columns:145px 1fr auto auto;gap:10px;align-items:center;padding:9px 11px;border:1px solid var(--line);border-radius:8px;background:#fff}.record-result span{display:grid;font-size:.82rem}.record-result small{color:var(--muted)}.record-empty{padding:10px;color:var(--muted);text-align:center}@media(max-width:760px){.record-tools{grid-template-columns:1fr}.record-results{grid-column:1}.record-result{grid-template-columns:1fr}.record-result button{width:100%}}

.demo-access {
  margin: 22px 0 0;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

.demo-access code {
  color: var(--brand-dark);
}

.main-menu {
  min-height: 100vh;
  background:
    radial-gradient(circle at 100% 0, rgba(15, 118, 110, 0.12), transparent 34%),
    #f4f8f7;
}

.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px max(20px, calc((100% - 1160px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 18px rgba(17, 45, 40, 0.07);
}

.menu-brand,
.menu-account {
  display: flex;
  align-items: center;
  gap: 13px;
}

.menu-brand img {
  width: 125px;
  max-height: 48px;
  object-fit: contain;
}

.menu-brand div,
.menu-account div {
  display: grid;
}

.menu-brand span,
.menu-account span {
  color: var(--muted);
  font-size: 0.72rem;
}

.menu-brand strong {
  color: var(--brand-dark);
  font-size: 0.9rem;
}

.menu-account div {
  justify-items: end;
  margin-right: 4px;
}

.menu-account-btn,
.back-menu-btn {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #b9cec8;
  color: var(--brand-dark);
  background: #fff;
  font-size: 0.78rem;
}

.menu-shell {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: clamp(34px, 6vw, 70px) 20px 70px;
}

.menu-intro {
  margin-bottom: 28px;
}

.menu-intro h1 {
  margin: 5px 0 7px;
  font-size: clamp(1.8rem, 4vw, 2.65rem);
  letter-spacing: -0.035em;
}

.menu-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.database-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.module-card {
  position: relative;
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 17px;
  min-height: 112px;
  overflow: hidden;
  padding: 19px 22px;
  border: 1px solid #d5e2de;
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 8px 22px rgba(22, 55, 49, 0.07);
  text-align: left;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.module-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--module-color, var(--brand));
  content: "";
}

.module-card:hover,
.module-card:focus-visible {
  border-color: var(--module-color, var(--brand));
  box-shadow: 0 14px 30px rgba(22, 55, 49, 0.13);
  transform: translateY(-2px);
}

.module-card > span:nth-child(2) {
  display: grid;
  gap: 5px;
}

.module-card strong {
  font-size: 1.05rem;
}

.module-card small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.module-card b {
  color: var(--module-color, var(--brand));
  font-size: 1.35rem;
}

.module-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 13px;
  color: #fff;
  background: var(--module-color, var(--brand));
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.module-users { --module-color: #2563a6; }
.module-rooms { --module-color: #0f766e; }
.module-equipment { --module-color: #447a39; }
.module-database { --module-color: #7552a3; }
.module-gases { --module-color: #176b5c; }
.module-protocols { --module-color: #b16a17; }
.module-reports { --module-color: #27758b; }
.module-results { --module-color: #9b3f67; }
.module-videos { --module-color: #596273; }

.module-view {
  min-height: calc(100vh - 77px);
}

.back-menu-btn {
  margin-bottom: 22px;
}

.module-placeholder {
  display: grid;
  justify-items: center;
  min-height: 410px;
  padding: 60px 25px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.module-placeholder h1 {
  margin: 20px 0 8px;
}

.module-placeholder p {
  max-width: 530px;
  margin: 0;
  color: var(--muted);
}

.placeholder-status {
  margin-top: 28px;
  padding: 10px 15px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: var(--soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.placeholder-status span {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: #22a06b;
}

.manager-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.manager-heading h1 {
  margin: 5px 0 6px;
}

.manager-heading p {
  margin: 0;
  color: var(--muted);
}

.user-form {
  margin-bottom: 22px;
  padding: 22px;
  border: 1px solid #bcd5cf;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.user-form-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.user-form-title h2 {
  margin: 0;
}

.form-close {
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  color: var(--muted);
  background: #edf3f1;
  font-size: 1.5rem;
}

.user-enabled {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
}

.user-enabled input {
  width: 19px;
  min-height: 19px;
  accent-color: var(--brand);
}

.user-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.users-list {
  display: grid;
  gap: 11px;
}

.user-row {
  display: grid;
  grid-template-columns: 48px minmax(150px, 1fr) auto auto;
  align-items: center;
  gap: 15px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(22, 55, 49, 0.05);
}

.user-row.user-disabled {
  background: #f5f6f6;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--brand), #2a6872);
  font-size: 0.78rem;
  font-weight: 900;
}

.user-disabled .user-avatar {
  filter: grayscale(1);
  opacity: 0.65;
}

.user-data {
  display: grid;
  gap: 4px;
}

.user-data span {
  color: var(--muted);
  font-size: 0.78rem;
}

.user-status {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.user-status.active {
  color: #176243;
  background: #e1f5ea;
}

.user-status.inactive {
  color: #6b7371;
  background: #e8eceb;
}

.user-actions {
  display: flex;
  gap: 7px;
}

.user-actions button {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.72rem;
}

.context-panel {
  width: min(620px, 100%);
  margin: 25px auto 0;
  padding: clamp(25px, 5vw, 44px);
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow);
}

.context-panel h1 {
  margin: 7px 0 8px;
}

.context-panel > p:not(.login-error) {
  margin: 0 0 24px;
  color: var(--muted);
}

.context-panel > button {
  width: 100%;
  margin-top: 4px;
}

.results-manager {
  width: min(1500px, 100%);
}

.results-heading {
  align-items: center;
}

.results-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.results-toolbar label {
  width: min(520px, 100%);
}

.results-count {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: var(--soft);
  font-size: 0.8rem;
  font-weight: 800;
}

.results-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(22, 55, 49, 0.06);
}

.results-table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
}

.results-table th,
.results-table td {
  padding: 12px 10px;
  border-right: 1px solid #dce7e4;
  border-bottom: 1px solid #dce7e4;
  text-align: left;
  vertical-align: middle;
}

.results-table th:last-child,
.results-table td:last-child {
  border-right: 0;
}

.results-table tbody tr:last-child td {
  border-bottom: 0;
}

.results-table th {
  color: #31504a;
  background: #edf6f4;
  font-size: 0.74rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.results-table td {
  min-width: 126px;
  font-size: 0.84rem;
}

.results-table td:first-child,
.results-table td:nth-child(3) {
  min-width: 165px;
}

.results-table td:nth-child(8) {
  min-width: 220px;
}

.results-table td small,
.results-table td strong {
  display: block;
}

.results-table td small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.results-table textarea {
  min-height: 40px;
  padding: 8px;
  font-size: 0.8rem;
}

.results-table textarea {
  min-width: 200px;
  resize: vertical;
}

.results-actions {
  display: grid;
  gap: 7px;
  min-width: 178px;
}

.results-actions button {
  min-height: 36px;
  padding: 6px 9px;
  font-size: 0.72rem;
}

.result-status {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid #b7cfd0;
  border-radius: 8px;
  color: #1c3d43;
  background: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
}

.result-status.status-terminado {
  border-color: #0c766b;
  color: #075f56;
  background: #dff5ee;
}

.result-status.status-pendiente {
  border-color: #e0a200;
  color: #4a3a00;
  background: #ffd15a;
}

.result-room-menu {
  display: grid;
  gap: 5px;
}

.result-room-toggle {
  position: relative;
}

.result-room-toggle::after {
  content: "▼";
  margin-left: 5px;
  font-size: 0.68em;
}

.result-room-options {
  display: grid;
  gap: 5px;
  padding: 6px;
  border: 1px solid #bdd3d3;
  border-radius: 8px;
  background: #eef7f5;
}

.result-room-options[hidden] {
  display: none;
}

.result-delete {
  background: #a33427;
}

.results-loading,
.results-empty {
  padding: 34px !important;
  color: var(--muted);
  text-align: center !important;
}

.results-empty {
  margin-top: 12px;
  border: 1px dashed #b9cec8;
  border-radius: 12px;
  background: #f8fbfa;
}

.results-history-note {
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: 0.78rem;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(135deg, #0f766e, #25636a);
  box-shadow: var(--shadow);
}

.app-header h1 {
  margin: 0;
  font-size: clamp(1.1rem, 4.6vw, 1.7rem);
  line-height: 1.12;
}

.header-session {
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-summary {
  display: grid;
  justify-items: end;
  min-width: 130px;
}

.session-summary strong {
  max-width: 240px;
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-summary span {
  font-size: 0.72rem;
  opacity: 0.8;
}

.session-button {
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  color: #fff;
  background: rgba(0, 0, 0, 0.13);
  font-size: 0.74rem;
}

.eyebrow {
  margin: 0 0 3px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.86;
}

.version {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  padding: 6px 8px;
  font-weight: 700;
}

.app-shell {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 14px 12px 80px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(92px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
}

.tab,
button {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--brand);
  font-weight: 700;
  cursor: pointer;
}

.tab {
  color: var(--brand-dark);
  background: #e2f1ee;
}

.tab.active {
  color: #fff;
  background: var(--brand);
}

.panel {
  display: none;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 4px 18px rgba(30, 48, 44, 0.06);
}

.panel.active {
  display: block;
}

.section-title {
  margin-bottom: 14px;
}

.section-title h2 {
  margin: 0 0 4px;
  font-size: 1.22rem;
}

.section-title p {
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.spacing-top {
  margin-top: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #29433f;
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #bed0cb;
  border-radius: 7px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
}

input:disabled {
  color: #304a45;
  background: #eef3f1;
  opacity: 1;
}

textarea {
  resize: vertical;
}

.full {
  margin-top: 12px;
}

.checklist,
.instrument-list,
.tests {
  display: grid;
  gap: 12px;
}

.check-row,
.instrument-row,
.test-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfc;
}

.check-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
}

.check-row textarea {
  grid-column: 1 / -1;
  min-height: 66px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  font-weight: 700;
  color: var(--muted);
}

.switch input,
.flow-options input,
.instrument-row input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--brand);
}

.test-block h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.criterion {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.table {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.table-row {
  display: grid;
  grid-template-columns: 0.7fr 1fr 1fr 1fr 42px;
  gap: 8px;
}

.filter-speed-table {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.filter-speed-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.filter-speed-main {
  display: grid;
  grid-template-columns: 0.7fr 1.2fr 0.8fr 1fr 42px;
  gap: 8px;
  align-items: center;
}

.filter-speed-row input[readonly],
.filter-average {
  background: #eef3f1;
}

.filter-average {
  min-height: 44px;
  margin: 0;
  display: grid;
  place-items: center start;
}

.filter-readings {
  display: grid;
  grid-template-columns: repeat(5, minmax(76px, 1fr));
  gap: 8px;
}

.add-filter-reading {
  justify-self: start;
  min-height: 38px;
  padding-inline: 12px;
}

.readings {
  display: grid;
  grid-template-columns: repeat(5, minmax(76px, 1fr));
  gap: 8px;
}

.calculated-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.calculated-grid div {
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #fff;
}

.calculated-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

output {
  display: block;
  margin-top: 10px;
  padding: 10px;
  border-radius: 7px;
  color: var(--brand-dark);
  background: var(--soft);
  font-weight: 800;
}

.ghost {
  border: 1px solid #9fc7bf;
  color: var(--brand-dark);
  background: #fff;
}

.danger {
  min-height: 42px;
  color: #fff;
  background: var(--bad);
}

.flow-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.instrument-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}

.instrument-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 500;
}

.instrument-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.wide-panel {
  width: min(1180px, 100%);
}

.instrument-db-row {
  grid-template-columns: .8fr 1.35fr .8fr .8fr .8fr .9fr 1.1fr 1fr auto;
  align-items: end;
}

.instrument-db-row label {
  font-size: .78rem;
}

.instrument-db-row input:not([type="checkbox"]):not([type="file"]) {
  width: 100%;
  min-height: 38px;
  padding: 8px;
}

.instrument-db-row input[type="file"] {
  width: 100%;
  min-height: 38px;
}

.instrument-use {
  align-content: center;
  justify-items: center;
}

.certificate-name {
  align-self: center;
}

.certificate-list {
  display: grid;
  gap: 8px;
  padding-left: 18px;
}

.certificate-embed {
  break-inside: avoid;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid #aebfc1;
  background: #fff;
}

.certificate-embed h4 {
  margin: 0 0 8px;
}

.pdf-embed {
  width: 100%;
  height: 235mm;
  border: 1px solid #7d8f91;
  background: #f8f8f8;
}

.instrument-select-row {
  grid-template-columns: auto 1fr;
}

.photo-picker {
  padding: 12px;
  border: 1px dashed #9fc7bf;
  border-radius: 8px;
  background: var(--soft);
}

.photo-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.photo-item {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.photo-item button {
  position: absolute;
  top: 6px;
  right: 6px;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid rgba(122, 35, 35, .35);
  background: rgba(122, 35, 35, .92);
  color: #fff;
}

.photo-item input {
  min-height: 36px;
  padding: 8px;
  font-size: .85rem;
}

.photo-preview img,
.photo-preview figure img {
  width: 100%;
  aspect-ratio: 1.25;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--line);
}

.photo-preview figure {
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.photo-preview figcaption {
  margin-top: 6px;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 750;
}

.ticket-preview img,
.ticket-image {
  width: min(100%, 420px);
  max-height: 520px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.ticket-preview {
  margin-top: 10px;
}

.signature-box {
  margin-top: 14px;
}

#signaturePad {
  width: 100%;
  height: 190px;
  border: 2px dashed #9fc7bf;
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}

.signature-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.actions button {
  flex: 1 1 140px;
}

.report {
  display: none;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report.visible {
  display: block;
}

.report-page {
  padding: 20px;
}

.report-header {
  display: grid;
  grid-template-columns: 150px 1fr 150px;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 14px;
  border: 1px solid #9eb2ad;
}

.qualing-logo,
.report-number {
  display: grid;
  place-items: center;
  padding: 10px;
  text-align: center;
}

.qualing-logo {
  background: #fff;
}

.qualing-logo img {
  width: 100%;
  max-width: 128px;
  max-height: 58px;
  object-fit: contain;
}

.report-header h2 {
  margin: 8px 0 3px;
}

.report-header p {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 700;
}

.report-number {
  border-left: 1px solid #9eb2ad;
}

.report-number span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.report h2,
.report h3 {
  margin: 0 0 10px;
}

.report table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 16px;
}

.report th,
.report td {
  border: 1px solid #b8c8c4;
  padding: 7px;
  text-align: left;
  vertical-align: top;
}

.report .signature-image {
  max-width: 280px;
  min-height: 80px;
  border-bottom: 1px solid #222;
}

.status-pass {
  color: var(--brand-dark);
  font-weight: 800;
}

.status-fail {
  color: var(--bad);
  font-weight: 800;
}

.status-warn {
  color: var(--warn);
  font-weight: 800;
}

@media (max-width: 760px) {
  .menu-header {
    align-items: flex-start;
    padding: 12px 14px;
  }

  .menu-brand div,
  .menu-account div {
    display: none;
  }

  .menu-brand img {
    width: 104px;
  }

  .menu-account {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .menu-account-btn {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 0.68rem;
  }

  .menu-shell {
    padding: 32px 14px 50px;
  }

  .module-grid {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .database-options {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .module-card {
    grid-template-columns: 49px 1fr auto;
    gap: 13px;
    min-height: 91px;
    padding: 14px 16px;
  }

  .module-icon {
    width: 49px;
    height: 49px;
    border-radius: 11px;
  }

  .manager-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .manager-heading > button {
    width: 100%;
  }

  .results-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .user-form {
    padding: 17px;
  }

  .user-row {
    grid-template-columns: 42px 1fr auto;
    gap: 11px;
  }

  .user-avatar {
    width: 42px;
    height: 42px;
  }

  .user-status {
    grid-column: 3;
    grid-row: 1;
  }

  .user-actions {
    grid-column: 1 / -1;
  }

  .user-actions button {
    flex: 1;
  }

  .app-header {
    align-items: flex-start;
  }

  .header-session {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 52%;
  }

  .session-summary {
    width: 100%;
  }

  .session-summary strong {
    max-width: 100%;
  }

  .version {
    display: none;
  }

  .app-shell {
    padding-inline: 8px;
  }

  .panel {
    padding: 12px;
  }

  .grid,
  .grid.compact,
  .flow-options,
  .calculated-grid {
    grid-template-columns: 1fr;
  }

  .check-row {
    grid-template-columns: 1fr 86px 86px;
  }

  .table-row {
    grid-template-columns: 1fr 1fr;
  }

  .filter-speed-main {
    grid-template-columns: 1fr 1fr;
  }

  .table-row button,
  .filter-speed-main button,
  .add-filter-reading {
    grid-column: 1 / -1;
  }

  .readings,
  .filter-readings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-preview {
    grid-template-columns: repeat(2, 1fr);
  }

  .report-header {
    grid-template-columns: 1fr;
  }

  .report-number {
    border-left: 0;
    border-top: 1px solid #9eb2ad;
  }
}

@media print {
  body {
    background: #fff;
  }

  .auth-screen,
  .app-header,
  .tabs,
  form,
  .actions,
  .signature-actions {
    display: none !important;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .report {
    display: block !important;
    border: 0;
  }

  .report-page {
    break-after: page;
    padding: 12mm;
  }

  .report-header {
    grid-template-columns: 34mm 1fr 34mm;
  }
}
.applicability-controls{display:grid;grid-template-columns:auto minmax(180px,1fr) minmax(220px,1.25fr);gap:.65rem;align-items:stretch;margin:.7rem 0 1rem;padding:.7rem;border:1px solid #c9dadd;border-radius:10px;background:#f6f9f9}.applicability-title{align-self:center;color:#50696d;font-size:.75rem;font-weight:850;letter-spacing:.04em;text-transform:uppercase}.applicability-option{display:flex!important;align-items:center;gap:.65rem;min-height:54px;padding:.55rem .7rem;border:1px solid #c6d4d6;border-radius:8px;background:#fff;cursor:pointer}.applicability-option input{width:21px!important;min-width:21px;min-height:21px;margin:0;accent-color:#117b78}.applicability-option span{display:grid;gap:.1rem}.applicability-option strong{font-size:.85rem}.applicability-option small{color:#72878a;font-size:.7rem;font-weight:600}.option-info{color:#1479c9}.option-info input{accent-color:#1479c9}.test-block.is-na{opacity:.76}.test-block.is-na output{color:#667}.test-block.is-informative{border-color:#1479c9}.test-block.is-informative output,.test-block.is-informative .criterion{color:#1479c9}.check-row.is-na{background:#f1f4f5}@media(max-width:720px){.applicability-controls{grid-template-columns:1fr}.applicability-title{padding:.1rem .2rem}}
.status-info{color:#1479c9!important;font-weight:800}
.parallelism-grid{display:grid;grid-template-columns:.55fr 1fr 1fr 1fr 1.25fr;gap:.6rem;align-items:center;margin:1rem 0}.parallelism-grid input{min-width:0}.parallelism-grid output{margin:0;text-align:center}@media(max-width:720px){.parallelism-grid{grid-template-columns:.5fr repeat(4,minmax(75px,1fr));overflow-x:auto}}
.parallelism-head,.parallelism-row{display:grid;grid-template-columns:.5fr 1fr 1fr 1fr 1.25fr 42px;gap:.6rem;align-items:center}.parallelism-head{margin-top:1rem;padding:.45rem .6rem;color:#516a6e;font-size:.75rem;text-transform:uppercase}.parallelism-rows{display:grid;gap:.55rem;margin-bottom:.75rem}.parallelism-row{padding:.65rem;border:1px solid #d5e1e2;border-radius:9px;background:#fff}.parallelism-row input{min-width:0}.parallelism-row output{margin:0;text-align:center}.remove-parallelism{min-height:38px;padding:0;color:#a83b31;background:#fff;border:1px solid #dfb1ac}@media(max-width:720px){.parallelism-head,.parallelism-row{grid-template-columns:45px repeat(4,minmax(78px,1fr)) 42px;min-width:620px}.parallelism-rows,.parallelism-head{overflow-x:auto}}
@media print{.record-tools{display:none!important}}
.certificate-embed{break-inside:avoid;margin:14px 0;padding:10px;border:1px solid #8ea3a6;background:#fff}.certificate-embed h4{margin:0 0 8px;padding-bottom:6px;border-bottom:1px solid #d5e0e2;color:#173337;font-size:10pt}.pdf-render-target{display:grid;gap:8px}.pdf-render-status{margin:0;padding:8px;border:1px dashed #9fb8bb;color:#50696d;background:#f6f9f9;font-weight:700}.pdf-fallback.is-rendered{display:none}.pdf-page-image{break-inside:avoid;margin:0 0 10px;padding:7px;border:1px solid #aebfc1;background:#fff}.pdf-page-image figcaption{margin:0 0 6px;color:#173337;font-size:8pt;font-weight:800;text-align:center}.pdf-page-image img{display:block;width:100%;max-height:255mm;object-fit:contain}@media print{.certificate-embed{break-after:page}.certificate-embed:last-child{break-after:auto}.pdf-render-status{display:none!important}.pdf-fallback{display:none!important}.pdf-page-image{page-break-inside:avoid}.pdf-page-image:not(:last-child){break-after:page}}
.certificate-image-page{break-inside:avoid;margin:0 0 10px;padding:7px;border:1px solid #aebfc1;background:#fff}.certificate-image-page figcaption{margin:0 0 6px;color:#173337;font-size:8pt;font-weight:800;text-align:center}.certificate-image-page img{display:block;width:100%;max-height:255mm;object-fit:contain}@media print{.certificate-image-page{page-break-inside:avoid}.certificate-image-page:not(:last-child){break-after:page}}
