body {
  background: linear-gradient(180deg, #f8fbff 0%, #f8fafc 100%);
  color: #0f172a;
}

.queue-grid {
  max-width: 1200px;
  margin: 32px auto 56px;
  padding: 0 24px;
}

#staff-queue-list,
#staff-completed-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.queue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  margin-bottom: 0;
  box-shadow: 0 10px 24px -18px rgba(15, 23, 42, 0.4);
  transition: all 0.2s ease;
}

.queue-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -18px rgba(15, 23, 42, 0.45);
  border-color: #cbd5e1;
}

.queue-card[draggable="true"] {
  cursor: grab;
}

.queue-card-dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.queue-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  color: #64748b;
  font-size: 22px;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.queue-card.active-patient {
  border-color: rgba(2, 132, 199, 0.4);
  background: linear-gradient(
    135deg,
    rgba(14, 165, 233, 0.07) 0%,
    rgba(255, 255, 255, 1) 100%
  );
  box-shadow:
    0 0 0 1px rgba(2, 132, 199, 0.18),
    0 14px 28px -18px rgba(2, 132, 199, 0.4);
}

.token-badge {
  min-width: 104px;
  font-size: 26px;
  font-weight: 800;
  color: var(--primary-color);
  background: linear-gradient(180deg, #edf7ff 0%, #e0f2fe 100%);
  padding: 12px 18px;
  border-radius: 14px;
  letter-spacing: -0.04em;
  border: 1px solid rgba(2, 132, 199, 0.08);
  text-align: center;
}

.active-patient .token-badge {
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
  color: white;
  box-shadow: 0 10px 18px rgba(2, 132, 199, 0.25);
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 38px;
  height: 32px;
  object-fit: contain;
}

.brand-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: -0.02em;
}

.brand-divider {
  width: 2px;
  height: 24px;
  background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
  margin: 0 8px;
}

.brand-role {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.top-header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 25px -20px rgba(15, 23, 42, 0.4);
}

.btn,
button {
  transition: all 0.2s ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.btn-sm {
  min-height: 34px;
  padding: 8px 12px;
  font-size: 12px;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid transparent;
  color: white;
  box-shadow: 0 10px 18px rgba(2, 132, 199, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 20px rgba(2, 132, 199, 0.22);
}

.btn-secondary {
  background: white;
  border: 1px solid #cbd5e1;
  color: var(--text-main);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-ghost {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: var(--text-main);
}

.btn-ghost:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.input,
select,
textarea {
  border-radius: 10px !important;
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.input:focus,
select:focus,
textarea:focus {
  border-color: rgba(2, 132, 199, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
  background: white !important;
}

.lookup-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 8px 12px;
  margin-top: 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  border: 1px solid transparent;
}

.lookup-status-neutral {
  color: #475569;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.lookup-status-success {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}

.lookup-status-error {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fca5a5;
}

.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 1050;
  padding: 20px;
}

.labs-modal-container {
  background: white;
  width: 100%;
  max-width: 1000px;
  max-height: 92vh;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 50px -20px rgba(15, 23, 42, 0.35);
}

.labs-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.labs-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.labs-entry-section {
  flex: 1.2;
  overflow-y: auto;
  padding: 24px;
  border-right: 1px solid #e2e8f0;
}

.labs-chart-section {
  flex: 0.8;
  padding: 24px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
}

.lab-category-title {
  color: var(--primary-color);
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
  margin-bottom: 12px;
  margin-top: 20px;
  font-size: 15px;
  font-weight: 700;
}

.lab-category-title:first-of-type {
  margin-top: 0;
}

.lab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.lab-input-group label {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.lab-input-abnormal {
  background-color: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
  font-weight: 700;
}

.chart-container {
  flex: 1;
  min-height: 320px;
  position: relative;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

@media (max-width: 640px) {
  .queue-grid {
    padding: 0 16px;
  }

  .labs-modal-body {
    flex-direction: column;
  }

  .labs-entry-section {
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .lab-grid {
    grid-template-columns: 1fr;
  }
}

.print-only,
#print-rx-layout,
#print-qr-layout,
#print-bill-layout {
  display: none;
}

@media print {
  body > :not(.print-only) {
    display: none !important;
  }
  html,
  body {
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: white !important;
  }
  body.mode-rx #print-rx-layout {
    display: block !important;
    width: 100% !important;
    padding: 20px !important;
  }
  body.mode-qr #print-qr-layout {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    height: 100vh !important;
    padding: 40px !important;
  }
  body.mode-bill #print-bill-layout {
    display: block !important;
    width: 100% !important;
    padding: 20px !important;
  }
  @page {
    margin: 1cm;
    size: auto;
  }
}

.lab-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-bottom: 20px;
}

.lab-input-group {
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border-bottom: 1px solid #f1f5f9;
}

.lab-input-group label {
  font-size: 13px;
  color: #334155;
  font-weight: 500;
  text-align: right;
  padding-right: 10px;
}

.lab-input-group input {
  width: 100%;
  max-width: 150px;
}
