body {
  font-size: 13px;
}
.loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--green);
  font-size: 17px;
}
.side-nav {
  padding: 16px 12px;
}
.group-title {
  padding: 16px 12px 6px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
}
.nav-item {
  padding: 9px 12px;
  font-size: 12px;
  cursor: pointer;
}
.topbar {
  gap: 20px;
}
.topbar select {
  max-width: 260px;
  width: auto;
}
.tenant-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}
.connection {
  font-size: 11px;
  color: var(--green);
  white-space: nowrap;
}
.connection:before {
  content: '';
  display: inline-block;
  margin-inline-end: 6px;
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 99px;
}
.empty {
  padding: 60px 20px;
  text-align: center;
  color: #64748b;
}
.empty p {
  font-size: 12px;
  margin-top: 8px;
}
.empty-symbol {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  background: #ecfdf5;
  color: var(--green);
  border-radius: 16px;
  font-size: 26px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.data-table th {
  background: #f8fafc;
  color: #64748b;
  text-align: start;
  font-size: 11px;
  white-space: nowrap;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  max-width: 280px;
  overflow-wrap: anywhere;
}
.data-table tr:hover td {
  background: #f8fafc80;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.toolbar input {
  max-width: 320px;
}
.form-error {
  color: #be123c;
  font-size: 12px;
  min-height: 22px;
  margin: 8px 0;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--border);
  margin-top: 18px;
  padding-top: 18px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.span2 {
  grid-column: 1/-1;
}
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #0f172a80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(5px);
}
.dialog {
  background: white;
  max-width: 620px;
  width: 100%;
  max-height: 92vh;
  overflow: hidden;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px #0004;
}
.dialog.wide {
  max-width: 1120px;
}
.dialog-body {
  padding: 24px;
  overflow: auto;
}
.dialog-head {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.btn.danger {
  color: #be123c;
  border-color: #fecdd3;
  background: #fff1f2;
}
.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: white;
}
.auth-brand {
  background: radial-gradient(ellipse at 20% 10%, #065f46, #022c22 75%);
  color: white;
  padding: 9vw 6vw;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.auth-brand h1 {
  font-size: 44px;
  line-height: 1.5;
  margin: 20px 0;
}
.auth-brand p {
  color: #a7f3d0;
  max-width: 420px;
  line-height: 2;
  font-size: 16px;
}
.auth-brand .wordmark {
  font-size: 30px;
  letter-spacing: 2px;
  font-weight: 700;
}
.auth-brand small {
  color: #6ee7b780;
  font-size: 12px;
}
.auth-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px;
}
.auth-card {
  max-width: 440px;
  width: 100%;
}
.auth-card h2 {
  font-size: 27px;
  margin-bottom: 12px;
}
.auth-card > p {
  color: #64748b;
  margin-bottom: 25px;
}
.auth-card .field {
  margin-bottom: 16px;
}
.auth-card input {
  padding: 13px;
}
.auth-card .btn.primary {
  width: 100%;
  padding: 13px;
}
.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 15px;
}
.auth-card footer {
  margin-top: 24px;
  color: #94a3b8;
  font-size: 11px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.account-page {
  min-height: 100vh;
  background: #f8fafc;
  padding: 30px;
  max-width: 960px;
  margin: auto;
}
.tenant-card {
  padding: 22px;
}
.tenant-card h3 {
  font-size: 17px;
  margin: 10px 0;
}
.hero-mini {
  padding: 28px;
  background: linear-gradient(115deg, #022c22, #065f46);
  color: white;
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.hero-mini h1 {
  font-size: 26px;
  line-height: 1.5;
}
.hero-mini p {
  color: #a7f3d0;
  margin-top: 8px;
}
.metrics-live {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.metric-live {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.metric-live small {
  color: #64748b;
}
.metric-live strong {
  display: block;
  font-size: 23px;
  margin: 12px 0;
  color: #0f172a;
}
.metric-live .caption {
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  color: #94a3b8;
  font-size: 10px;
}
.metric-live.accent {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.metric-live.accent strong {
  color: #065f46;
}
.chart-bars {
  height: 200px;
  display: flex;
  gap: 15px;
  align-items: flex-end;
  padding-top: 24px;
}
.chart-bar {
  flex: 1;
  min-width: 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  height: 100%;
}
.chart-bar .chart-column {
  display: block;
  width: 100%;
  max-width: 70px;
  fill: #059669;
  border-radius: 6px 6px 0 0;
  min-height: 2px;
}
.chart-bar small {
  font-size: 10px;
  direction: ltr;
  color: #64748b;
}
.chart-bar b {
  font-size: 10px;
  color: #065f46;
  font-weight: 500;
}
.subheading {
  font-size: 15px;
  margin-bottom: 18px;
}
.list-row {
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.status-line {
  color: #64748b;
  font-size: 11px;
  padding: 5px 0;
}
.doc-line {
  display: grid;
  grid-template-columns: 2fr 1fr 0.65fr 0.9fr 0.9fr 0.8fr auto;
  gap: 8px;
  align-items: end;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.doc-line label {
  font-size: 10px;
}
.purchase-line {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.document-totals {
  background: #ecfdf5;
  padding: 18px;
  border-radius: 12px;
  margin-top: 16px;
  text-align: end;
  font-weight: 700;
  color: #065f46;
}
.doc-notice {
  font-size: 11px;
  line-height: 1.8;
  color: #64748b;
  margin: 12px 0;
}
.action-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.identity {
  border-top: 1px solid var(--border);
  padding: 16px;
  color: #64748b;
  font-size: 11px;
}
.print-screen {
  position: fixed;
  inset: 0;
  overflow: auto;
  z-index: 80;
  background: #1e293b;
  padding: 28px;
}
.print-screen .paper {
  max-width: none;
  width: 794px;
  padding: 40px;
  min-height: 1080px;
}
.print-screen .no-print {
  max-width: 794px;
  margin: 0 auto 20px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  color: white;
}
.print-document-note {
  padding: 12px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  font-size: 11px;
  line-height: 1.8;
  margin-top: 24px;
}
.print-screen h1 {
  font-size: 24px;
  color: #065f46;
}
.print-screen table {
  font-size: 11px;
}
.report-card {
  cursor: pointer;
  transition: all 0.2s;
}
.report-card:hover {
  border-color: #10b981;
  transform: translateY(-2px);
}
.pagination {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pill-number {
  font:
    600 11px ui-monospace,
    monospace;
  color: #047857;
}
.callout-info {
  border-inline-start: 3px solid #10b981;
  background: #ecfdf5;
  padding: 15px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.9;
}
.search-results {
  max-height: 400px;
  overflow: auto;
}
.search-result {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 16px;
  text-align: start;
  background: white;
  cursor: pointer;
}
.search-result:hover {
  background: #ecfdf5;
}
@media (max-width: 1050px) {
  .metrics-live {
    grid-template-columns: repeat(2, 1fr);
  }
  .auth-brand h1 {
    font-size: 32px;
  }
  .auth-form {
    padding: 25px;
  }
  .auth-brand {
    padding: 50px 35px;
  }
}
@media (max-width: 767px) {
  .auth-screen {
    grid-template-columns: 1fr;
  }
  .auth-brand {
    padding: 24px;
  }
  .auth-brand h1 {
    font-size: 23px;
    margin: 8px 0;
  }
  .auth-brand p,
  .auth-brand small {
    display: none;
  }
  .auth-form {
    padding: 30px 20px;
  }
  .auth-card h2 {
    font-size: 23px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .metrics-live {
    gap: 10px;
  }
  .metric-live {
    padding: 15px;
  }
  .metric-live strong {
    font-size: 19px;
  }
  .topbar .connection {
    display: none;
  }
  .topbar select {
    max-width: 155px;
    font-size: 11px;
  }
  .topbar {
    gap: 8px;
  }
  .hero-mini {
    padding: 20px;
    display: block;
  }
  .hero-mini h1 {
    font-size: 22px;
  }
  .hero-mini .btn {
    margin-top: 12px;
  }
  .doc-line {
    grid-template-columns: 1fr 1fr;
  }
  .dialog-body {
    padding: 16px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .account-page {
    padding: 20px;
  }
  .print-screen {
    padding: 15px;
  }
  .main {
    padding: 18px 12px;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .identity .btn {
    padding: 5px 8px;
  }
  .grid2 {
    display: grid;
  }
}
@media print {
  #app,
  #modals > .overlay,
  #toasts,
  .no-print {
    display: none !important;
  }
  .print-screen {
    position: static !important;
    inset: auto !important;
    background: white !important;
    overflow: visible !important;
    padding: 0 !important;
  }
  .print-screen .paper {
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    display: block !important;
  }
  .print-screen thead {
    display: table-header-group;
  }
  .print-screen tr {
    break-inside: avoid;
  }
}
.main-wrap {
  margin-inline-start: 288px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.side-nav {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.brand strong,
.brand span {
  display: block;
}
.brand strong {
  font-size: 14px;
}
.brand span {
  font-size: 11px;
  color: #047857;
  margin-top: 5px;
}
.brand-mark {
  width: 44px;
  height: 44px;
  background: linear-gradient(130deg, #065f46, #022c22);
  color: #fbbf24;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 26px;
  border-radius: 12px;
  flex-shrink: 0;
}
.app-footer {
  text-align: center;
  padding: 20px;
  color: #94a3b8;
  font-size: 10px;
}
.mobile-toggle {
  display: none;
}
.search-button {
  font-size: 11px;
  color: #64748b;
  background: #f8fafc;
}
.field input,
.field select,
.field textarea {
  width: 100%;
}
.pad {
  padding: 22px;
}
@media (max-width: 1279px) {
  .main-wrap {
    margin-inline-start: 250px;
  }
}
@media (max-width: 767px) {
  .main-wrap {
    margin-inline-start: 0;
  }
  .mobile-toggle {
    display: block;
  }
  .search-button {
    font-size: 0;
    min-width: 32px;
  }
  .search-button:after {
    content: '⌕';
    font-size: 22px;
  }
  .topbar > .row > .btn[data-view='account'] {
    display: none;
  }
  .table-wrap {
    max-width: 100%;
    overflow: auto;
  }
  .data-table {
    min-width: 640px;
  }
  .dialog .data-table {
    min-width: 800px;
  }
  .main .metrics-live {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.related-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}
.related-choice .field {
  width: 100%;
  margin: 0;
}
#lab-related-editor[hidden],
#new-lab-form[hidden] {
  display: none;
}

.demo-data-banner,
.demo-print-banner,
.draft-print-banner {
  padding: 12px 16px;
  border: 2px solid #b45309;
  background: #fffbeb;
  color: #78350f;
  border-radius: 8px;
  font-weight: 700;
  line-height: 1.7;
  margin-bottom: 16px;
}
.draft-print-banner {
  border-color: #b91c1c;
  background: #fef2f2;
  color: #991b1b;
}
.print-screen .paper {
  max-width: 100%;
  width: 794px;
  display: block;
}
.print-screen .paper h1,
.print-screen .paper h2 {
  overflow-wrap: anywhere;
}
.print-screen .data-table {
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}
.print-screen .data-table td,
.print-screen .data-table th {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  padding: 9px 6px;
}
.print-screen .data-table td {
  vertical-align: top;
}
.print-screen .paper p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media print {
  .print-screen .table-wrap {
    overflow: visible !important;
  }
  .print-screen .data-table {
    min-width: 0 !important;
    width: 100% !important;
    font-size: 10px;
  }
  .print-screen .data-table thead {
    display: table-header-group;
  }
  .print-screen .data-table tr {
    break-inside: avoid;
  }
  .demo-print-banner,
  .draft-print-banner,
  .document-totals,
  .print-document-note {
    break-inside: avoid;
  }
  .print-screen details {
    display: block;
  }
  .print-screen details p {
    font-size: 9px;
  }
}

.print-screen .print-repeat-demo th {
  color: #92400e;
  background: #fffbeb;
  text-align: center;
  font-weight: 700;
  border: 1px solid #b45309;
}
/* Organization setup: compact bilingual forms, no inline CSP exceptions. */
.organization-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.organization-hours {
  margin-block: 18px;
  border: 1px solid var(--border, #dce4ef);
  border-radius: 12px;
  padding: 16px;
}
.organization-day {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 12px;
  padding-block: 8px;
}
.organization-day label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.organization-day input[type='checkbox'] {
  width: auto;
}
.organization-day input[type='time'] {
  min-width: 0;
  width: 100%;
  direction: ltr;
}
@media (max-width: 600px) {
  .organization-form-grid {
    grid-template-columns: 1fr;
  }
  .organization-day {
    grid-template-columns: 1fr 1fr;
  }
  .organization-day > label:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  :is(.organization-page, .organization-units) .table-wrap {
    overflow: visible;
  }
  :is(.organization-page, .organization-units) .data-table,
  :is(.organization-page, .organization-units) .data-table tbody {
    display: block;
    min-width: 0;
    width: 100%;
  }
  :is(.organization-page, .organization-units) .data-table thead {
    display: none;
  }
  :is(.organization-page, .organization-units) .data-table tr {
    display: block;
    padding: 12px;
    border-bottom: 1px solid var(--border, #dce4ef);
  }
  :is(.organization-page, .organization-units) .data-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  :is(.organization-page, .organization-units) .data-table td::before {
    content: attr(data-label);
    font-weight: 600;
    flex-shrink: 0;
  }
}
