.scanner-input {
  display: flex;
  align-items: end;
  gap: 12px;
  max-width: 720px;
}
.scanner-input .field {
  flex: 1;
  min-width: 0;
}
.scanner-summary {
  margin: 20px 0;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.7;
}
.scanner-tools {
  margin-bottom: 18px;
}
.scanner-results table {
  min-width: 650px;
}
.scanner-caption {
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}
.scanner-input input {
  font-family: ui-monospace, monospace;
}
.scanner-input .btn {
  flex-shrink: 0;
}
.device-register table {
  min-width: 1000px;
}
.device-register td:last-child {
  min-width: 260px;
}
.device-register .actions {
  flex-wrap: nowrap;
}
.field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  vertical-align: middle;
  accent-color: var(--accent);
}
:root {
  --accent: #6d36c5;
  --accent-dark: #542598;
  --tint: #f1eafa;
  --amber: #ff9800;
  --ink: #29272d;
  --muted: #625f68;
  --line: #dddbe1;
  --page: #ffffff;
  --green: #236c50;
  --red: #aa3346;
  font-family: "DM Sans", Arial, sans-serif;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--page);
}
.workspace {
  min-width: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
a {
  color: var(--accent);
  text-decoration: none;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
}
svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  line-height: 1.3;
  font-weight: 650;
  overflow-wrap: anywhere;
}
h2 {
  font-size: 18px;
  font-weight: 650;
}
h3 {
  font-size: 15px;
}
p {
  line-height: 1.65;
}
small,
.muted {
  color: var(--muted);
}
.skip {
  position: fixed;
  top: -60px;
  left: 10px;
  z-index: 1000;
  padding: 12px;
  background: white;
}
.skip:focus {
  top: 10px;
}
.loading {
  padding: 80px;
  text-align: center;
  color: var(--muted);
}
.shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: #f7f3fc;
  border-top: 5px solid var(--accent);
  border-right: 1px solid var(--line);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 30px 16px 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  padding: 0 10px;
}
.brand-symbol {
  display: grid;
  place-items: center;
  width: 32px;
  height: 36px;
  color: var(--accent);
  background: #ffe0b2;
  border-radius: 4px;
}
.brand-symbol svg {
  width: 25px;
  height: 25px;
}
.brand-name {
  font:
    700 21px "Libre Baskerville",
    Georgia,
    serif;
}
.workspace-label {
  font-size: 11px;
  color: var(--muted);
  padding: 12px 10px 32px;
}
.nav-group {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #797280;
  padding: 0 14px;
  margin: 10px 0;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: #635d6d;
  border-radius: 6px;
  margin: 4px 0;
  font-weight: 500;
  min-height: 44px;
}
.nav-link:hover {
  background: #f7f5fa;
}
.nav-link.active {
  color: white;
  background: var(--accent);
  font-weight: 650;
}
.nav-link[data-page="scanner"]:not(.active) {
  color: #513200;
  background: #ffe0b2;
}
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 20px 10px 0;
}
.account {
  display: flex;
  gap: 10px;
  align-items: center;
}
.avatar {
  background: #fff0d9;
  color: #8b4a00;
  border: 1px solid #f2d8af;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.account-info {
  min-width: 0;
  flex: 1;
}
.account-info strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.account-info small {
  font-size: 11px;
}
.icon-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
}
.icon-btn:hover {
  background: var(--tint);
  color: var(--accent);
}
.topbar {
  height: 76px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 0 38px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.breadcrumb svg {
  width: 13px;
  height: 13px;
}
.breadcrumb strong {
  color: var(--ink);
  font-weight: 500;
}
.top-right {
  display: flex;
  gap: 22px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
}
.search input {
  border: 0;
  background: transparent;
  width: 175px;
  padding: 8px;
  font-size: 12px;
}
.hospital-tag {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  max-width: 230px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.main {
  padding: 38px;
  max-width: 1480px;
  margin: 0 auto;
}
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 20px;
}
.page-heading p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 7px;
}
.eyebrow {
  font-size: 11px;
  color: var(--accent);
  font-weight: 650;
  margin-bottom: 12px;
}
.btn {
  border: 1px solid #bbb3c5;
  background: white;
  color: var(--ink);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: 5px;
  min-height: 40px;
  font-weight: 550;
  font-size: 12px;
}
.btn:hover {
  background: #f4f0f8;
}
.btn.primary {
  background: var(--amber);
  border-color: #e08500;
  color: #2c210d;
}
.btn.primary:hover {
  background: #ffb74d;
}
.btn.danger {
  color: var(--red);
  border-color: #d79ca5;
}
.btn.small {
  padding: 6px 10px;
  min-height: 32px;
  font-size: 11px;
}
.actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 17px;
  margin-top: 32px;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 0;
}
.section-title small {
  font-size: 11px;
}
.welcome-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 35px;
  align-items: center;
  padding: 3px 0 24px;
  border-bottom: 4px solid var(--amber);
}
.welcome-intro h1 {
  font-family: "Libre Baskerville", Georgia, serif;
  font-weight: 400;
  font-size: 31px;
}
.welcome-intro p {
  color: var(--muted);
  margin: 12px 0 22px;
  max-width: 520px;
}
.welcome-photo {
  width: 180px;
  height: 130px;
  object-fit: cover;
  border-radius: 0;
}
.welcome-date {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 15px;
}
.welcome-columns {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.list-row .list-icon {
  color: var(--accent);
  padding: 10px;
  background: var(--tint);
  border-radius: 5px;
  display: flex;
}
.list-row .grow {
  flex: 1;
  min-width: 0;
}
.list-row strong {
  font-weight: 550;
  display: block;
  overflow-wrap: anywhere;
}
.list-row small {
  display: block;
  margin-top: 4px;
}
.text-link {
  font-size: 12px;
  color: var(--accent);
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.quiet-footer {
  font-size: 11px;
  color: #797280;
  display: flex;
  gap: 7px;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 42px;
  padding-top: 18px;
}
.quiet-footer svg {
  width: 13px;
  height: 13px;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
}
.filter-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid #bdb5c7;
  border-radius: 5px;
  padding: 0 12px;
  max-width: 330px;
  width: 100%;
}
.filter-search input {
  border: 0;
  padding: 10px 0;
  background: transparent;
  width: 100%;
  min-width: 0;
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
thead {
  background: #f1eafa;
  color: #433354;
}
th {
  font-weight: 550;
  font-size: 12px;
  padding: 13px 16px;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 15px 16px;
  border-bottom: 1px solid #eeebf1;
  max-width: 350px;
  overflow-wrap: anywhere;
}
tbody tr:last-child td {
  border: 0;
}
tbody tr:hover {
  background: #fbf9fd;
}
.cell-main {
  font-weight: 550;
}
.mono {
  font-family: ui-monospace, monospace;
  font-size: 11px;
}
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.4;
  font-weight: 600;
  white-space: nowrap;
  background: #f0edf4;
  color: #61566e;
}
.badge.good {
  color: #236447;
  background: #e7f2eb;
}
.badge.warn {
  color: #915400;
  background: #fff0d7;
}
.badge.bad {
  color: #a22d43;
  background: #fcebef;
}
.badge.purple {
  color: var(--accent);
  background: var(--tint);
}
.empty {
  padding: 28px 16px;
  text-align: left;
  color: var(--muted);
  font-size: 13px;
  background: white;
}
.empty svg {
  display: none;
}
.empty strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 550;
  margin-bottom: 6px;
}
.empty .btn {
  margin-top: 18px;
}
.table-footer {
  font-size: 11px;
  color: var(--muted);
  padding: 13px 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.error-banner {
  padding: 14px;
  background: #fff0f1;
  color: #962d40;
  border: 1px solid #efc3ca;
  border-radius: 5px;
  margin-bottom: 18px;
  font-size: 13px;
}
.notice {
  padding: 14px 16px;
  border-left: 3px solid var(--amber);
  background: #fff8ed;
  color: #6c522e;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  gap: 25px;
  margin: 15px 0 25px;
}
.tab {
  background: transparent;
  border: 0;
  padding: 12px 0;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  font-size: 13px;
}
.tab.active {
  color: var(--accent);
  border-color: var(--accent);
}
dialog {
  width: min(700px, calc(100% - 32px));
  max-height: 90vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 80px #20103026;
  color: var(--ink);
}
dialog::backdrop {
  background: #22132b66;
}
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.dialog-body {
  padding: 24px;
}
.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 24px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 550;
}
.field.full {
  grid-column: 1/-1;
}
.field input,
.field select,
.field textarea,
.select {
  border: 1px solid #b3aabb;
  border-radius: 5px;
  padding: 10px 11px;
  width: 100%;
  background: white;
  color: var(--ink);
  min-height: 41px;
}
.field textarea {
  min-height: 90px;
  resize: vertical;
}
.field small {
  font-weight: 400;
  font-size: 11px;
}
.check-list {
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 5px;
}
.check-list label {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px;
  font-size: 13px;
}
.check-list input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}
.form-error {
  color: var(--red);
  font-size: 12px;
  margin-top: 15px;
  line-height: 1.5;
}
.upload-form {
  max-width: 760px;
}
.dropzone {
  padding: 35px;
  border: 1px dashed #9d84bb;
  border-radius: 6px;
  background: #fbf9fe;
  text-align: center;
  margin: 24px 0;
}
.dropzone svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
  margin-bottom: 10px;
}
.dropzone input {
  display: block;
  margin: 18px auto 0;
  max-width: 100%;
}
.upload-template {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  gap: 12px;
  font-size: 12px;
}
.sheet-preview {
  max-height: 420px;
  overflow: auto;
}
.sheet-preview th {
  position: sticky;
  top: 0;
}
.source-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin: 16px 0;
  color: var(--muted);
  font-size: 12px;
}
.settings-section {
  max-width: 750px;
  margin-bottom: 35px;
}
.settings-section h2 {
  margin-bottom: 18px;
}
.palette-images {
  display: flex;
  gap: 16px;
  margin-top: 20px;
}
.palette-images img {
  width: calc(50% - 8px);
  border: 1px solid var(--line);
  border-radius: 5px;
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f7f5fa;
}
.login-form {
  width: 100%;
  max-width: 400px;
}
.login-form .brand {
  justify-content: center;
  margin-bottom: 45px;
}
.login-form h1 {
  text-align: center;
  font-family: Georgia, serif;
  font-weight: 400;
  margin-bottom: 8px;
}
.login-form > p {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 30px;
}
.login-form .field {
  margin-bottom: 20px;
}
.login-form .btn {
  width: 100%;
  margin-top: 5px;
}
.login-footer {
  text-align: center;
  margin-top: 30px;
  color: var(--muted);
  font-size: 11px;
}
#toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 420px;
  padding: 15px 20px;
  background: #292132;
  color: white;
  border-radius: 6px;
  box-shadow: 0 6px 20px #0002;
  display: none;
  z-index: 100;
}
#toast.show {
  display: block;
}
.mobile-menu {
  display: none;
}
.print-report {
  background: white;
  padding: 30px;
}
.print-report h1 {
  margin: 20px 0;
}
.print-report table {
  font-size: 11px;
}
.print-report .source-meta {
  font-size: 11px;
}
@media (max-width: 1100px) {
  .main {
    padding: 28px;
  }
  .topbar {
    padding: 0 28px;
  }
  .welcome-intro {
    grid-template-columns: minmax(0, 1fr) 180px;
  }
  .welcome-photo {
    width: 180px;
    height: 130px;
  }
  .top-right .hospital-tag {
    display: none;
  }
  .welcome-columns {
    gap: 22px;
  }
}
@media (max-width: 800px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: -260px;
    width: 230px;
    z-index: 20;
    transition: left 0.15s;
  }
  .sidebar.open {
    left: 0;
    box-shadow: 15px 0 50px #22132b33;
  }
  .mobile-menu {
    display: inline-flex;
  }
  .topbar {
    height: 64px;
    padding: 0 18px;
  }
  .breadcrumb {
    gap: 7px;
  }
  .top-right {
    gap: 8px;
  }
  .search input {
    width: 120px;
  }
  .main {
    padding: 25px 18px;
  }
  .welcome-intro {
    grid-template-columns: 1fr;
  }
  .welcome-photo {
    display: none;
  }
  .welcome-intro h1 {
    font-size: 27px;
  }
  .welcome-columns {
    grid-template-columns: 1fr;
  }
  .page-heading {
    flex-wrap: wrap;
  }
  h1 {
    font-size: 25px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
  .dialog-body {
    padding: 20px;
  }
  .dialog-header {
    padding: 16px 20px;
  }
  td,
  th {
    padding: 12px;
  }
  .top-right .avatar {
    display: none;
  }
  .palette-images {
    flex-direction: column;
  }
  .palette-images img {
    width: 100%;
  }
  .print-report {
    padding: 12px;
  }
}
@media print {
  .sidebar,
  .topbar,
  .page-heading,
  .no-print,
  #toast,
  .skip {
    display: none !important;
  }
  .shell {
    display: block;
  }
  .main {
    padding: 0;
    max-width: none;
  }
  .table-wrap {
    overflow: visible;
    border: 0;
  }
  thead {
    display: table-header-group;
  }
  tr {
    break-inside: avoid;
  }
  .print-report {
    padding: 0;
  }
  body {
    background: white;
  }
  .print-report h1 {
    font-size: 20px;
  }
  table {
    font-size: 10px;
  }
  td,
  th {
    padding: 7px;
  }
  a {
    color: black;
  }
  .print-report .source-meta {
    display: block;
  }
  .print-report .source-meta span {
    display: inline-block;
    margin-right: 18px;
    margin-bottom: 5px;
  }
  @page {
    size: A4 landscape;
    margin: 12mm;
  }
}
