@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  /* Color Palette */
  --primary-color: #0d9488;      /* Deep Teal */
  --primary-hover: #0f766e;
  --primary-light: #ccfbf1;
  --primary-dark: #115e59;
  
  --secondary-color: #f59e0b;    /* Warm Amber */
  --secondary-hover: #d97706;
  --secondary-light: #fef3c7;
  
  --danger-color: #ef4444;       /* Rose Red */
  --danger-hover: #dc2626;
  --danger-light: #fee2e2;

  --success-color: #10b981;      /* Emerald Green */
  --success-light: #d1fae5;

  --bg-app: #f8fafc;             /* Slate 50 */
  --bg-sidebar: #0f172a;         /* Slate 900 */
  --bg-card: #ffffff;
  
  --text-main: #1e293b;          /* Slate 800 */
  --text-muted: #64748b;         /* Slate 500 */
  --text-white: #ffffff;
  
  --border-color: #e2e8f0;       /* Slate 200 */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Reset and Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* App Shell Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: var(--text-white);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
  box-shadow: 4px 0 10px rgb(0 0 0 / 0.1);
  overflow: hidden;
}

.clinic-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 32px;
  border-bottom: 1px solid #1e293b;
  text-decoration: none;
  color: var(--text-white);
  flex-shrink: 0;
}

.clinic-logo-icon {
  background-color: var(--primary-color);
  color: var(--text-white);
  padding: 8px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.clinic-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}

.clinic-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  min-height: 0;
}

/* Custom scrollbar for nav-menu */
.nav-menu::-webkit-scrollbar { width: 4px; }
.nav-menu::-webkit-scrollbar-track { background: transparent; }
.nav-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.nav-menu::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #94a3b8;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  text-align: left;
  background: none;
  width: 100%;
}

.nav-item:hover, .nav-item.active {
  color: var(--text-white);
  background-color: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  background-color: var(--primary-color);
}

.nav-item-icon {
  display: flex;
  align-items: center;
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
  max-width: 1400px;
  min-height: 100vh;
}

/* Header Components */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Alert Notifications */
.alert {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-weight: 600;
  font-size: 0.95rem;
}

.alert-success {
  background-color: var(--success-light);
  color: #047857;
  border: 1px solid #a7f3d0;
}

.alert-danger {
  background-color: var(--danger-light);
  color: var(--danger-hover);
  border: 1px solid #fecaca;
}

/* Cards & Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition-normal);
  margin-bottom: 24px;
}

.card:last-child {
  margin-bottom: 0;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 0;
}

.stat-icon {
  padding: 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.primary { background-color: var(--primary-light); color: var(--primary-color); }
.stat-icon.secondary { background-color: var(--secondary-light); color: var(--secondary-color); }
.stat-icon.success { background-color: var(--success-light); color: var(--success-color); }
.stat-icon.danger { background-color: var(--danger-light); color: var(--danger-color); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

/* Modern KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.kpi-card {
  position: relative;
  background: var(--bg-card);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid rgba(226, 232, 240, 0.6);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 100%);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.kpi-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.06);
  border-color: rgba(226, 232, 240, 1);
}

.kpi-card:hover::before {
  opacity: 1;
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.kpi-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.kpi-icon.primary { background: linear-gradient(135deg, var(--primary-light), #e0f2fe); color: var(--primary-color); }
.kpi-icon.secondary { background: linear-gradient(135deg, var(--secondary-light), #fef08a); color: var(--secondary-color); }
.kpi-icon.success { background: linear-gradient(135deg, var(--success-light), #dcfce7); color: var(--success-color); }
.kpi-icon.danger { background: linear-gradient(135deg, var(--danger-light), #fee2e2); color: var(--danger-hover); }

.kpi-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 500;
}

.kpi-trend.up { color: var(--success-color); }
.kpi-trend.down { color: var(--danger-color); }
.kpi-trend.neutral { color: var(--text-muted); }

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

input, select, textarea {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  font-size: 0.95rem;
  transition: var(--transition-fast);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--text-white);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: #cbd5e1;
}

.btn-danger {
  background-color: var(--danger-color);
  color: var(--text-white);
}

.btn-danger:hover {
  background-color: var(--danger-hover);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  margin-top: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

th {
  background-color: #f1f5f9;
  color: var(--text-muted);
  font-weight: 600;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: #f8fafc;
}

/* Patient Search bar */
.search-container {
  position: relative;
  margin-bottom: 24px;
}

.search-input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

/* Floating Search results dropdown */
.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  z-index: 50;
  padding: 8px 0;
  max-height: 320px;
  overflow-y: auto;
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  display: none;
}

.search-dropdown.active {
  display: block;
}

.search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-main);
  transition: background var(--transition-fast);
}

.search-result-item:hover {
  background-color: #f8fafc;
}

.search-result-item:last-child {
  border-bottom: none;
}

/* Prescription Builder Styling */
.prescription-meds-list {
  background-color: #f8fafc;
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.med-row {
  display: grid;
  grid-template-columns: 2.5fr 1fr 1fr 1fr 0.5fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.med-row:last-child {
  margin-bottom: 0;
}

.med-instructions-row {
  grid-column: 1 / span 4;
  margin-top: -6px;
  margin-bottom: 16px;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 24px;
  border-left: 2px solid var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -31px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--primary-color);
  border: 3px solid var(--bg-card);
}

.timeline-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.timeline-content {
  background-color: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

/* Vaccination Checklist Grid */
.vaccine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.vaccine-card {
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.vaccine-info {
  display: flex;
  flex-direction: column;
}

.vaccine-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.vaccine-age {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.vaccine-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge {
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.badge-pending { background-color: #f1f5f9; color: #475569; }
.badge-given { background-color: var(--success-light); color: #047857; }
.badge-skipped { background-color: var(--danger-light); color: var(--danger-hover); }

/* Tabs Navigation */
.tabs-header {
  display: flex;
  gap: 12px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 12px 20px;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition-fast);
}

.tab-btn:hover {
  color: var(--primary-color);
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Standalone Print CSS */
@media print {
  /* Hide standard UI elements */
  .sidebar,
  .btn,
  .page-header,
  .tabs-header,
  .dashboard-grid,
  .search-container,
  .alert,
  .print-controls {
    display: none !important;
  }

  body {
    background-color: #fff !important;
    color: #000 !important;
    font-size: 12pt;
    margin: 0;
    padding: 0;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .prescription-print-container {
    font-family: 'Outfit', sans-serif;
    color: #000;
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100%;
    line-height: 1.25;
  }

  /* ---------------------------------------------------- */
  /* Paper Sizes Styling                                  */
  /* ---------------------------------------------------- */

    /* A4 size styles */
    body.print-size-a4 {
      width: 100%;
      min-height: 100%;
    }
    
    body.print-size-a4 .prescription-print-container {
      width: 100%;
      max-width: none !important;
      padding: 0;
    }
  
    /* A5 size styles */
    body.print-size-a5 {
      width: 100%;
      min-height: 100%;
    }
  
    body.print-size-a5 .prescription-print-container {
      width: 100%;
      max-width: none !important;
      padding: 0;
      font-size: 9.5pt;
    }

  body.print-size-a5 h1 { font-size: 15pt; }
  body.print-size-a5 h2 { font-size: 12pt; }
  body.print-size-a5 h3 { font-size: 10pt; }

  /* Thermal printer size styles (80mm) */
  body.print-size-thermal {
    width: 80mm;
  }

  body.print-size-thermal .prescription-print-container {
    width: 76mm;
    padding: 2mm;
    font-size: 9pt;
    line-height: 1.2;
    color: #000 !important;
  }
  
  body.print-size-thermal * {
    color: #000 !important;
  }

  body.print-size-thermal h1 { font-size: 12pt; }
  body.print-size-thermal h2 { font-size: 10pt; }
  body.print-size-thermal h3 { font-size: 9pt; }
  body.print-size-thermal .prescription-header {
    border-bottom: 1px dashed #000;
    padding-bottom: 6px;
    margin-bottom: 8px;
    text-align: center;
  }
  
  body.print-size-thermal .patient-details-grid {
    grid-template-columns: 1fr;
    gap: 4px;
    border: none;
    background: none;
    padding: 4px 0;
    border-bottom: 1px dashed #000;
    margin-bottom: 8px;
  }

  body.print-size-thermal .rx-icon-container {
    font-size: 14pt;
    margin-bottom: 4px;
  }

  body.print-size-thermal .print-med-item {
    padding: 4px 0;
    border-bottom: 1px dotted #ccc;
  }

  body.print-size-thermal .prescription-footer {
    border-top: 1px dashed #000;
    padding-top: 8px;
    margin-top: 16px;
    text-align: center;
    font-size: 8pt;
  }

  body.print-size-thermal .letterhead-logo {
    display: none;
  }

  /* Thermal printer size styles (58mm) */
  body.print-size-thermal_58 {
    width: 58mm;
  }

  body.print-size-thermal_58 .prescription-print-container {
    width: 54mm;
    padding: 1.5mm;
    font-size: 8pt;
    line-height: 1.15;
    color: #000 !important;
  }

  body.print-size-thermal_58 * {
    color: #000 !important;
  }

  body.print-size-thermal_58 h1 { font-size: 10pt; }
  body.print-size-thermal_58 h2 { font-size: 9pt; }
  body.print-size-thermal_58 h3 { font-size: 8pt; }
  body.print-size-thermal_58 .prescription-header {
    border-bottom: 1px dashed #000;
    padding-bottom: 4px;
    margin-bottom: 6px;
    text-align: center;
  }
  
  body.print-size-thermal_58 .patient-details-grid {
    grid-template-columns: 1fr;
    gap: 3px;
    border: none;
    background: none;
    padding: 3px 0;
    border-bottom: 1px dashed #000;
    margin-bottom: 6px;
  }

  body.print-size-thermal_58 .rx-icon-container {
    font-size: 12pt;
    margin-bottom: 3px;
  }

  body.print-size-thermal_58 .print-med-item {
    padding: 3px 0;
    border-bottom: 1px dotted #ccc;
  }

  body.print-size-thermal_58 .prescription-footer {
    border-top: 1px dashed #000;
    padding-top: 6px;
    margin-top: 12px;
    text-align: center;
    font-size: 7.5pt;
  }

  body.print-size-thermal_58 .letterhead-logo {
    display: none;
  }
}

/* Prescription Preview page styles */
.prescription-print-preview {
  background: white;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  margin: 20px auto;
  box-sizing: border-box;
  line-height: 1.25;
  display: flex;
  flex-direction: column;
}

.preview-size-a4 {
  width: 100%;
  max-width: 595px;
  min-height: 842px;
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
}

.preview-size-a5 {
  width: 100%;
  max-width: 420px;
  min-height: 595px;
  padding: 18px 22px;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
}

.preview-size-thermal {
  width: 100%;
  max-width: 80mm;
  padding: 10px;
  background-color: #f8fafc;
  font-size: 9pt;
  line-height: 1.2;
  color: #000 !important;
  border: 1px dashed #64748b;
}
.preview-size-thermal * {
  color: #000 !important;
}

.preview-size-thermal_58 {
  width: 100%;
  max-width: 58mm;
  padding: 8px;
  background-color: #f8fafc;
  font-size: 8pt;
  line-height: 1.15;
  color: #000 !important;
  border: 1px dashed #64748b;
}
.preview-size-thermal_58 * {
  color: #000 !important;
}

.prescription-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.doctor-info-print h1 {
  color: var(--primary-dark);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 2px 0;
}

.doctor-info-print p {
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: pre-line;
  margin: 0;
  line-height: 1.3;
}

.clinic-info-print {
  text-align: right;
}

.clinic-info-print h2 {
  font-size: 0.95rem;
  color: var(--primary-dark);
  margin: 0 0 2px 0;
}

.clinic-info-print p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.3;
}

.patient-details-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px 10px;
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.patient-details-grid.thermal {
  grid-template-columns: 1fr;
  background: none;
  border: none;
  border-bottom: 1px dashed #000;
  border-top: 1px dashed #000;
  padding: 5px 0;
  border-radius: 0;
}

.detail-item {
  display: flex;
  flex-direction: column;
}

.detail-item span.label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.detail-item span.val {
  font-weight: 600;
  font-size: 0.82rem;
}

.prescription-body {
  display: flex;
  flex: 1;
  gap: 12px;
}

.prescription-body.thermal-layout {
  flex-direction: column;
  gap: 6px;
}

.vitals-side-panel {
  width: 22%;
  border-right: 1px solid var(--border-color);
  padding-right: 10px;
}

.vitals-side-panel.thermal {
  width: 100%;
  border-right: none;
  border-bottom: 1px dashed #000;
  padding-bottom: 6px;
  padding-right: 0;
}

.print-vital-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.print-vital-list li {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.78rem;
}

.print-vital-list.thermal li {
  border-bottom: 1px dotted #ccc;
}

.rx-section {
  flex: 1;
}

.rx-icon-container {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
  margin-bottom: 6px;
}

.print-med-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.print-med-item {
  display: flex;
  flex-direction: column;
  padding-bottom: 4px;
  border-bottom: 1px solid #f1f5f9;
}

.print-med-item.thermal {
  border-bottom: 1px dotted #ccc;
}

.med-name-print {
  font-weight: 700;
  font-size: 0.88rem;
}

.med-instructions-print {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0;
}

.prescription-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.signature-area {
  text-align: center;
  width: 120px;
}

.sig-line {
  border-top: 1px solid #000;
  margin-top: 24px;
  margin-bottom: 3px;
}

/* App Responsive Layout Adjustments */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
    padding: 16px;
    padding-top: 80px; /* Space for mobile header */
    width: 100vw;
    overflow-x: hidden;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
  }

  .page-header > div:nth-child(2) {
    flex-wrap: wrap;
    width: 100%;
  }
  
  .page-header .btn {
    width: 100%;
    justify-content: center;
  }
  
  .search-container {
    flex-direction: column;
  }
  
  .search-container .btn {
    width: 100%;
    padding: 12px !important;
  }

  .search-input {
    font-size: 0.95rem; /* Prevent zoom on iOS */
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }

  .tabs-header {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  
  .med-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .med-instructions-row {
    grid-column: 1 / -1;
    margin-top: 0;
  }
  
  /* Mobile Header */
  .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: var(--bg-sidebar);
    color: var(--text-white);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
  }
  
  .mobile-header .clinic-logo-icon {
    padding: 6px;
    border-radius: var(--radius-sm);
  }

  .mobile-header .clinic-title {
    font-size: 1.1rem;
    line-height: 1.1;
    font-weight: 700;
  }
  
  .mobile-header .clinic-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
  }
  
  .hamburger-btn {
    background: none;
    border: none;
    color: var(--text-white);
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.5);
    z-index: 95;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
  }
  
  .sidebar-backdrop.active {
    display: block;
    opacity: 1;
  }
}

@media (min-width: 769px) {
  .mobile-header {
    display: none !important;
  }
  .sidebar-backdrop {
    display: none !important;
  }
}

/* Pagination Styles */
.pagination {
  display: flex;
  padding-left: 0;
  list-style: none;
  margin: 16px 0;
  justify-content: center;
  gap: 4px;
}
.page-item .page-link {
  position: relative;
  display: block;
  padding: 8px 16px;
  font-size: 0.9rem;
  color: var(--teal-dark, #0f766e);
  text-decoration: none;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  transition: all 0.2s;
}
.page-item.active .page-link {
  z-index: 3;
  color: #fff;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}
.page-item.disabled .page-link {
  color: #94a3b8;
  pointer-events: none;
  background-color: #f8fafc;
  border-color: var(--border-color);
}
.page-link:hover {
  background-color: var(--bg-body);
  color: var(--teal);
}

