@page {
    size: 3.5in 8.5in;
    margin: 0;
}

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

:root {
    --primary: #EC4899;
    --primary-rgb: 236, 72, 153;
    --secondary: #F472B6;
    --secondary-rgb: 244, 114, 182;
    --accent: #BE185D;
    --accent-rgb: 190, 24, 93;
    --text-primary: #1F2937;
    --text-secondary: #4B5563;
    --text-tertiary: #9CA3AF;
    --bg-primary: #FFFFFF;
    --bg-secondary: #FCE7F3;
    --bg-tertiary: #FBCFE8;
    --border-color: #F9A8D4;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --font-display: 'Bebas Neue', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    font-family: var(--font-body);
    font-size: 8pt;
    line-height: 1.8;
    color: var(--text-primary);
    font-weight: 400;
}

.drug-sheet {
    width: 3.5in;
    height: 8.5in;
    padding: 0.15in;
    padding-bottom: 0;
    background: white;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    
}

.drug-sheet::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: transparent;
    transform: rotate(45deg);
    pointer-events: none;
}

/* For screen preview */
@media screen {
    body {
        background: white;
        padding: 0;
    }
    
    .drug-sheet {
        box-shadow: none;
        margin: 0;
    }
}

/* Print styles */
@media print {
    body {
        margin: 0;
        padding: 0;
    }
    
    .drug-sheet {
        margin: 0;
        box-shadow: none;
        page-break-after: always;
    }
    
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* Content styles */
#header-container {
    flex-shrink: 0;
    height: auto;
}

.content-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    margin-bottom: 0;
    padding-bottom: 10px;
    min-height: 0;
}

.section {
    margin-bottom: 3px;
}

.section:last-child {
    margin-bottom: 0;
}

.section h2 {
    font-family: var(--font-display);
    font-size: 9.0pt;
    margin-bottom: 1px;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 400;
    position: relative;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 30px;
    height: 1px;
    background: var(--primary);
}

.medication-table {
    width: 100%;
    font-size: 6pt;
    border-collapse: collapse;
    table-layout: fixed;
}

.medication-table tr {
    border-bottom: 1px solid var(--bg-tertiary);
}

.medication-table tr:last-child {
    border-bottom: none;
}

.medication-table td {
    padding: 0.5px 2px;
    vertical-align: top;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.medication-table td:first-child {
    width: 55%;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 7.1pt;
}

.medication-table td:nth-child(2),
.medication-table td:last-child {
    color: var(--text-secondary);
    padding-left: 0;
    font-size: 6.8pt;
}

/* Copay table specific styles */
.copay-table {
    width: 100%;
    font-size: 6.5pt;
    border-collapse: collapse;
    table-layout: fixed;
}

.copay-table thead {
    background: var(--bg-secondary);
}

.copay-table th {
    padding: 2px 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 6pt;
    color: var(--primary);
    border-bottom: 2px solid var(--border-color);
}

.copay-table th:first-child {
    text-align: left;
    width: 50%;
}

.copay-table th:nth-child(2),
.copay-table th:nth-child(3) {
    text-align: center;
    width: 25%;
}

.copay-table tbody tr {
    border-bottom: 1px solid var(--bg-tertiary);
}

.copay-table tbody tr:last-child {
    border-bottom: none;
}

    background: var(--bg-tertiary);
}

.copay-table td {
    padding: 1px 4px;
    vertical-align: middle;
}

.copay-table td:first-child {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 7pt;
}

.copay-table td:nth-child(2),
.copay-table td:nth-child(3) {
    text-align: center;
    color: var(--text-secondary);
}

.copay-amount {
    font-weight: 600;
    color: var(--primary);
    font-size: 7pt;
}

.copay-note {
    font-style: italic;
    font-size: 6.5pt;
    color: var(--text-secondary);
    line-height: 1.2;
}

/* Back page table styles */
.info-table {
    width: 100%;
    font-size: 6.5pt;
    border-collapse: collapse;
}

.info-table th,
.info-table td {
    padding: 3px 4px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.info-table thead tr {
    background: var(--bg-secondary);
}

.info-table th {
    font-weight: 600;
    color: var(--primary);
    font-size: 6pt;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.info-table tbody tr:nth-child(even) {
    background: var(--bg-tertiary);
}

.info-table td {
    color: var(--text-secondary);
}

.info-table td:first-child {
    font-weight: 500;
    color: var(--text-primary);
}