/* css/style.css */
* {
    box-sizing: border-box;
  }
  
  body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background: #f5f5f5;
  }
  
  .container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  }
  
  .step {
    display: none;
  }
  
  .step.active {
    display: block;
  }
  
  .step h2 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
  }
  
  label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
  }

  label:first-child {
    margin-top: 0;
  }

  input, textarea, select {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
  }
  
  button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 10px 5px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
  }
  
  button:hover {
    background: #2980b9;
  }
  
  .medications {
    margin: 20px 0;
  }
  
  .medications table {
    width: 100%;
    border-collapse: collapse;
  }
  
  .medications th, .medications td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
  }
  
  .medications th {
    background: #f2f2f2;
  }
  
  .prescription {
    position: relative;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid #ddd;
    background: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    display: flex;
    flex-direction: column;
  }

  /* Top Green Bar */
  .top-green-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 30%;
    height: 25px;
    background: #2E7D32;
  }

  /* Header Section */
.prescription-header {
    position: relative;
    padding: 35px 30px 10px 30px;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr 140px;
    align-items: start;
    column-gap: 16px;
  }

  .doctor-info-section {
    margin-top: 6px;
  }

  .doctor-name {
    font-size: 20px;
    font-weight: 600;
    color: #4CAF50;
    margin-bottom: 4px;
    line-height: 1.2;
  }

  .doctor-qualification {
    font-size: 13px;
    color: #66BB6A;
    font-weight: 500;
  }

  .hospital-info-section {
    text-align: center;
    margin-top: 2px;
  }

  .hospital-slogan {
    font-size: 12px;
    color: #999;
    margin-bottom: 3px;
    font-weight: 400;
  }

  .hospital-name {
    font-size: 22px;
    font-weight: 700;
    color: #4CAF50;
    margin-bottom: 8px;
  }

  .header-dotted-line {
    border-top: 1px dashed #ccc;
    width: 100%;
    margin: 6px auto 0 auto;
  }

  /* Pill Graphic */
  .pill-graphic {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 120px;
    height: 120px;
    z-index: 1;
  }

  .pill-graphic svg {
    width: 100%;
    height: 100%;
  }

  .pill-graphic img.pill-graphic-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  /* Patient Info Section */
.patient-info-section {
    display: grid;
    grid-template-columns: 80px 1fr;
    align-items: center;
    padding: 10px 30px 0 30px;
    margin-bottom: 10px;
    column-gap: 20px;
  }

  .rx-symbol {
    font-size: 72px;
    font-weight: bold;
    color: #2E7D32;
    line-height: 1;
    font-family: 'Times New Roman', serif;
    flex-shrink: 0;
  }

.patient-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 8px;
    align-items: end;
  }

  .patient-field {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }

  .field-label {
    font-size: 14px;
    color: #999;
    font-weight: 400;
    white-space: nowrap;
  }

.field-value {
    font-size: 14px;
    color: #333;
    border-bottom: 1px dotted #ccc;
    min-width: 90px;
    padding-bottom: 2px;
    display: inline-block;
    width: 100%;
  }

  .field-value:empty::before {
    content: '';
    border-bottom: 1px dotted #ccc;
    display: block;
    width: 100%;
    height: 10px;
  }

  /* Prescription Body */
.prescription-body {
    min-height: 400px;
    padding: 10px 30px 20px 30px;
    margin-bottom: 80px;
  }

  .diagnosis-section {
    margin-bottom: 20px;
    font-size: 14px;
    color: #333;
  }

  .medications-section {
    margin-bottom: 20px;
  }

  .medication-item {
    margin-bottom: 15px;
    font-size: 14px;
    color: #333;
    line-height: 1.8;
  }

  .med-instructions {
    font-size: 13px;
    color: #666;
    font-style: italic;
  }

  .next-visit-section,
  .follow-up-section {
    margin-bottom: 15px;
    font-size: 14px;
    color: #333;
  }

.prescription .signature-container {
    margin-top: 40px;
    text-align: left;
    padding-right: 20px;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 260px;
    margin-left: auto;
  }

  .prescription .doctor-signature {
    max-width: 200px;
    max-height: 80px;
    object-fit: contain;
  }

  .signature-meta {
    margin-top: 6px;
    text-align: left;
    font-size: 12px;
    color: #444;
    line-height: 1.4;
  }

  .signature-label {
    font-weight: 600;
    color: #2E7D32;
  }

  .signature-doctor {
    font-weight: 600;
  }

  .signature-details {
    font-size: 12px;
    color: #666;
  }

  /* Footer Section */
  .prescription-footer {
    position: relative;
    margin-top: auto;
    padding-bottom: 25px;
  }

  .footer-contact {
    padding: 15px 20px 15px 20px;
    text-align: center;
    font-size: 12px;
    color: #333;
  }

  .footer-address {
    margin-bottom: 5px;
    color: #666;
  }

  .footer-contact-info {
    color: #666;
  }

  /* Bottom Green Bar */
  .bottom-green-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 25px;
    background: #2E7D32;
  }

  .medication {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fafafa;
  }

  .medication label {
    margin-top: 10px;
  }

  .medication label:first-child {
    margin-top: 0;
  }

  /* Preview Container */
  #prescriptionPreview {
    width: 100%;
    overflow-x: auto;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 4px;
  }

  #prescriptionPreview .prescription {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  }
  