* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #EEF2F5;
  color: #1D242B;
  line-height: 1.45;
}

.hidden {
  display: none !important;
}

/* Headers matching NHS / Ariel mockups */
.header-ed {
  background-color: #005EB8;
  color: #FFFFFF;
  padding: 16px 28px;
}

.header-staff {
  background-color: #1D242B;
  color: #FFFFFF;
  padding: 14px 28px;
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.header-sub {
  display: block;
  font-size: 13px;
  opacity: 0.92;
  margin-bottom: 2px;
}

.header-main {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.open-pill {
  background: #FFFFFF;
  color: #005EB8;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13.5px;
}

.sound-toggle {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

/* Authenticated Navigation Bar */
.role-nav {
  background: #FFFFFF;
  border-bottom: 1px solid #D8DDE0;
  padding: 0 28px;
}

.role-nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #4C6272;
  cursor: pointer;
}

.nav-tab.active {
  color: #005EB8;
  border-bottom-color: #005EB8;
}

.btn-link {
  background: none;
  border: none;
  color: #005EB8;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: underline;
}

/* Main Container */
.main-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* Cards & Forms */
.card {
  background: #FFFFFF;
  border-radius: 10px;
  padding: 24px 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  margin-bottom: 20px;
}

.signin-card {
  max-width: 460px;
  margin: 28px auto;
  padding: 32px 34px;
}

.signin-card h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.muted-text {
  color: #4C6272;
  font-size: 14.5px;
  margin-top: 0;
}

.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  color: #1D242B;
}

.label-hint {
  font-weight: 400;
  color: #4C6272;
  font-size: 13px;
  display: block;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #4C6272;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  color: #1D242B;
  background: #FFFFFF;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid #FFEB3B;
  border-color: #1D242B;
}

.otp-input {
  max-width: 220px;
  font-size: 22px !important;
  letter-spacing: 4px;
  font-weight: 600;
}

/* Buttons */
.btn-nhs-green {
  background-color: #007F3B;
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  padding: 12px 22px;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
}

.btn-nhs-green:hover {
  background-color: #00662F;
}

.btn-nhs-green.full-width {
  width: 100%;
}

.btn-nhs-blue {
  background-color: #005EB8;
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  padding: 11px 20px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
}

.btn-outline {
  background: #FFFFFF;
  color: #005EB8;
  border: 1.5px solid #005EB8;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-danger-outline {
  background: #FFFFFF;
  color: #D5281B;
  border: 1.5px solid #D5281B;
  border-radius: 6px;
  padding: 11px 18px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
}

.btn-danger {
  background: #D5281B;
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  padding: 11px 18px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* Grid Layouts for Referral Form */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

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

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Radio Pill Cards */
.radio-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1.5px solid #D8DDE0;
  border-radius: 6px;
  background: #FFFFFF;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.radio-card.selected {
  border-color: #005EB8;
  background-color: #EBF3FA;
  font-weight: 600;
}

.radio-card input[type="radio"] {
  accent-color: #005EB8;
  width: 16px;
  height: 16px;
  margin: 0;
}

/* Status Tracker (Screen 3) */
.status-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.step-card {
  background: #FFFFFF;
  border-radius: 8px;
  padding: 16px 18px;
  border-top: 4px solid #D8DDE0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.step-card.done {
  border-top-color: #007F3B;
}

.step-card.declined {
  border-top-color: #D5281B;
}

.step-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #007F3B;
  color: #007F3B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.step-icon.pending {
  border-color: #AEB7BD;
  color: #AEB7BD;
}

.booked-panel {
  background: #FFFFFF;
  border: 2px solid #007F3B;
  border-radius: 10px;
  padding: 24px 28px;
  margin-bottom: 18px;
}

.declined-panel {
  background: #FFFFFF;
  border: 2px solid #D5281B;
  border-radius: 10px;
  padding: 24px 28px;
  margin-bottom: 18px;
}

.waiting-panel {
  background: #FFFFFF;
  border: 2px solid #005EB8;
  border-radius: 10px;
  padding: 24px 28px;
  margin-bottom: 18px;
}

.pill-green {
  display: inline-block;
  background: #007F3B;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.pill-red {
  display: inline-block;
  background: #D5281B;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.patient-advice-box {
  background: #F0F4F5;
  padding: 14px 16px;
  border-radius: 6px;
  font-size: 14px;
  margin: 18px 0;
}

.amber-notice {
  background: #FFF6D6;
  border: 1px solid #F0D578;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 13.5px;
  color: #3B3000;
}

/* Staff Inbox (Screen 4) */
.inbox-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .inbox-layout {
    grid-template-columns: 1fr;
  }
}

.inbox-sidebar {
  background: #FFFFFF;
  border-radius: 10px;
  padding: 16px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.inbox-sidebar h3 {
  margin: 0 18px 12px;
  font-size: 16px;
}

.queue-item {
  padding: 14px 18px;
  border-top: 1px solid #E8EDEE;
  border-left: 4px solid transparent;
  cursor: pointer;
}

.queue-item:hover {
  background: #F7F9FA;
}

.queue-item.selected {
  background: #E8F2FC;
  border-left-color: #005EB8;
}

.queue-item.status-new {
  background: #FFF9E6;
  border-left-color: #FFB81C;
}

.queue-item.status-new.selected {
  background: #FFF2CC;
}

.queue-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-new {
  background: #FFB81C;
  color: #1D242B;
}

.badge-received {
  background: #005EB8;
  color: #FFFFFF;
}

.badge-booked {
  background: #007F3B;
  color: #FFFFFF;
}

.badge-declined {
  background: #D8DDE0;
  color: #4C6272;
}

/* Alerts & Modals */
.inline-error {
  background: #FDECEA;
  border-left: 4px solid #D5281B;
  color: #8A1108;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 14px;
  margin: 12px 0;
}

.inline-success {
  background: #E6F4EA;
  border-left: 4px solid #007F3B;
  color: #004D23;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 14px;
  margin: 12px 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(29, 36, 43, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-card {
  background: #FFFFFF;
  border-radius: 10px;
  max-width: 540px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal-header h3 {
  margin: 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.quick-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chip-btn {
  background: #F0F4F5;
  border: 1px solid #AEB7BD;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  cursor: pointer;
}

/* Admin Tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #E8EDEE;
}

.admin-table th {
  background: #F7F9FA;
  font-weight: 700;
  color: #4C6272;
}

@media print {
  body * {
    visibility: hidden;
  }
  #print-slip-content,
  #print-slip-content * {
    visibility: visible;
  }
  #print-slip-content {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    padding: 24px;
  }
  .no-print {
    display: none !important;
  }
}
