/* ============================================== */
/* ProArts Dental Lab Prescription v2.0 - Styles */
/* ============================================== */

/* ============================================== */
/* SECTION: RESET & BASE STYLES                  */
/* ============================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, 'Segoe UI', Arial, sans-serif;
    font-size: 11pt;
    line-height: 1.4;
    color: #333;
    background: #f0f0f0;
    padding: 20px;
}

/* ============================================== */
/* SECTION: CSS VARIABLES - BRAND COLORS         */
/* ============================================== */
/* Brand colors */
:root {
    --brand-blue: #1b5e7f;
    --brand-gray: #9b9b9b;
    --light-bg: #f8f9fa;
    --border-color: #d0d0d0;
    --success-green: #27ae60;
    --danger-red: #e74c3c;
    --rush-red: #dc3545;
    --warning-yellow: #f39c12;
}

/* ============================================== */
/* SECTION: MAIN CONTAINER & LAYOUT              */
/* ============================================== */
/* Main container - spacious for editing */
.prescription-form {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    border-radius: 8px;
    overflow: visible;
    position: relative;
}

/* RUSH Banner */
.rush-banner {
    display: none;
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--rush-red);
    color: white;
    padding: 6px 25px;
    font-size: 14pt;
    font-weight: bold;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    z-index: 100;
}

.rush-banner.active {
    display: block;
}

/* ============================================== */
/* SECTION: HEADER STYLES                        */
/* ============================================== */
/* Header */
.header {
    background: white;
    border-bottom: 3px solid var(--brand-blue);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
    min-height: 100px;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 40px;
    height: 100%;
}

.lab-use-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lab-use-boxes {
    display: flex;
    gap: 15px;
}

.lab-box {
    width: 120px;
    height: 70px;
    border: 3px solid var(--brand-blue);
    background: #fffef5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 5px;
}

.lab-box-title {
    font-size: 9pt;
    font-weight: bold;
    color: var(--brand-blue);
    line-height: 1;
}

.lab-box-content {
    font-size: 16pt;
    font-weight: bold;
    color: #333;
    margin-top: 5px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    height: 80px;
    width: auto;
    align-self: center;
}

.contact-info {
    text-align: center;
    font-size: 12pt;
    color: #333;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ============================================== */
/* SECTION: MAIN CONTENT LAYOUT                  */
/* ============================================== */
/* Main Layout - 2 columns top, full width bottom */
.main-content {
    padding: 20px;
}

.top-row {
    display: grid;
    grid-template-columns: 0.4fr 0.6fr;
    gap: 20px;
    margin-bottom: 20px;
}

.bottom-row {
    width: 100%;
}

/* Section Styling */
.section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
}

.section-header {
    font-size: 11pt;
    font-weight: bold;
    color: var(--brand-blue);
    border-bottom: 2px solid var(--brand-blue);
    padding-bottom: 5px;
    margin-bottom: 10px;
}

/* Form Fields */
.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.form-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevent overflow */
}

.form-field label {
    font-size: 9pt;
    color: #666;
    margin-bottom: 2px;
}

.form-field input,
.form-field select {
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 10pt;
    background: white;
    width: 100%;
    box-sizing: border-box;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 2px rgba(27, 94, 127, 0.1);
}

/* Ensure number input spinners are visible */
input[type="number"] {
    -moz-appearance: auto; /* Firefox - show spinners */
    -webkit-appearance: auto; /* Safari/Chrome */
    appearance: auto;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
    height: auto;
    cursor: pointer;
}

.required {
    color: var(--danger-red);
}

/* Tooth Chart - Anatomically Accurate */
#toothChart {
    width: 100%;
    height: auto;
    min-height: 120px;
    display: block;
    margin: 10px 0;
}

.tooth {
    cursor: pointer;
}

.tooth-surface {
    fill: url(#toothGradient);
    stroke: #444;
    stroke-width: 1;
    transition: all 0.2s;
}

.tooth-groove {
    fill: none;
    stroke: #999;
    stroke-width: 0.5;
    opacity: 0.6;
}

.tooth-cusp {
    fill: #fff;
    opacity: 0.4;
}

.tooth:hover .tooth-surface {
    fill: url(#toothHoverGradient);
    stroke: var(--brand-blue);
    stroke-width: 1.5;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.tooth.selected .tooth-surface {
    fill: var(--brand-blue) !important;
    stroke: var(--brand-blue);
    stroke-width: 2;
    filter: drop-shadow(0 2px 4px rgba(33,150,243,0.4));
}

.tooth.extraction .tooth-surface {
    fill: var(--danger-red) !important;
    stroke: var(--danger-red);
    stroke-width: 2;
}

.tooth.missing .tooth-surface {
    fill: #ff9800 !important;
    stroke: #ff9800;
    stroke-width: 2;
}

.tooth-number-label {
    font-size: 9px;
    fill: #444;
    text-anchor: middle;
    pointer-events: none;
    font-weight: 600;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

.tooth.missing path {
    fill: #e0e0e0;
    stroke: #999;
    stroke-dasharray: 2,2;
}

.tooth text {
    fill: #333;
    font-size: 9px;
    font-weight: bold;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}

.tooth.selected text,
.tooth.extraction text,
.tooth.missing text {
    fill: white !important;
    font-weight: bold;
}

/* Tooth Controls */
.tooth-controls {
    display: block;
    margin-top: 8px;
    margin-bottom: 15px;
}

.tooth-btn {
    padding: 8px 16px;
    border: 2px solid var(--brand-blue);
    border-radius: 4px;
    background: white;
    color: var(--brand-blue);
    cursor: pointer;
    font-size: 10pt;
    font-weight: 600;
    min-width: 110px;
    transition: all 0.2s;
}

.tooth-btn:hover {
    background: var(--brand-blue);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* Selected Teeth Display */
.selected-teeth-display {
    padding: 8px;
    background: #e8f4ff;
    border-radius: 4px;
    margin-top: 8px;
    min-height: 30px;
    font-size: 10pt;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.selected-count {
    font-weight: bold;
    color: var(--brand-blue);
}

/* Workflow Section */
.workflow-step {
    padding: 10px;
    background: var(--light-bg);
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.step-number {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: var(--brand-blue);
    color: white;
    text-align: center;
    line-height: 24px;
    border-radius: 50%;
    font-size: 10pt;
    font-weight: bold;
    margin-right: 8px;
}

.step-title {
    font-weight: bold;
    color: var(--brand-blue);
    font-size: 10pt;
    margin-bottom: 8px;
}

/* Type Grid */
.type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.type-btn {
    padding: 10px 8px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 10pt;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.type-btn:hover {
    background: var(--light-bg);
    border-color: var(--brand-blue);
}

.type-btn.active {
    background: var(--brand-blue);
    color: white;
    border-color: var(--brand-blue);
}

/* Option Header - Consistent spacing for all types */
.option-header {
    min-height: 40px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Crown Type Selection */
.crown-type-select {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
}

.crown-type-btn {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 10pt;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
    min-width: 100px;
    height: 36px;
}

.crown-type-btn:hover {
    background: var(--light-bg);
    border-color: var(--brand-blue);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.crown-type-btn.active {
    background: var(--brand-blue);
    color: white;
    border-color: var(--brand-blue);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* Info Box */
.info-box {
    padding: 8px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 9pt;
    color: #856404;
}

.info-box.warning {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.info-box.info {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    color: var(--brand-blue);
    font-weight: bold;
    margin-left: 5px;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 4px;
    padding: 8px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    font-size: 9pt;
    font-weight: normal;
    line-height: 1.3;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
}

/* Add Button */
.add-btn {
    width: 100%;
    padding: 10px;
    background: var(--success-green);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 10pt;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.add-btn:hover {
    background: #229954;
}

.add-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Procedures Table */
.procedures-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
}

.procedures-table th {
    background: var(--brand-blue);
    color: white;
    padding: 6px;
    text-align: left;
}

.procedures-table td {
    padding: 5px 6px;
    border-bottom: 1px solid #e0e0e0;
}

.procedures-table tbody tr:hover {
    background: var(--light-bg);
}

.delete-btn {
    padding: 2px 8px;
    background: var(--danger-red);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 9pt;
}

.edit-btn {
    background: #fff;
    color: #1b5e7f;
    border: 1px solid #1b5e7f;
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 9pt;
    font-weight: 600;
    margin-right: 4px;
}

.edit-btn:hover { background: #1b5e7f; color: #fff; }


/* Workflow badge */
.workflow-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #e3f2fd;
    color: var(--brand-blue);
    border-radius: 3px;
    font-size: 8pt;
    font-weight: bold;
    margin-left: 5px;
}

/* Rich Text Editor for Instructions */
.instructions-toolbar {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
    padding: 5px;
    background: var(--light-bg);
    border-radius: 3px 3px 0 0;
}

.toolbar-btn {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 9pt;
}

.toolbar-btn:hover {
    background: #e0e0e0;
}

.toolbar-btn.active {
    background: var(--brand-blue);
    color: white;
}

.instructions-box {
    width: 100%;
    min-height: 150px;
    padding: 8px;
    border: 1px solid #999;
    border-radius: 0 0 3px 3px;
    font-size: 10pt;
    resize: vertical;
}

.instructions-editor {
    width: 100%;
    min-height: 150px;
    padding: 8px;
    border: 1px solid #999;
    border-radius: 0 0 3px 3px;
    font-size: 10pt;
    outline: none;
}

.instructions-editor ul {
    margin-left: 20px;
}

/* Control Panel */
.control-panel {
    background: white;
    border-top: 3px solid var(--brand-blue);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 8px 8px;
}

.control-left {
    display: flex;
    gap: 10px;
    align-items: center;
}

.control-right {
    display: flex;
    gap: 10px;
}

.control-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 10pt;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear {
    background: white;
    color: #333;
    border: 2px solid #ccc;
}

.btn-clear:hover {
    border-color: #999;
    background: var(--light-bg);
}

.btn-generate {
    background: var(--brand-blue);
    color: white;
}

.btn-generate:hover {
    background: #144963;
}

/* Print Preview Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    padding: 20px;
    overflow: auto;
}

.modal-content {
    max-width: 95%;
    width: 900px;
    margin: 20px auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 15px 20px;
    background: var(--brand-blue);
    color: white;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    background: var(--light-bg);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Compact Slip for Printing */
.compact-slip {
    width: 100%;
    padding: 20px;
    font-size: 11pt;
    line-height: 1.5;
    background: white;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;
}

.compact-rush {
    display: none;
    position: absolute;
    top: 20px;
    right: 30px;
    background: #dc3545;
    color: white;
    padding: 10px 25px;
    font-size: 18pt;
    font-weight: bold;
    border-radius: 6px;
    transform: rotate(5deg);
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.4);
    z-index: 100;
    border: 2px solid #c82333;
}

.compact-rush.active {
    display: block;
}

.compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid var(--brand-blue);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    background: #f8f9fa;
}

.compact-logo {
    height: 45px;
}

.compact-lab-boxes {
    display: flex;
    gap: 10px;
}

.compact-lab-box {
    border: 2px solid var(--brand-blue);
    padding: 8px 12px;
    font-size: 10pt;
    background: white;
    border-radius: 4px;
}

.compact-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 25px;
}

.compact-section {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.compact-section-title {
    font-weight: bold;
    color: var(--brand-blue);
    font-size: 11pt;
    border-bottom: 2px solid var(--brand-blue);
    margin-bottom: 8px;
    padding-bottom: 4px;
}

.compact-row {
    display: flex;
    gap: 15px;
    margin-bottom: 6px;
}

.compact-field {
    flex: 1;
}

.compact-label {
    font-weight: bold;
    font-size: 10pt;
    color: #666;
    margin-right: 5px;
}

.compact-value {
    font-size: 10pt;
    color: #333;
}

.compact-procedures {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
    margin-top: 10px;
    border: 1px solid #dee2e6;
}

.compact-procedures th {
    background: var(--brand-blue);
    color: white;
    padding: 8px;
    text-align: left;
    font-size: 10pt;
    font-weight: bold;
}

.compact-procedures td {
    padding: 6px 8px;
    border-bottom: 1px solid #dee2e6;
    background: white;
}

/* New styles for organized procedures list */
.procedure-group-header {
    background: #f0f7ff !important;
    border-left: 4px solid #1b5e7f !important;
    padding: 8px !important;
    margin-bottom: 10px !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

.procedure-item {
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 10px !important;
    margin-bottom: 8px !important;
    background: white !important;
    page-break-inside: avoid;
}

.procedure-teeth {
    font-weight: bold !important;
    color: #333 !important;
    font-size: 11pt !important;
}

.procedure-days {
    background: #28a745 !important;
    color: white !important;
    padding: 2px 8px !important;
    border-radius: 3px !important;
    font-size: 9pt !important;
    font-weight: bold !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

.procedure-preferences {
    background: #fff4e6 !important;
    border-radius: 3px !important;
    padding: 6px !important;
    margin-top: 4px !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

.compact-tooth-chart {
    width: 100%;
    height: 60px;
}

.compact-signature {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #ccc;
}

.compact-signature-field {
    display: flex;
    flex-direction: column;
}

.compact-signature-line {
    border-bottom: 2px solid #333;
    margin-top: 25px;
    min-height: 30px;
}

.compact-doctor-info {
    text-align: center;
    margin-top: 5px;
    font-size: 10pt;
}

/* Animation for procedure counter */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Procedures row styling for better visibility */
.procedures-row {
    width: 100%;
    transition: all 0.3s ease;
}

.procedures-row .section {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* ============================================== */
/* VALIDATION FEEDBACK                            */
/* ============================================== */

.field-invalid {
    border: 2px solid #dc3545 !important;
    background: #fff5f5 !important;
}

.validation-summary {
    display: none;
    margin: 0 20px 12px 20px;
    padding: 12px 16px;
    background: #fff5f5;
    border: 1px solid #f5c2c7;
    border-left: 4px solid #dc3545;
    border-radius: 4px;
    color: #842029;
    font-size: 10pt;
    line-height: 1.5;
}

/* ============================================== */
/* PRINTED SLIP - bench-first layout              */
/* ============================================== */
/*
 * Sizes are in px against a fixed 760px slip width. The PDF maps that width
 * onto 7.7in of page, giving ~99px per inch - so 15px reads as roughly 11pt on
 * paper. One fixed width means the preview on screen and the printed sheet are
 * the same object, with no reflow between them.
 */

.compact-slip {
    width: 100%;
    padding: 0;
    background: white;
    box-sizing: border-box;
}

.slip {
    width: 760px;
    margin: 0 auto;
    padding: 4px 0 0;
    background: #fff;
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    box-sizing: border-box;
}

/* --- Identity band --- */
.slip-ident {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 6px;
    border-bottom: 3px solid #1b5e7f;
}

.slip-patient {
    font-size: 30px;
    font-weight: bold;
    line-height: 1.1;
    letter-spacing: -0.2px;
}

.slip-patient-sub {
    font-size: 12px;
    color: #333;
    margin-top: 2px;
}

.slip-rush {
    flex: none;
    background: #dc3545;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 2px;
    padding: 6px 18px;
    border-radius: 3px;
}

/* --- Prescriber line --- */
.slip-office {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    padding: 6px 0 8px;
    font-size: 12px;
    color: #222;
    border-bottom: 1px solid #bbb;
}

.slip-office .slip-doctor { font-weight: bold; font-size: 14px; }
.slip-office .slip-lic { font-weight: bold; }

/* --- Date strip --- */
.slip-dates {
    display: flex;
    gap: 28px;
    align-items: flex-end;
    padding: 10px 0;
    border-bottom: 1px solid #bbb;
}

.slip-date { display: flex; flex-direction: column; gap: 1px; }

.slip-date-k {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #555;
}

.slip-date-v {
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.slip-due { color: #c0392b; }

.slip-pan { flex: 1; }

.slip-pan-rule {
    display: block;
    border-bottom: 1.5px solid #333;
    height: 20px;
    min-width: 130px;
}

/* --- Procedures table: the part a technician actually reads --- */
.slip-procs {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 4px;
}

.slip-procs th {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #444;
    text-align: left;
    font-weight: bold;
    padding: 4px 8px;
    border-bottom: 1.5px solid #333;
}

.slip-procs td {
    padding: 8px;
    border-bottom: 1px solid #ccc;
    vertical-align: top;
}

.slip-procs th.slip-teeth, .slip-procs td.slip-teeth { width: 108px; }
.slip-procs th.slip-shade, .slip-procs td.slip-shade { width: 76px; text-align: center; }
.slip-procs th.slip-days,  .slip-procs td.slip-days  { width: 52px; text-align: center; }

td.slip-teeth {
    font-size: 16px;
    font-weight: bold;
    line-height: 1.25;
}

td.slip-shade {
    font-size: 18px;
    font-weight: bold;
}

td.slip-days {
    font-size: 16px;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}

.slip-type {
    font-size: 15px;
    font-weight: bold;
}

.slip-product {
    display: block;
    font-size: 14px;
}

.slip-step {
    display: inline-block;
    margin-top: 2px;
    padding: 1px 6px;
    background: #e8e8e8;
    border-radius: 2px;
    font-size: 12px;
    font-weight: bold;
}

.slip-sub {
    display: block;
    font-size: 12px;
    color: #333;
    margin-top: 2px;
}

.slip-empty {
    padding: 14px;
    text-align: center;
    color: #777;
}

/* --- Blocks below the table --- */
.slip-block {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #ccc;
}

.slip-block-title {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #444;
    font-weight: bold;
    margin-bottom: 5px;
}

.slip-materials {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    font-size: 13px;
}

.slip-materials span:before {
    content: "\2713\00a0";
    font-weight: bold;
}

.slip-notes-body { font-size: 13px; }
.slip-notes-body ul, .slip-notes-body ol { margin: 2px 0 2px 20px; padding: 0; }
.slip-notes-body li { margin: 1px 0; }
.slip-notes-body p { margin: 2px 0; }

/* --- Tooth chart --- */
.slip-arches {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.slip-arches > div { flex: 1; text-align: center; min-width: 0; }

.slip-arch-label {
    font-size: 11px;
    font-weight: bold;
    color: #1b5e7f;
    margin-bottom: 2px;
}

.slip-arches svg {
    width: 100%;
    height: auto;
    max-height: 210px;
}

/* --- Signature footer (16 CCR 1063) --- */
.slip-foot {
    display: flex;
    gap: 22px;
    margin-top: 14px;
    padding-top: 8px;
    border-top: 2px solid #1b5e7f;
}

.slip-sign { flex: 1; }

.slip-sign-rule {
    border-bottom: 1px solid #333;
    height: 26px;
}

.slip-sign-value {
    height: 26px;
    display: flex;
    align-items: flex-end;
    font-size: 13px;
    font-weight: bold;
    border-bottom: 1px solid #ccc;
}

.slip-sign-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #555;
    margin-top: 3px;
}

.slip-lab {
    margin-top: 10px;
    font-size: 9px;
    color: #777;
    text-align: center;
}

/* ============================================== */
/* PRINT                                          */
/* ============================================== */

@media print {
    @page {
        size: letter portrait;
        margin: 0.4in;
    }

    body {
        background: white;
        padding: 0;
        margin: 0;
    }

    /*
     * Hide everything that is not the slip. `.no-print` covers the data privacy
     * banner and the developer attribution footer, which had no class of their
     * own and so printed on every prescription that left the office.
     */
    .prescription-form,
    .control-panel,
    .modal-header,
    .modal-footer,
    .no-print {
        display: none !important;
    }

    .modal {
        display: block !important;
        position: static;
        background: white;
        padding: 0;
        margin: 0;
        overflow: visible;
    }

    .modal-content {
        box-shadow: none;
        border-radius: 0;
        margin: 0;
        padding: 0;
        border: none;
        width: 100%;
        max-width: none;
    }

    .compact-slip { padding: 0; }

    /* The slip is authored at 760px; let it fill the printable width. */
    .slip {
        width: 100%;
        max-width: 7.7in;
    }

    /*
     * Keep related blocks together, but do NOT force the whole slip onto one
     * page. The old rule put page-break-inside: avoid on #compactSlip, so a
     * long case was clipped instead of continuing onto page two.
     */
    .slip-ident,
    .slip-dates,
    .slip-block,
    .slip-foot,
    .slip-row {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    thead { display: table-header-group; }

    * {
        print-color-adjust: exact !important;
        -webkit-print-color-adjust: exact !important;
    }
}
