:root {
  --primary: #FF6A13; /* Master's Homeopathy Orange */
  --secondary: #16A34A; /* Master's Homeopathy Green */
  --secondary-dark: #15803D;
  --dark: #1F2937;
  --light: #F3F4F6;
  --white: #FFFFFF;
  --border: #E5E7EB;
  --text-main: #374151;
  --text-muted: #6B7280;
  
  --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-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--light);
  color: var(--text-main);
  line-height: 1.5;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
}

header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.logo-container img {
  width: auto;
  height: 60px;
}

h1, h2, h3, h4 {
  color: var(--dark);
}

.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.card-header {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--light);
  color: var(--primary);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
}

input, select, textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s;
  background-color: #F9FAFB;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
  background-color: var(--white);
}

button {
  cursor: pointer;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--secondary);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--secondary-dark);
}

.btn-secondary {
  background-color: var(--primary);
  color: var(--white);
}

.btn-secondary:hover {
  background-color: #e65c00;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--border);
}

.summary-row.total {
  font-size: 1.25rem;
  font-weight: 700;
  border-top: 2px solid var(--border);
  border-bottom: none;
  margin-top: 0.5rem;
  color: var(--dark);
}

/* Print Styles - Only for Half A4 (A5 size) */
@media print {
  @page {
    size: A5 portrait; /* Half A4 is approx A5 */
    margin: 10mm;
  }
  
  .app-container {
    display: none !important;
  }
  
  #invoice-print-area {
    display: block !important;
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    font-size: 12px;
  }
  
  .invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    margin-bottom: 15px;
  }
  
  .invoice-logo img {
    height: 40px;
  }
  
  .invoice-clinic-info {
    text-align: right;
    font-size: 11px;
  }
  
  .invoice-clinic-info h2 {
    color: var(--primary);
    margin: 0 0 4px 0;
    font-size: 16px;
  }
  
  .invoice-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-weight: bold;
  }
  
  .patient-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 4px;
  }
  
  .invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
  }
  
  .invoice-table th {
    background-color: var(--secondary);
    color: white !important;
    padding: 8px;
    text-align: left;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  .invoice-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border);
  }
  
  .invoice-table .amount {
    text-align: right;
  }
  
  .invoice-totals {
    width: 200px;
    margin-left: auto;
  }
  
  .invoice-totals .row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
  }
  
  .invoice-totals .row.final-total {
    font-weight: bold;
    font-size: 14px;
    border-top: 1px solid var(--dark);
    padding-top: 8px;
  }
  
  .invoice-footer {
    margin-top: 30px;
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 10px;
  }
}
