:root {
    --bg-primary: #1a1f2e;
    --bg-secondary: #242b3d;
    --bg-tertiary: #2d3548;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --accent-pink: #ec4899;
    --accent-blue: #3b82f6;
    --accent-green: #22c55e;
    --accent-orange: #f97316;
    --border-color: #374151;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

header {
    background-color: var(--bg-secondary);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
}

header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

header .subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.container-full {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.tabs-container {
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.tabs {
    display: flex;
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.tab {
    flex: 1;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.tab.active {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    border-bottom: 2px solid var(--accent-pink);
    margin-bottom: -1px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content .panel {
    border: none;
    border-radius: 0;
}

.panel {
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.panel-header {
    background-color: var(--bg-tertiary);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.panel-body {
    padding: 1.5rem;
}

textarea {
    width: 100%;
    min-height: 300px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    padding: 1rem;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

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

.btn-primary:hover:not(:disabled) {
    opacity: 0.9;
}

.btn-primary:disabled {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem;
}

/* Error message styles */
.error-message {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    border-radius: 0.375rem;
    color: #fca5a5;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message::before {
    content: "⚠";
    font-size: 1rem;
}

/* =============================================================================
   ORDER CARD STYLES
   ============================================================================= */

.order-card {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    user-select: none;
    background-color: var(--bg-tertiary);
}

.order-header:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.order-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.order-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.order-id-display {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.order-header .patient-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background-color 0.2s;
}

.copy-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.1);
}

.chevron {
    color: var(--text-secondary);
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.order-card.expanded .chevron {
    transform: rotate(180deg);
}

.order-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: var(--bg-secondary);
}

.order-card.expanded .order-content {
    max-height: 3000px;
    transition: max-height 0.5s ease-in;
}

.order-details {
    padding: 1.25rem;
}

.patient-dob-row {
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.patient-dob-label {
    color: var(--text-primary);
    font-weight: 500;
}

.patient-dob-value {
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

/* Group sections */
.group-section {
    margin-bottom: 1.25rem;
}

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

.group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.group-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-blue {
    background-color: var(--accent-blue);
    color: white;
}

.badge-orange {
    background-color: var(--accent-orange);
    color: white;
}

.badge-green {
    background-color: var(--accent-green);
    color: white;
}

.item-count {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

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

/* Item accordion */
.item-accordion {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    overflow: hidden;
}

.item-row-header {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.item-row-header:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.item-row-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 1rem;
}

.item-accordion.expanded .item-row-content {
    max-height: 600px;
    padding: 1rem;
    transition: max-height 0.4s ease-in;
}

.item-id-link {
    color: var(--accent-blue);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
}

.item-drug-name {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    flex: 1;
    text-align: right;
}

/* Print Label Button */
.print-label-btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.625rem 1.25rem;
    background-color: var(--accent-blue);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.print-label-btn:hover {
    background-color: #2563eb;
}

/* Item row cards (legacy - keep for compatibility) */
.item-row-card,
.shipment-row-card,
.pouch-item-row,
.pouch-preview-row {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s ease;
}

.item-row-card:hover,
.shipment-row-card:hover,
.pouch-preview-row:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.item-id-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
}

.item-id-link:hover {
    text-decoration: underline;
}

.item-drug-name {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    flex: 1;
    text-align: right;
}

.pouch-type-tag {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-left: 1rem;
}

/* Shipment row */
.shipment-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
}

.shipment-link:hover {
    text-decoration: underline;
}

.shipment-carrier {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

/* Pouch preview row */
.pouch-preview-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
}

.pouch-preview-link:hover {
    text-decoration: underline;
}

.pouch-med-count {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

/* Pouch item row specific */
.pouch-item-row {
    gap: 1rem;
}

.pouch-item-row .item-drug-name {
    flex: 1;
    text-align: left;
    margin-left: 0.5rem;
}
    user-select: none;
}

.item-accordion-header:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.item-accordion-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.item-accordion-id {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.item-accordion-drug {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.item-accordion-chevron {
    width: 1rem;
    height: 1rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.item-accordion.expanded .item-accordion-chevron {
    transform: rotate(180deg);
}

.item-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.item-accordion.expanded .item-accordion-content {
    max-height: 500px;
    transition: max-height 0.4s ease-in;
}

.item-accordion-content-inner {
    padding: 1rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-accordion-content-inner .item-detail {
    display: flex;
    gap: 0.5rem;
}

.item-accordion-content-inner .item-detail-label {
    font-weight: 500;
    color: var(--text-primary);
    min-width: 80px;
}

.item-accordion-content-inner .item-detail-value {
    color: var(--text-secondary);
}


/* Pouch group card styles for grouped pouch items */
.pouch-group-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.pouch-group-card:last-child {
    margin-bottom: 0;
}

.pouch-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    background-color: rgba(34, 197, 94, 0.08);
    border-bottom: 1px solid var(--border-color);
}

.pouch-group-header .pouch-type {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--accent-green);
}

.pouch-group-header .pouch-item-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.pouch-group-items {
    padding: 0.5rem 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.pouch-group-items .item-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0;
}

.pouch-group-items .item-row .item-id {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--text-primary);
    min-width: 60px;
}

.pouch-group-items .item-row .item-drug {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}


/* =============================================================================
   VIAL LABEL PREVIEW STYLES (PHRM-2455)
   ============================================================================= */

/* Item accordion for individual labels */
.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    user-select: none;
    background-color: var(--bg-primary);
}

.item-header:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.item-header .item-id {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.item-header .item-drug {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    flex: 1;
    margin-left: 1rem;
}

.item-chevron {
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.item-accordion.expanded .item-chevron {
    transform: rotate(180deg);
}

.item-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.item-accordion.expanded .item-content {
    max-height: 800px;
    transition: max-height 0.5s ease-in;
}

/* Label preview wrapper - miniaturized label */
.label-preview-wrapper {
    max-width: 475px;
    margin: 1rem auto;
    background: white;
    border: 1px solid #000;
    border-radius: 4px;
    aspect-ratio: 4.75 / 2.5;
    overflow: hidden;
    transform-origin: top center;
}

/* Scale down the label content for preview */
.label-preview-wrapper .label-content {
    font-size: 8px;
    height: 100%;
    color: #1a1a1a;
}

.label-preview-wrapper .label-body {
    display: flex;
    height: 100%;
}

.label-preview-wrapper .label-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 4px 4px 3px 4px;
    min-width: 0;
}

.label-preview-wrapper .label-right-sidebar {
    width: 32px;
    border-left: 1px solid #999;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3px 2px;
    flex-shrink: 0;
}

.label-preview-wrapper .pharmacy-header {
    border-bottom: 1px solid #000;
    padding-bottom: 2px;
    margin-bottom: 2px;
}

.label-preview-wrapper .pharmacy-header-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.label-preview-wrapper .pharmacy-name {
    font-weight: bold;
    font-size: 9px;
    color: #000;
}

.label-preview-wrapper .rx-number {
    font-weight: bold;
    font-size: 8px;
    white-space: nowrap;
    color: #000;
}

.label-preview-wrapper .pharmacy-details {
    font-size: 5px;
    color: #000;
}

.label-preview-wrapper .label-center-area {
    flex: 1;
    min-height: 0;
}

.label-preview-wrapper .patient-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}

.label-preview-wrapper .patient-name-value {
    font-size: 10px;
    font-weight: bold;
    color: #000;
}

.label-preview-wrapper .patient-dob {
    font-size: 6px;
    color: #000;
}

.label-preview-wrapper .drug-section {
    padding: 3px 4px;
    margin-bottom: 3px;
    border-radius: 2px;
    border: 1px solid #000;
}

.label-preview-wrapper .drug-name {
    font-size: 8px;
    font-weight: bold;
    color: #000;
    display: block;
}

.label-preview-wrapper .generic-name {
    font-size: 6px;
    color: #000;
    display: block;
}

.label-preview-wrapper .description {
    font-size: 6px;
    color: #000;
    font-style: italic;
    display: block;
}

.label-preview-wrapper .sig-section {
    margin-bottom: 3px;
}

.label-preview-wrapper .sig-box {
    padding: 2px 3px;
    border-radius: 2px;
    font-size: 7px;
    font-weight: 600;
    border: 1px solid #000;
    color: #000;
    height: 30px;
    overflow: hidden;
    line-height: 1.3;
}

.label-preview-wrapper .sig-label {
    font-weight: 800;
}

.label-preview-wrapper .label-field {
    margin-bottom: 1px;
}

.label-preview-wrapper .label-field-name {
    font-size: 5px;
    text-transform: uppercase;
    color: #000;
    font-weight: 600;
}

.label-preview-wrapper .label-field-value {
    font-size: 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #000;
}

.label-preview-wrapper .truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.label-preview-wrapper .label-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 3px;
    margin-bottom: 2px;
}

.label-preview-wrapper .label-static-warnings {
    border-top: 1px solid #999;
    padding-top: 2px;
    margin-top: auto;
}

.label-preview-wrapper .static-warning {
    font-size: 5px;
    color: #000;
    line-height: 1.2;
    font-weight: 600;
}

.label-preview-wrapper .label-bottom-row {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 2px;
    padding-top: 2px;
    border-top: 1px solid #ddd;
}

.label-preview-wrapper .payload-warnings {
    display: flex;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.label-preview-wrapper .payload-warning-box {
    flex: 1;
    border: 1px solid #000;
    border-radius: 2px;
    padding: 1px 2px;
    font-size: 5px;
    color: #000;
    text-align: center;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.label-preview-wrapper .vertical-barcode {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.label-preview-wrapper .vertical-barcode svg {
    transform: rotate(90deg);
    max-height: 100%;
    max-width: 100%;
}

/* Item actions (Print Label button) */
.item-actions {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.print-label-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background-color: var(--accent-blue);
    color: white;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.print-label-btn:hover {
    background-color: #2563eb;
}


/* =============================================================================
   POUCH LABEL PREVIEW STYLES (PHRM-2456)
   ============================================================================= */

.pouch-preview-scale-wrapper {
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
}

.pouch-preview-scale-wrapper .pouch-label-wrapper {
    width: 6in;
    height: 8in;
    border: 2px solid #000;
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    transform: scale(0.55);
    transform-origin: top center;
    margin-bottom: -290px;
}

.pouch-preview-scale-wrapper .pouch-label-header {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px 0 10px;
    border-bottom: 2px solid #000;
    flex-shrink: 0;
}

.pouch-preview-scale-wrapper .pouch-header-left {
    flex: 1;
}

.pouch-preview-scale-wrapper .pouch-header-right {
    text-align: right;
    font-size: 9px;
    line-height: 1.4;
    white-space: nowrap;
}

.pouch-preview-scale-wrapper .pouch-patient-name {
    font-size: 16px;
    font-weight: bold;
    line-height: 1.2;
}

.pouch-preview-scale-wrapper .pouch-patient-detail {
    font-size: 9px;
    line-height: 1.4;
}

.pouch-preview-scale-wrapper .pouch-med-dates {
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    padding: 2px 10px 4px 10px;
    flex-shrink: 0;
}

.pouch-preview-scale-wrapper .pouch-items-container {
    padding: 2px 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 0;
    flex: 1;
}

.pouch-preview-scale-wrapper .pouch-item-block {
    border-bottom: 1px solid #000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.pouch-preview-scale-wrapper .pouch-item-drug-name {
    font-size: 11px;
    font-weight: bold;
    padding: 1px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 16px;
    flex-shrink: 0;
}

.pouch-preview-scale-wrapper .pouch-item-body {
    display: flex;
    font-size: 7.5px;
    line-height: 1.3;
    height: 42px;
    overflow: hidden;
    flex-shrink: 0;
}

.pouch-preview-scale-wrapper .pouch-item-details {
    flex: 1;
    padding: 1px 6px;
    min-width: 0;
}

.pouch-preview-scale-wrapper .pouch-item-details-row {
    display: flex;
    gap: 8px;
}

.pouch-preview-scale-wrapper .pouch-item-details-row > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pouch-preview-scale-wrapper .pouch-detail-label {
    font-weight: bold;
}

.pouch-preview-scale-wrapper .pouch-item-sig {
    width: 45%;
    padding: 1px 5px;
    font-size: 7.5px;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
}

.pouch-preview-scale-wrapper .pouch-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1px 6px;
    font-size: 7.5px;
    line-height: 1.3;
    height: 12px;
    flex-shrink: 0;
}

.pouch-preview-scale-wrapper .pouch-footer-left {
    display: flex;
    gap: 8px;
}

.pouch-preview-scale-wrapper .pouch-footer-left > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pouch-preview-scale-wrapper .pouch-footer-barcode {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.pouch-preview-scale-wrapper .pouch-label-footer {
    border-top: 2px solid #000;
    display: flex;
    padding: 4px 8px;
    gap: 8px;
    align-items: flex-start;
    flex-shrink: 0;
    margin-top: auto;
}

.pouch-preview-scale-wrapper .pouch-footer-caution {
    flex: 1;
    font-size: 7.5px;
    font-weight: 600;
    line-height: 1.3;
}

.pouch-preview-scale-wrapper .pouch-footer-warning {
    flex: 1;
    font-size: 7.5px;
    font-weight: 700;
    line-height: 1.3;
    border-left: 1px solid #000;
    padding-left: 8px;
}

.pouch-preview-scale-wrapper .pouch-footer-brand {
    width: 80px;
    border-left: 1px solid #000;
    padding-left: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pouch-preview-scale-wrapper .pouch-footer-logo {
    max-width: 70px;
    max-height: 24px;
    object-fit: contain;
}

.pouch-preview-scale-wrapper .pouch-start-box-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 10px 2px 10px;
    font-size: 12px;
    font-weight: bold;
}

.pouch-preview-scale-wrapper .pouch-start-box-row .page-indicator {
    text-align: left;
}

.pouch-preview-scale-wrapper .pouch-start-box-row .start-box-date {
    text-align: right;
}

.pouch-preview-scale-wrapper .page-break {
    page-break-after: always;
}

/* Print Combined Pouch Label Button */
.print-pouch-label-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    background-color: var(--accent-green);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
    margin-top: 0.75rem;
}

.print-pouch-label-btn:hover {
    background-color: #16a34a;
}


/* =============================================================================
   DISABLED PRINT BUTTON STYLES (PHRM-2457)
   ============================================================================= */

.print-btn.disabled,
.print-label-btn.disabled,
.print-pouch-label-btn.disabled {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
}

.print-btn.disabled:hover,
.print-label-btn.disabled:hover,
.print-pouch-label-btn.disabled:hover {
    background-color: var(--bg-tertiary);
}


/* Output tab actions (Clear button) */
.output-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}


/* =============================================================================
   RXSAFE PREVIEW STYLES (PHRM-2742)
   ============================================================================= */

.rxsafe-section {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-top: 1rem;
    overflow: hidden;
}

.rxsafe-section .group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.badge-purple {
    background-color: #8b5cf6;
    color: white;
}

.validation-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

.validation-status.status-success {
    color: var(--accent-green);
}

.validation-status.status-error {
    color: #ef4444;
}

.validation-status .status-icon {
    font-size: 0.875rem;
}

.validation-errors {
    background-color: rgba(239, 68, 68, 0.1);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
}

.validation-errors-header {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fca5a5;
    margin-bottom: 0.5rem;
}

.validation-errors .error-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.375rem 0;
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

.validation-errors .error-item:last-child {
    border-bottom: none;
}

.validation-errors .error-field {
    font-size: 0.75rem;
    font-family: 'Monaco', 'Menlo', monospace;
    color: #fca5a5;
}

.validation-errors .error-message {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}

.validation-errors .error-message::before {
    content: none;
}

.rxsafe-patient-info {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.rxsafe-patient-info .patient-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.rxsafe-patient-info .patient-dob {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.rxsafe-schedule {
    padding: 0.75rem 1rem;
}

.day-accordion {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.day-accordion:last-child {
    margin-bottom: 0;
}

.day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    user-select: none;
}

.day-header:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.day-header .day-date {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.day-header .dose-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: auto;
    margin-right: 0.75rem;
}

.day-header .chevron {
    color: var(--text-secondary);
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.day-content {
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    background-color: var(--bg-tertiary);
}

.time-group {
    margin-bottom: 0.75rem;
}

.time-group:last-child {
    margin-bottom: 0;
}

.time-header {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent-blue);
    margin-bottom: 0.375rem;
    padding-left: 0.25rem;
}

.medications-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.medication-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    background-color: var(--bg-primary);
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    overflow: hidden;
}

.med-qty-box {
    flex: 0 0 60px;
    padding: 0.5rem;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    border-right: 1px solid var(--border-color);
}

.med-drug-box {
    flex: 1;
    padding: 0.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    border-right: 1px solid var(--border-color);
}

.med-sig-box {
    flex: 2;
    padding: 0.5rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    font-size: 0.75rem;
}

.rxsafe-actions {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.download-rxsafe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background-color: #8b5cf6;
    color: white;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.download-rxsafe-btn:hover:not(.disabled) {
    background-color: #7c3aed;
}

.download-rxsafe-btn.disabled {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
}

/* RxSafe Preview Container and Loading State */
.rxsafe-preview-container {
    margin-top: 1rem;
}

.rxsafe-loading {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
}
