.smileup-patients-container { max-width: 1200px; margin: 0 auto; }
.patient-card { background: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.patient-header-flex { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 25px; border-bottom: 2px solid #f0f4f8; padding-bottom: 20px; }
.clinical-alert { background: #fff5f5; border: 1px solid #feb2b2; padding: 15px; border-radius: 8px; margin-bottom: 20px; color: #c53030; }
.clinical-alert h5 { margin: 0 0 5px 0; font-size: 14px; font-weight: bold; }

.ficha-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 30px; }
.ficha-meta { background: #f7fafc; padding: 20px; border-radius: 8px; height: fit-content; }
.ficha-meta .meta-item { margin-bottom: 15px; }
.ficha-meta label { display: block; font-size: 11px; text-transform: uppercase; color: #718096; font-weight: bold; }
.ficha-meta span { font-size: 15px; color: #2d3748; }

.ficha-medical { display: flex; flex-direction: column; gap: 20px; }
.medical-field textarea { width: 100%; height: 120px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 6px; font-family: inherit; font-size: 14px; }
.medical-field label { display: block; margin-bottom: 8px; font-weight: bold; color: #4a5568; }

.save-status { margin-left:15px; font-size:13px; font-weight:bold; }
.save-status.success { color: #38a169; }
.save-status.error { color: #e53e3e; }

/* ODONTOGRAM SYMMETRIC 4-QUADRANT LAYOUT */
.odontogram-quadrants-container { 
    background: #fff; 
    padding: 30px; 
    border-radius: 12px; 
    border: 1px solid #edf2f7; 
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.odontogram-arc { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 0;
}

.quadrant { 
    display: flex; 
    gap: 4px; 
    flex: 1;
}

/* Align Q1 and Q4 (Right clinical side) to the right/center */
.quadrant.q1, .quadrant.q4 { 
    justify-content: flex-end; 
}

/* Align Q2 and Q3 (Left clinical side) to the left/center */
.quadrant.q2, .quadrant.q3 { 
    justify-content: flex-start; 
}

.odontogram-center-v-line {
    width: 2px;
    height: 100px;
    background: #cbd5e0;
    margin: 0 15px;
    border-radius: 2px;
}

.odontogram-divider-h {
    height: 2px;
    background: #cbd5e0;
    margin: 15px 50px;
    border-radius: 2px;
}

.tooth-box { 
    width: 60px; 
    height: 90px; 
    border: 1px solid #edf2f7; 
    border-radius: 6px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: space-between; 
    padding: 8px 4px; 
    position: relative; 
    cursor: pointer; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
    background: #fff;
}

.tooth-box:hover { 
    background: #f0f7ff; 
    border-color: #bee3f8; 
    transform: translateY(-5px); 
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.tooth-box.selected { 
    border-color: #3182ce; 
    border-width: 2px; 
    box-shadow: 0 0 10px rgba(49,130,206,0.3);
}

.tooth-box.has-treatment { 
    background: #fff5f5; 
    border-color: #feb2b2; 
}

.tooth-num { 
    font-size: 10px; 
    font-weight: 800; 
    color: #718096; 
}

.tooth-icon { 
    width: 100%; 
    height: 55px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.tooth-icon img { 
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
}

.tooth-badge { 
    position: absolute; 
    top: -8px; 
    right: -8px; 
    background: #e53e3e; 
    color: #fff; 
    font-size: 10px; 
    width: 20px; 
    height: 20px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 2px solid #fff;
}



/* X-RAYS GALLERY ENHANCEMENTS */
.xray-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    z-index: 5;
}

.xray-link {
    display: block;
    cursor: zoom-in;
    background: #000;
}

.xray-link img {
    transition: opacity 0.2s;
}

.xray-link:hover img {
    opacity: 0.8;
}

.smileup-delete-xray-btn {
    transition: color 0.2s;
}

.smileup-delete-xray-btn:hover {
    color: #c53030 !important;
}

/* Lightbox-like effect for images if viewed directly (fallback) */
.xray-item a img {
    border-bottom: 1px solid #edf2f7;
}

/* TREATMENT STATUS & BUDGET STYLES */
.treatment-row.status-terminado {
    background-color: #f0f7ff !important;
}

.treatment-row.status-terminado td {
    color: #718096;
}

.treatment-row.status-terminado .proc-name {
    text-decoration: line-through;
    opacity: 0.7;
}

.tooth-box.all-done {
    background: #f0fff4 !important; /* light green */
    border-color: #9ae6b4 !important;
}

.tooth-box.all-done .tooth-num {
    color: #38a169;
}

/* Status Toggle Checkbox */
.smileup-status-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.smileup-toggle-it-status {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.status-label {
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
}

.status-pendiente .status-label {
    background: #fffaf0;
    color: #dd6b20;
    border: 1px solid #fbd38d;
}

.status-terminado .status-label {
    background: #ebf8ff;
    color: #000000;
    border: 1px solid #90cdf4;
}

/* Budget UI */
#smileup-print-budget-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0043b9;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#smileup-print-budget-btn:hover {
    background: #00328a;
}

#smileup-print-budget-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

.budget-item-select {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.smileup-remove-treatment-btn {
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s;
}

.smileup-remove-treatment-btn:hover {
    color: #e53e3e;
}

.financial-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
}

.finance-stat {
    text-align: center;
}

.finance-stat label {
    display: block;
    font-size: 12px;
    color: #718096;
    text-transform: uppercase;
    font-weight: bold;
    margin-bottom: 5px;
}

.finance-stat span {
    font-size: 20px;
    font-weight: 800;
    color: #2d3748;
}

.finance-stat.balance span {
    color: #e53e3e;
}

.finance-stat.paid span {
    color: #38a169;
}
