/**
 * quick-checkup.css - Rapid Triage, Outpatient Clinical Exam & Prescription Engine
 * Dr. Abdullah Al-Hawas Veterinary Clinic (عيادات د. عبد الله الحواس البيطرية الشاملة)
 */

/* ==========================================================================
   1. QUICK CHECKUP CONTAINER & LAYOUT
   ========================================================================== */

.quick-checkup-workspace {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 4px 40px;
  box-sizing: border-box;
  font-family: 'Cairo', 'IBM Plex Sans Arabic', 'Inter', sans-serif;
}

/* Header Banner */
.qc-header-banner {
  background: linear-gradient(135deg, #17302A 0%, #1f4239 50%, #0f766e 100%);
  border: 1px solid rgba(201, 168, 118, 0.3);
  border-radius: 16px;
  padding: 20px 24px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 8px 24px rgba(23, 48, 42, 0.25);
  position: relative;
  overflow: hidden;
}

.qc-header-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(201, 168, 118, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.qc-header-info {
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1;
}

.qc-header-icon {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(201, 168, 118, 0.5);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.qc-header-title h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
}

.qc-header-title p {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: #cbd5e1;
  font-weight: 500;
}

.qc-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1;
  flex-wrap: wrap;
}

.qc-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  font-family: inherit;
}

.qc-btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.qc-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.qc-btn-gold {
  background: linear-gradient(135deg, #C9A876 0%, #8B6A45 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(139, 106, 69, 0.35);
}

.qc-btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 106, 69, 0.5);
}

/* Sub-Tab Navigation Strip */
.qc-nav-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 8px;
  margin-top: -4px;
}

body.theme-high-sunlight .qc-nav-strip {
  border-bottom-color: #000000;
}

.qc-tab-btn {
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #64748b;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.qc-tab-btn:hover {
  background: #f1f5f9;
  color: #17302A;
}

.qc-tab-btn.active {
  background: #17302A;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(23, 48, 42, 0.2);
}

.qc-tab-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
}

.qc-tab-btn:not(.active) .qc-tab-badge {
  background: #e2e8f0;
  color: #475569;
}

/* Main Grid Layout */
.qc-main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1024px) {
  .qc-main-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   2. CARDS & SECTION CONTAINERS
   ========================================================================== */

.qc-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

body.theme-high-sunlight .qc-card {
  border: 2px solid #000000;
}

.qc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.qc-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #17302A;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.qc-card-subtitle {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
  margin: 2px 0 0;
}

.qc-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.qc-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qc-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
}

.qc-input, .qc-select, .qc-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.92rem;
  color: #1e293b;
  background: #ffffff;
  box-sizing: border-box;
  font-family: inherit;
  transition: all 0.2s ease;
}

.qc-input:focus, .qc-select:focus, .qc-textarea:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.qc-textarea {
  min-height: 80px;
  resize: vertical;
}

/* Client Auto-Search Box */
.qc-search-wrap {
  position: relative;
  width: 100%;
}

.qc-search-results-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1.5px solid #0f766e;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.qc-search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s;
}

.qc-search-result-item:hover {
  background: #f0fdfa;
}

.qc-result-name {
  font-weight: 700;
  color: #0f766e;
}

.qc-result-meta {
  font-size: 0.78rem;
  color: #64748b;
}

/* ==========================================================================
   3. RAPID VITALS & TRIAGE GAUGES
   ========================================================================== */

.qc-vitals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.qc-vital-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: all 0.2s ease;
}

.qc-vital-card.normal {
  border-color: #10b981;
  background: #f0fdf4;
}

.qc-vital-card.warning {
  border-color: #f59e0b;
  background: #fffbeb;
}

.qc-vital-card.danger {
  border-color: #ef4444;
  background: #fef2f2;
}

.qc-vital-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qc-vital-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
}

.qc-vital-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
}

.qc-vital-card.normal .qc-vital-badge { background: #dcfce7; color: #15803d; }
.qc-vital-card.warning .qc-vital-badge { background: #fef3c7; color: #b45309; }
.qc-vital-card.danger .qc-vital-badge { background: #fee2e2; color: #b91c1c; }

.qc-vital-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qc-vital-input {
  font-size: 1.25rem;
  font-weight: 800;
  width: 100%;
  border: none;
  background: transparent;
  color: #0f172a;
  outline: none;
  font-family: inherit;
}

.qc-vital-unit {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  flex-shrink: 0;
}

.qc-vital-range-hint {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: -2px;
}

/* Mucous Membrane Color Swatches */
.qc-mucous-swatches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

@media (max-width: 640px) {
  .qc-mucous-swatches {
    grid-template-columns: repeat(3, 1fr);
  }
}

.qc-swatch-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.75rem;
  font-weight: 700;
  color: #334155;
  font-family: inherit;
}

.qc-swatch-btn.active {
  border-color: #0f766e;
  background: #f0fdfa;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.2);
}

.qc-swatch-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.dot-pink { background: #f472b6; }
.dot-pale { background: #fef08a; }
.dot-congested { background: #ef4444; }
.dot-jaundice { background: #eab308; }
.dot-cyanotic { background: #3b82f6; }

/* ==========================================================================
   4. SYMPTOM & CLINICAL CHIPS
   ========================================================================== */

.qc-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.qc-chip {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.qc-chip:hover {
  background: #e2e8f0;
}

.qc-chip.active {
  background: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.3);
}

/* ==========================================================================
   5. PRESCRIPTION & DRUG BUILDER
   ========================================================================== */

.qc-rx-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 14px;
}

.qc-rx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.qc-rx-table th {
  background: #f8fafc;
  padding: 10px 12px;
  font-weight: 800;
  color: #1e293b;
  text-align: right;
  border-bottom: 1.5px solid #e2e8f0;
}

[dir="ltr"] .qc-rx-table th {
  text-align: left;
}

.qc-rx-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.qc-rx-table input, .qc-rx-table select {
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.85rem;
  width: 100%;
  box-sizing: border-box;
}

.qc-btn-remove-row {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  transition: all 0.15s;
}

.qc-btn-remove-row:hover {
  background: #ef4444;
  color: #ffffff;
}

.qc-quick-drugs-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.qc-quick-drug-pill {
  font-size: 0.78rem;
  font-weight: 700;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  color: #0f766e;
  padding: 5px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.qc-quick-drug-pill:hover {
  background: #ccfbf1;
  transform: translateY(-1px);
}

/* ==========================================================================
   6. SIDEBAR DISPOSITION & ACTION PANEL
   ========================================================================== */

.qc-sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 80px;
}

.qc-triage-status-card {
  background: #ffffff;
  border: 2px solid #0f766e;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 4px 16px rgba(15, 118, 110, 0.12);
  text-align: center;
}

.qc-triage-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.qc-triage-badge.stable { background: #dcfce7; color: #166534; }
.qc-triage-badge.urgent { background: #fef3c7; color: #92400e; }
.qc-triage-badge.critical { background: #fee2e2; color: #991b1b; animation: pulseRed 1.8s infinite; }

@keyframes pulseRed {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.qc-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 6px 0;
  border-bottom: 1px dashed #f1f5f9;
}

.qc-summary-item span:first-child { color: #64748b; font-weight: 600; }
.qc-summary-item span:last-child { color: #0f172a; font-weight: 800; }

/* Primary Action Buttons in Sidebar */
.qc-action-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qc-btn-action {
  width: 100%;
  padding: 13px 18px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.qc-btn-discharge {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

.qc-btn-discharge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.45);
}

.qc-btn-inpatient {
  background: linear-gradient(135deg, #17302A 0%, #1f4239 100%);
  color: #ffffff;
  border: 1.5px solid #C9A876;
  box-shadow: 0 4px 14px rgba(23, 48, 42, 0.3);
}

.qc-btn-inpatient:hover {
  background: #1f4239;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(23, 48, 42, 0.45);
}

.qc-btn-lab {
  background: #f8fafc;
  color: #7e22ce;
  border: 1.5px solid #d8b4fe;
}

.qc-btn-lab:hover {
  background: #f3e8ff;
  border-color: #c084fc;
}

/* ==========================================================================
   7. HISTORY & CHECKUP LOGS VIEW
   ========================================================================== */

.qc-history-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.qc-kpi-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .qc-kpi-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

.qc-kpi-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.qc-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.qc-kpi-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.qc-kpi-lbl {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  margin-top: 2px;
}

.qc-history-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.qc-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.qc-history-table th {
  background: #f1f5f9;
  padding: 12px 14px;
  font-weight: 800;
  color: #1e293b;
  text-align: right;
  border-bottom: 2px solid #e2e8f0;
}

[dir="ltr"] .qc-history-table th {
  text-align: left;
}

.qc-history-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.qc-history-table tr:hover td {
  background: #f8fafc;
}

.qc-table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qc-btn-sm {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.qc-btn-sm:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

/* ==========================================================================
   8. PRINTABLE PRESCRIPTION SLIP / REPORT MODAL
   ========================================================================== */

.qc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.qc-modal-card {
  background: #ffffff;
  border-radius: 18px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.qc-modal-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #17302A;
  color: #ffffff;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}

.qc-modal-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Printable Prescription Slip Layout */
.qc-slip-container {
  padding: 24px;
  color: #0f172a;
  background: #ffffff;
}

.qc-slip-clinic-header {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 2px double #17302A;
  margin-bottom: 16px;
}

.qc-slip-logo {
  max-width: 90px;
  height: auto;
  margin-bottom: 6px;
}

.qc-slip-clinic-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #17302A;
  margin: 0;
}

.qc-slip-clinic-sub {
  font-size: 0.78rem;
  font-weight: 600;
  color: #8B6A45;
  margin: 2px 0 0;
}

.qc-slip-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.qc-slip-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #17302A;
  margin: 14px 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
}

.qc-slip-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.8rem;
}

.qc-slip-stamp-box {
  width: 140px;
  height: 60px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* @media print styles */
@media print {
  body * {
    visibility: hidden !important;
  }
  .qc-slip-container, .qc-slip-container * {
    visibility: visible !important;
  }
  .qc-slip-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 0;
    margin: 0;
  }
  .qc-modal-overlay, .qc-modal-top-bar, .qc-modal-footer-actions {
    display: none !important;
  }
}
