* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #0b0f18;
  color: white;
  font-family: Arial, Helvetica, sans-serif;
  padding-bottom: 86px;
}

.app-shell {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #171b22;
  border: 1px solid #2a303a;
  border-radius: 18px;
  padding: 18px 22px;
  margin-bottom: 20px;
}

.brand {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.subtitle {
  color: #aab3c2;
  margin-top: 4px;
}

.status-pill {
  background: #263246;
  color: #dbe8ff;
  border: 1px solid #3d4e6c;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: bold;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

h1 {
  font-size: 36px;
  margin: 0 0 24px;
}

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

.big-card {
  border: none;
  border-radius: 22px;
  min-height: 125px;
  padding: 22px;
  color: white;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease, filter 0.12s ease;

  display: flex;
  align-items: center;
  justify-content: center;
}

.big-card:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.big-card span {
  display: block;
  font-size: 32px;
  font-weight: 800;
}

.methadone {
  background: linear-gradient(135deg, #155e35, #1f8f3a);
}

.suboxone {
  background: linear-gradient(135deg, #8b3a00, #d97706);
}

.neutral {
  background: linear-gradient(135deg, #263246, #3f4f68);
}

.printer-status-card {
  width: 100%;
  display: grid;
  grid-template-columns: 1.2fr 1.8fr;
  gap: 18px;
  background: #171b22;
  border: 1px solid #2a303a;
  border-radius: 18px;
  padding: 18px;
  margin-top: 18px;
  margin-bottom: 24px;
}

.status-title {
  color: #aab3c2;
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.status-main {
  font-size: 24px;
  font-weight: 800;
}

.status-main.offline {
  color: #ffcf7a;
}

.status-note {
  color: #aab3c2;
  margin-top: 6px;
  line-height: 1.35;
}

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

.status-box {
  background: #10141c;
  border: 1px solid #303747;
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  min-width: 0;
}

.status-box span {
  display: block;
  color: #aab3c2;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 6px;
  line-height: 1.15;
}

.status-box strong {
  display: block;
  font-size: 20px;
}

.screen-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.screen-header h1 {
  margin: 0;
}

.back-button {
  background: #2b3240;
  color: white;
  border: 1px solid #485369;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 18px;
  cursor: pointer;
}

.form-card,
.queue-card,
.review-card {
  background: #171b22;
  border: 1px solid #2a303a;
  border-radius: 22px;
  padding: 24px;
}

label {
  display: block;
  font-size: 18px;
  font-weight: bold;
  margin: 18px 0 8px;
}

input,
select {
  width: 100%;
  min-height: 52px;
  border-radius: 12px;
  border: 2px solid #3a4353;
  padding: 10px 14px;
  font-size: 24px;
  background: white;
  color: black;
  text-transform: uppercase;
}

.dose-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dose-row span {
  font-size: 26px;
  font-weight: bold;
}

.dose-select-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  align-items: end;
}

.mini-label {
  color: #aab3c2;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 6px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  cursor: pointer;
}

.checkbox-row input {
  width: 24px;
  min-height: 24px;
  height: 24px;
  accent-color: #1f8f3a;
}

.checkbox-row span {
  font-size: 20px;
}

.conditional-field {
  margin-top: 12px;
}

.hidden {
  display: none;
}

.print-button {
  width: 100%;
  margin-top: 28px;
  min-height: 60px;
  border: none;
  border-radius: 14px;
  background: #1f8f3a;
  color: white;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
}

.print-button:hover,
.secondary-button:hover,
.back-button:hover {
  filter: brightness(1.1);
}

.secondary-button {
  width: 100%;
  margin-top: 28px;
  min-height: 60px;
  border: 1px solid #485369;
  border-radius: 14px;
  background: #2b3240;
  color: white;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
}

.review-warning {
  background: #2d2414;
  border: 1px solid #5c431b;
  color: #ffdf9a;
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: bold;
  margin-bottom: 18px;
}

.review-content {
  background: #10141c;
  border: 1px solid #303747;
  border-radius: 16px;
  overflow: hidden;
}

.review-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  border-bottom: 1px solid #303747;
}

.review-row:last-child {
  border-bottom: none;
}

.review-label {
  background: #151b25;
  color: #aab3c2;
  padding: 14px 16px;
  font-weight: bold;
}

.review-value {
  padding: 14px 16px;
  font-size: 22px;
  font-weight: 800;
}

.review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.confirm-button {
  background: #1f8f3a;
}

.helper-text {
  color: #c7cfdd;
  font-size: 18px;
  line-height: 1.4;
}

.csv-example {
  background: #0f1115;
  border: 1px solid #303747;
  color: #dfe7f5;
  border-radius: 14px;
  padding: 16px;
  font-family: monospace;
  line-height: 1.6;
  margin-top: 16px;
  overflow-x: auto;
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 18px;
}

.queue-subtitle {
  color: #aab3c2;
  font-size: 14px;
  font-weight: normal;
  margin-top: 4px;
}

.queue-header button {
  background: #444b5a;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
}

.queue-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.queue-summary div {
  background: #10141c;
  border: 1px solid #303747;
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}

.queue-summary strong {
  display: block;
  font-size: 24px;
}

.queue-summary span {
  display: block;
  color: #aab3c2;
  font-size: 13px;
  font-weight: bold;
  margin-top: 4px;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.job {
  background: #10141c;
  border: 1px solid #303747;
  border-left: 6px solid #1f8f3a;
  border-radius: 14px;
  padding: 14px 16px;
}

.job.suboxone-job {
  border-left-color: #d97706;
}

.job-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.job-title {
  font-size: 20px;
  font-weight: bold;
}

.status-badge {
  background: #263246;
  color: #dbe8ff;
  border: 1px solid #3d4e6c;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
}

.status-badge.pending {
  background: #2d2414;
  color: #ffdf9a;
  border-color: #5c431b;
}

.job-meta {
  color: #aab3c2;
  margin-top: 6px;
}

.empty-state {
  color: #8f9bad;
  padding: 22px;
  text-align: center;
  border: 1px dashed #3a4353;
  border-radius: 14px;
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 8px 14px;
  text-align: center;
  color: #aab3c2;
  font-size: 14px;
  background: rgba(11, 15, 24, 0.96);
  border-top: 1px solid #202634;
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.footer-line {
  margin: 4px 0;
}

.footer-line.secondary {
  color: #8f9bad;
}

@media (max-width: 700px) {
  body {
    padding-bottom: 96px;
  }

  .app-shell {
    padding: 18px;
  }

  .topbar {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 14px;
    margin-bottom: 18px;
    border-radius: 16px;
  }

  .brand {
    font-size: 24px;
  }

  .subtitle {
    font-size: 13px;
  }

  .status-pill {
    padding: 6px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  h1 {
    font-size: 28px;
    margin-bottom: 14px;
  }

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

  .big-card {
    min-height: 115px;
    padding: 14px;
    border-radius: 18px;
  }

  .big-card span {
    font-size: 24px;
    line-height: 1.05;
  }

  .printer-status-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
    margin-top: 14px;
    margin-bottom: 18px;
  }

  .status-main {
    font-size: 21px;
  }

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

  .form-card,
  .queue-card,
  .review-card {
    padding: 18px;
    border-radius: 18px;
  }

  input,
  select {
    min-height: 48px;
    font-size: 20px;
  }

  .dose-select-row {
    gap: 10px;
  }

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

  .review-label {
    padding-bottom: 4px;
  }

  .review-value {
    padding-top: 8px;
    font-size: 20px;
  }

  .review-actions {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .queue-header {
    flex-direction: column;
  }

  .queue-summary {
    grid-template-columns: repeat(3, 1fr);
  }

  .job-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer {
    font-size: 13px;
    padding-bottom: 18px;
  }
}


.status-main.online { color: #9ee493; }
.status-main.error { color: #ff9a9a; }

.submit-message {
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: bold;
  margin-bottom: 18px;
}

.submit-message.success {
  background: #11291a;
  border: 1px solid #276a3c;
  color: #9ee493;
}

.submit-message.error {
  background: #351919;
  border: 1px solid #7c2d2d;
  color: #ffb4b4;
}

.status-badge.printed {
  background: #11291a;
  color: #9ee493;
  border-color: #276a3c;
}

.status-badge.failed {
  background: #351919;
  color: #ffb4b4;
  border-color: #7c2d2d;
}

.status-badge.processing {
  background: #172554;
  color: #bfdbfe;
  border-color: #1d4ed8;
}
