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

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

:root {
    --primary: #E60076;
    --primary-rgb: 230, 0, 118;
    --secondary: #60B1C4;
    --secondary-rgb: 96, 177, 196;
    --accent: #FFB800;
    --accent-rgb: 255, 184, 0;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-tertiary: #94A3B8;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --bg-tertiary: #F1F5F9;
    --border-color: #E2E8F0;
    --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: 36%;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 7.1pt;
}

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

.medication-table td:last-child {
    width: 30%;
    text-align: right;
    color: var(--text-secondary);
    font-size: 6.8pt;
}