/* ==========================================================================
   DENTAL CHART - PROFESSIONAL LAYOUT (DENTALOME STYLE)
   ========================================================================== */

/* CONTAINER & LAYOUT
   ========================================================================== */
.odontogram-hd-container {
    width: 100%;
    margin-bottom: 20px;
}

.odontogram-hd {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 40px 30px 60px 30px;
    width: 100%;
    max-width: 1200px;
    min-height: 420px;
    /* Ensure both arches are fully visible */
    margin: 0 auto;
    /* Glassmorphism - harmonized with dark theme */
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: visible;
    /* Prevent clipping */
}

/* ARCHES */
.arch {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 6px;
    padding: 20px 0;
}

.arch.upper {
    align-items: flex-end;
    padding-bottom: 25px;
}

.arch.lower {
    align-items: flex-start;
    padding-top: 25px;
}

/* SEPARATOR LINE BETWEEN ARCHES - Clear and visible */
.chart-separator {
    height: 3px;
    background: linear-gradient(to right,
            transparent 2%,
            rgba(59, 130, 246, 0.3) 15%,
            rgba(59, 130, 246, 0.6) 50%,
            rgba(59, 130, 246, 0.3) 85%,
            transparent 98%);
    margin: 10px auto;
    width: 90%;
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

/* Specific spacing for midline */
.arch.upper .tooth-container-vector[data-tooth="11"] {
    margin-right: 20px;
}

.arch.lower .tooth-container-vector[data-tooth="41"] {
    margin-right: 20px;
}

/* Child teeth midline */
.arch.upper .tooth-container-vector[data-tooth="51"] {
    margin-right: 20px;
}

.arch.lower .tooth-container-vector[data-tooth="81"] {
    margin-right: 20px;
}


/* TOOTH CONTAINER - LARGER AND CLEARER
   ========================================================================== */
.tooth-container-vector {
    position: relative;
    width: 55px;
    height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    transition: transform 0.2s ease;
    padding: 5px 0;
}

/* Molars need more width */
.tooth-container-vector.molar {
    width: 65px;
}

.tooth-container-vector:hover {
    transform: scale(1.08);
    z-index: 10;
}

/* Selected State - Enhanced visibility */
.tooth-container-vector.selected {
    z-index: 15;
}

.tooth-container-vector.selected::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 110%;
    height: 110%;
    border: 3px solid #3b82f6;
    border-radius: 10px;
    pointer-events: none;
    z-index: 0;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    animation: pulse-selection 1.5s infinite;
}

@keyframes pulse-selection {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.4);
    }

    50% {
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.7);
    }
}

/* Selection Badge - Shows X when selected */
.tooth-container-vector.selected::before {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
}

/* Editing Mode */
.tooth-container-vector.editing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    border: 2px dashed #f59e0b;
    /* Amber for editing */
    border-radius: 8px;
    pointer-events: none;
    z-index: 0;
}


/* VISUAL LAYER (THE IMAGE)
   ========================================================================== */
.tooth-visual {
    position: relative;
    width: 50px;
    height: 95px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    transition: filter 0.2s;
    flex-shrink: 0;
}

.tooth-container-vector.selected .tooth-visual {
    filter: drop-shadow(0 0 8px rgba(52, 152, 219, 0.7));
}


/* MAPPING LOGIC - 1:1 ASSET ASSIGNMENT
   ========================================================================== */

/* --- UPPER ARCH (18-28) --- */

/* Molars Upper (18, 17, 16, 26, 27, 28) */
.tooth-container-vector[data-tooth="18"] .tooth-visual,
.tooth-container-vector[data-tooth="17"] .tooth-visual,
.tooth-container-vector[data-tooth="16"] .tooth-visual,
.tooth-container-vector[data-tooth="26"] .tooth-visual,
.tooth-container-vector[data-tooth="27"] .tooth-visual,
.tooth-container-vector[data-tooth="28"] .tooth-visual {
    background-image: url('../assets/tooth_molar_upper_fixed.png');
    width: 50px;
    /* Molars are wider */
}

/* Premolars Upper (15, 14, 24, 25) - Mapped to Canine Asset if no Premolar asset provided */
.tooth-container-vector[data-tooth="15"] .tooth-visual,
.tooth-container-vector[data-tooth="14"] .tooth-visual,
.tooth-container-vector[data-tooth="24"] .tooth-visual,
.tooth-container-vector[data-tooth="25"] .tooth-visual {
    background-image: url('../assets/tooth_canine_upper_fixed.png');
}

/* Canines Upper (13, 23) */
.tooth-container-vector[data-tooth="13"] .tooth-visual,
.tooth-container-vector[data-tooth="23"] .tooth-visual {
    background-image: url('../assets/tooth_canine_upper_fixed.png');
}

/* Incisors Upper (12, 11, 21, 22) */
.tooth-container-vector[data-tooth="12"] .tooth-visual,
.tooth-container-vector[data-tooth="11"] .tooth-visual,
.tooth-container-vector[data-tooth="21"] .tooth-visual,
.tooth-container-vector[data-tooth="22"] .tooth-visual {
    background-image: url('../assets/tooth_incisor_upper_fixed.png');
}


/* --- LOWER ARCH (48-38) --- */

/* Molars Lower (48, 47, 46, 36, 37, 38) */
.tooth-container-vector[data-tooth="48"] .tooth-visual,
.tooth-container-vector[data-tooth="47"] .tooth-visual,
.tooth-container-vector[data-tooth="46"] .tooth-visual,
.tooth-container-vector[data-tooth="36"] .tooth-visual,
.tooth-container-vector[data-tooth="37"] .tooth-visual,
.tooth-container-vector[data-tooth="38"] .tooth-visual {
    background-image: url('../assets/tooth_molar_lower_fixed.png');
    width: 50px;
}

/* Premolars Lower (45, 44, 34, 35) */
.tooth-container-vector[data-tooth="45"] .tooth-visual,
.tooth-container-vector[data-tooth="44"] .tooth-visual,
.tooth-container-vector[data-tooth="34"] .tooth-visual,
.tooth-container-vector[data-tooth="35"] .tooth-visual {
    background-image: url('../assets/tooth_canine_lower_fixed.png');
}

/* Canines Lower (43, 33) */
.tooth-container-vector[data-tooth="43"] .tooth-visual,
.tooth-container-vector[data-tooth="33"] .tooth-visual {
    background-image: url('../assets/tooth_canine_lower_fixed.png');
}

/* Incisors Lower (42, 41, 31, 32) */
.tooth-container-vector[data-tooth="42"] .tooth-visual,
.tooth-container-vector[data-tooth="41"] .tooth-visual,
.tooth-container-vector[data-tooth="31"] .tooth-visual,
.tooth-container-vector[data-tooth="32"] .tooth-visual {
    background-image: url('../assets/tooth_incisor_lower_fixed.png');
}

/* --- CHILD TEETH (51-85) --- */

/* Child Molars (55, 54, 64, 65, 75, 74, 84, 85) */
.tooth-container-vector[data-tooth="55"] .tooth-visual,
.tooth-container-vector[data-tooth="54"] .tooth-visual,
.tooth-container-vector[data-tooth="64"] .tooth-visual,
.tooth-container-vector[data-tooth="65"] .tooth-visual,
.tooth-container-vector[data-tooth="75"] .tooth-visual,
.tooth-container-vector[data-tooth="74"] .tooth-visual,
.tooth-container-vector[data-tooth="84"] .tooth-visual,
.tooth-container-vector[data-tooth="85"] .tooth-visual {
    background-image: url('../assets/tooth_molar_upper_fixed.png');
    width: 40px;
}

/* Re-orient Lower Child Molars */
.tooth-container-vector[data-tooth="75"] .tooth-visual,
.tooth-container-vector[data-tooth="74"] .tooth-visual,
.tooth-container-vector[data-tooth="84"] .tooth-visual,
.tooth-container-vector[data-tooth="85"] .tooth-visual {
    background-image: url('../assets/tooth_molar_lower_fixed.png');
}

/* Child Canines (53, 63, 73, 83) */
.tooth-container-vector[data-tooth="53"] .tooth-visual,
.tooth-container-vector[data-tooth="63"] .tooth-visual,
.tooth-container-vector[data-tooth="73"] .tooth-visual,
.tooth-container-vector[data-tooth="83"] .tooth-visual {
    background-image: url('../assets/tooth_canine_upper_fixed.png');
    width: 35px;
}

.tooth-container-vector[data-tooth="73"] .tooth-visual,
.tooth-container-vector[data-tooth="83"] .tooth-visual {
    background-image: url('../assets/tooth_canine_lower_fixed.png');
}

/* Child Incisors (52, 51, 61, 62, 72, 71, 81, 82) */
.tooth-container-vector[data-tooth="52"] .tooth-visual,
.tooth-container-vector[data-tooth="51"] .tooth-visual,
.tooth-container-vector[data-tooth="61"] .tooth-visual,
.tooth-container-vector[data-tooth="62"] .tooth-visual,
.tooth-container-vector[data-tooth="72"] .tooth-visual,
.tooth-container-vector[data-tooth="71"] .tooth-visual,
.tooth-container-vector[data-tooth="81"] .tooth-visual,
.tooth-container-vector[data-tooth="82"] .tooth-visual {
    background-image: url('../assets/tooth_incisor_upper_fixed.png');
    width: 35px;
}

.tooth-container-vector[data-tooth="72"] .tooth-visual,
.tooth-container-vector[data-tooth="71"] .tooth-visual,
.tooth-container-vector[data-tooth="81"] .tooth-visual,
.tooth-container-vector[data-tooth="82"] .tooth-visual {
    background-image: url('../assets/tooth_incisor_lower_fixed.png');
}

/* VISUAL STATUS OVERLAYS - Enhanced Crown Colors
   ========================================================================== */

/* Base overlay for crown coloring */
.tooth-container-vector .tooth-status-overlay {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 45%;
    border-radius: 4px 4px 8px 8px;
    pointer-events: none;
    z-index: 3;
    transition: all 0.3s ease;
}

/* TREATED - Green overlay on crown */
.tooth-container-vector.treated .tooth-status-overlay {
    background: linear-gradient(to bottom, transparent 0%, rgba(16, 185, 129, 0.6) 30%, rgba(16, 185, 129, 0.8) 100%);
}

.tooth-container-vector.treated .tooth-visual {
    filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.7));
}

/* PLANNED - Orange overlay on crown */
.tooth-container-vector.planned .tooth-status-overlay {
    background: linear-gradient(to bottom, transparent 0%, rgba(251, 146, 60, 0.6) 30%, rgba(251, 146, 60, 0.8) 100%);
}

.tooth-container-vector.planned .tooth-visual {
    filter: drop-shadow(0 0 6px rgba(251, 146, 60, 0.7));
}

/* IN-PROGRESS - Yellow overlay on crown */
.tooth-container-vector.in-progress .tooth-status-overlay {
    background: linear-gradient(to bottom, transparent 0%, rgba(234, 179, 8, 0.5) 30%, rgba(234, 179, 8, 0.7) 100%);
}

.tooth-container-vector.in-progress .tooth-visual {
    filter: drop-shadow(0 0 6px rgba(234, 179, 8, 0.7));
}

/* DECAYED - Red overlay on crown */
.tooth-container-vector.decayed .tooth-status-overlay {
    background: linear-gradient(to bottom, transparent 0%, rgba(220, 38, 38, 0.5) 30%, rgba(220, 38, 38, 0.7) 100%);
}

.tooth-container-vector.decayed .tooth-visual {
    filter: drop-shadow(0 0 6px rgba(220, 38, 38, 0.8)) sepia(0.3) hue-rotate(-30deg);
}

/* CROWN (prosthetic) - Gold overlay */
.tooth-container-vector.crown .tooth-status-overlay {
    background: linear-gradient(to bottom, transparent 0%, rgba(234, 179, 8, 0.4) 20%, rgba(234, 179, 8, 0.7) 100%);
}

.tooth-container-vector.crown .tooth-visual {
    filter: brightness(1.15) contrast(1.1) drop-shadow(0 0 5px rgba(234, 179, 8, 0.6));
}

/* MISSING - Grayscale with X mark */
.tooth-container-vector.missing {
    opacity: 0.25;
    filter: grayscale(1);
    cursor: not-allowed;
}

.tooth-container-vector.missing::before {
    content: '×';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    color: #94a3b8;
    z-index: 10;
    font-weight: bold;
}

/* EXTRACTION - Red X mark */
.tooth-container-vector.extraction .tooth-visual {
    filter: grayscale(0.8) opacity(0.5);
}

.tooth-container-vector.extraction::before {
    content: '×';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    color: #ef4444;
    z-index: 10;
    font-weight: bold;
}

/* ===== LOWER ARCH STATUS OVERLAY - Flip position ===== */
.arch.lower .tooth-container-vector .tooth-status-overlay {
    top: 0;
    bottom: auto;
    border-radius: 8px 8px 4px 4px;
    background: none;
    /* Reset, re-apply per status */
}

.arch.lower .tooth-container-vector.treated .tooth-status-overlay {
    background: linear-gradient(to top, transparent 0%, rgba(16, 185, 129, 0.6) 30%, rgba(16, 185, 129, 0.8) 100%);
}

.arch.lower .tooth-container-vector.planned .tooth-status-overlay {
    background: linear-gradient(to top, transparent 0%, rgba(251, 146, 60, 0.6) 30%, rgba(251, 146, 60, 0.8) 100%);
}

.arch.lower .tooth-container-vector.in-progress .tooth-status-overlay {
    background: linear-gradient(to top, transparent 0%, rgba(234, 179, 8, 0.5) 30%, rgba(234, 179, 8, 0.7) 100%);
}

.arch.lower .tooth-container-vector.decayed .tooth-status-overlay {
    background: linear-gradient(to top, transparent 0%, rgba(220, 38, 38, 0.5) 30%, rgba(220, 38, 38, 0.7) 100%);
}

.arch.lower .tooth-container-vector.crown .tooth-status-overlay {
    background: linear-gradient(to top, transparent 0%, rgba(234, 179, 8, 0.4) 20%, rgba(234, 179, 8, 0.7) 100%);
}


/* TOOTH NUMBER - POSITIONED CORRECTLY
   ========================================================================== */
.tooth-number-vector {
    font-size: 13px;
    color: #475569;
    font-weight: 600;
    z-index: 5;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Upper Arch: Number BELOW the tooth */
.arch.upper .tooth-container-vector {
    flex-direction: column;
}

.arch.upper .tooth-visual {
    order: 1;
}

.arch.upper .tooth-number-vector {
    order: 2;
    margin-top: 8px;
}

/* Lower Arch: Number ABOVE the tooth */
.arch.lower .tooth-container-vector {
    flex-direction: column;
}

.arch.lower .tooth-number-vector {
    order: -1;
    margin-bottom: 8px;
}

.arch.lower .tooth-visual {
    order: 2;
}


/* GEOMETRIC LAYER (Hidden by default, used for overlay effects)
   ========================================================================== */
.tooth-geometric {
    display: none;
    /* Hide old SVG system */
}


/* MIRRORING FOR LEFT SIDE (Quadrants 2 and 3)
   ========================================================================== */
/* 
   Teeth are anatomically asymmetrical. 
   Usually, 11 and 21 are mirror images. 
   Our assets are "Right side" (e.g. 11/13/16). 
   So we should mirror horizontal (scaleX(-1)) for the left quadrants (2x and 3x).
*/

/* Quadrant 2 (Upper Left) */
.tooth-container-vector[data-tooth^="2"] .tooth-visual {
    transform: scaleX(-1);
}

/* Quadrant 3 (Lower Left) */
.tooth-container-vector[data-tooth^="3"] .tooth-visual {
    transform: scaleX(-1);
}

/* Quadrant 6 (Upper Left Child) */
.tooth-container-vector[data-tooth^="6"] .tooth-visual {
    transform: scaleX(-1);
}

/* Quadrant 7 (Lower Left Child) */
.tooth-container-vector[data-tooth^="7"] .tooth-visual {
    transform: scaleX(-1);
}

/* Tooltip */
.tooth-tooltip-hd {
    position: absolute;
    background: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 100;
    display: none;
    transform: translate(-50%, -100%);
    top: 0;
    white-space: nowrap;
}

/* ============================================
   ORTHODONTICS PAGE STYLES
   ============================================ */

/* Stats Cards Grid */
.ortho-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

@media (max-width: 1200px) {
    .ortho-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .ortho-stats {
        grid-template-columns: 1fr;
    }
}

.ortho-stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    transition: all var(--transition-base);
}

.ortho-stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-default);
    box-shadow: var(--shadow-lg);
}

.ortho-stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
}

.ortho-stat-icon svg {
    width: 24px;
    height: 24px;
}

.ortho-stat-icon.blue {
    background: rgba(79, 143, 186, 0.15);
    color: var(--brand-blue);
}

.ortho-stat-icon.green {
    background: var(--success-bg);
    color: var(--success);
}

.ortho-stat-icon.gold {
    background: rgba(201, 169, 98, 0.15);
    color: var(--brand-gold);
}

.ortho-stat-icon.red {
    background: var(--danger-bg);
    color: var(--danger);
}

.ortho-stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.ortho-stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* Patients Grid */
.ortho-patients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-lg);
}

/* Patient Card */
.ortho-patient-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: all var(--transition-base);
}

.ortho-patient-card:hover {
    border-color: var(--border-default);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.ortho-card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.ortho-patient-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-gold) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.ortho-patient-info {
    flex: 1;
    min-width: 0;
}

.ortho-patient-name {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ortho-patient-type {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.ortho-status {
    padding: 4px 10px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
}

.ortho-status.active {
    background: var(--info-bg);
    color: var(--info);
}

.ortho-status.completed {
    background: var(--success-bg);
    color: var(--success);
}

/* Progress Section */
.ortho-progress-section {
    margin-bottom: var(--spacing-md);
}

.ortho-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.ortho-progress-percent {
    font-weight: 600;
    color: var(--brand-blue);
}

.ortho-progress-bar {
    height: 8px;
    background: var(--surface-2);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.ortho-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-gold) 100%);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.ortho-progress-dates {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    margin-top: var(--spacing-xs);
}

/* Card Footer */
.ortho-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-muted);
}

.ortho-payment-info {
    display: flex;
    gap: var(--spacing-md);
}

.ortho-paid {
    font-size: var(--font-size-sm);
    color: var(--success);
}

.ortho-remaining {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.ortho-next-rdv {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.ortho-next-rdv svg {
    width: 14px;
    height: 14px;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: var(--spacing-xs);
    background: var(--surface-2);
    padding: 4px;
    border-radius: var(--radius-md);
}

.filter-tab {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.filter-tab:hover {
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--brand-blue);
    color: white;
}

/* Detail View Styles */
.ortho-detail {
    max-width: 1200px;
}

.ortho-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.ortho-detail-patient {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.ortho-detail-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-gold) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: white;
}

.ortho-detail-patient h2 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.ortho-detail-actions {
    display: flex;
    gap: var(--spacing-md);
}

.ortho-detail-section {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.ortho-detail-section h3 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-lg);
}

.ortho-detail-section h4 {
    color: var(--text-primary);
    margin: var(--spacing-lg) 0 var(--spacing-md);
    font-size: var(--font-size-base);
}

.ortho-detail-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

@media (max-width: 900px) {
    .ortho-detail-columns {
        grid-template-columns: 1fr;
    }
}

/* Big Progress Bar */
.ortho-big-progress-bar {
    height: 24px;
    background: var(--surface-2);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
}

.ortho-big-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-gold) 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: var(--spacing-md);
    transition: width 0.3s ease;
}

.ortho-big-progress-text {
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.ortho-progress-info {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

@media (max-width: 768px) {
    .ortho-progress-info {
        grid-template-columns: repeat(2, 1fr);
    }
}

.ortho-progress-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.ortho-progress-item .label {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.ortho-progress-item .value {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
}

.ortho-progress-item .value.highlight {
    color: var(--brand-blue);
}

/* Photos Grid */
.ortho-photos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

@media (max-width: 768px) {
    .ortho-photos-grid {
        grid-template-columns: 1fr;
    }
}

.ortho-photo-card {
    text-align: center;
}

.ortho-photo-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.ortho-photo {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.2s;
}

.ortho-photo:hover {
    transform: scale(1.02);
}

.ortho-photo-placeholder {
    width: 100%;
    height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    background: var(--surface-2);
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s;
}

.ortho-photo-placeholder:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

.ortho-photo-placeholder svg {
    width: 32px;
    height: 32px;
}

/* Payment Summary */
.ortho-payment-summary {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--surface-2);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.payment-summary-item {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-sm);
}

.payment-summary-item .label {
    color: var(--text-secondary);
}

.payment-summary-item .value {
    font-weight: 600;
    color: var(--text-primary);
}

.payment-summary-item.success .value {
    color: var(--success);
}

.payment-summary-item.danger .value {
    color: var(--danger);
}

/* Payments List */
.ortho-payments-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.ortho-payment-item {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
}

.payment-date {
    color: var(--text-tertiary);
}

.payment-amount {
    font-weight: 600;
    color: var(--success);
}

.payment-method {
    color: var(--text-secondary);
}

.payment-note {
    grid-column: 1 / -1;
    color: var(--text-tertiary);
    font-size: var(--font-size-xs);
}

/* Notes List */
.ortho-notes-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.ortho-note-item {
    padding: var(--spacing-sm);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--brand-blue);
}

.note-date {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    margin-bottom: var(--spacing-xs);
}

.note-content {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

/* Appointments Section */
.ortho-appointments-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.ortho-appointment-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
}

.ortho-apt-icon {
    color: var(--brand-blue);
}

.ortho-apt-icon svg {
    width: 20px;
    height: 20px;
}

.ortho-apt-details {
    flex: 1;
}

.ortho-apt-date {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.ortho-apt-time {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

/* Helper Classes */
.mb-lg {
    margin-bottom: var(--spacing-lg);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-center {
    text-align: center;
}