/* 
 * Sağlık Kabini Otomasyon Scripti - Arayüz Tasarım Sistemi (CSS)
 * Renk Paleti: Medical Teal, Navy Blue ve Soft Gray
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #e31e24;       /* Mia Sağlık Kırmızı */
    --primary-hover: #b91c1c;
    --primary-light: #fef2f2;
    --secondary-color: #1e293b;     /* Navy Slate */
    --accent-color: #ef4444;        /* Bright Red */
    --accent-light: #fef2f2;
    --text-color: #334155;
    --text-muted: #64748b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
    -webkit-text-size-adjust: 100%; /* iOS döndürme sonrası yazı boyutu kaymasını engeller */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--secondary-color);
    font-weight: 700;
}

/* iOS Dokunmatik Optimizasyonları */
button, .btn, .tab-btn, .slot-item, .test-checkbox-card, .todo-item {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent; /* Tıklamadaki gri kutu efektini kapatır */
}

.slot-list, .todo-list, .selected-test-list {
    -webkit-overflow-scrolling: touch; /* iOS ivmeli kaydırmayı aktif eder */
}

/* --- TEMA ELEMANLARI --- */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header & Navigasyon */
.main-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: calc(16px + env(safe-area-inset-top)) 0 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-color), #f87171);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(227, 30, 36, 0.2);
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Menü / Sekme Kontrolleri */
.nav-tabs {
    display: flex;
    gap: 8px;
    background-color: var(--bg-color);
    padding: 6px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn i {
    font-size: 16px;
}

.tab-btn:hover {
    color: var(--primary-color);
    background-color: rgba(227, 30, 36, 0.05);
}

.tab-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    box-shadow: 0 4px 10px rgba(227, 30, 36, 0.25);
}

/* Sayfa İçeriği & Grid */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
    margin-top: 32px;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Card Tasarımı */
.card {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 24px;
    margin-bottom: 24px;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-title {
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.card-title i {
    color: var(--primary-color);
}

/* Form Tasarımları */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--secondary-color);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-color);
    background-color: #ffffff;
    outline: none;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(227, 30, 36, 0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Buton Tasarımları */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(227, 30, 36, 0.15);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(227, 30, 36, 0.25);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-danger {
    background-color: var(--danger-color);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* --- RANDEVU AJANDA SAYFASI TASARIMI --- */

.calendar-layout {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 20px;
}

@media (max-width: 1280px) {
    .calendar-layout {
        grid-template-columns: 280px 1fr;
    }
    .todo-list-container {
        grid-column: span 2;
    }
    .todo-list-container .card {
        position: static !important;
    }
}

@media (max-width: 992px) {
    .calendar-layout {
        grid-template-columns: 1fr;
    }
    .todo-list-container {
        grid-column: span 1;
    }
}

/* Yapılacaklar Listesi Stilleri */
.todo-list {
    max-height: 550px;
    overflow-y: auto;
    padding-right: 4px;
}

.todo-list::-webkit-scrollbar {
    width: 6px;
}

.todo-list::-webkit-scrollbar-track {
    background: transparent;
}

.todo-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.todo-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.todo-item:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.todo-item.completed {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    opacity: 0.6;
}

.todo-item.completed .todo-item-patient,
.todo-item.completed .todo-item-treatment {
    text-decoration: line-through;
    color: var(--text-muted);
}

.todo-item-checkbox {
    min-width: 18px;
    height: 18px;
    border: 2.5px solid #cbd5e1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-top: 2px;
    transition: all 0.2s ease;
    background-color: #fff;
}

.todo-item-checkbox i {
    color: #fff;
    font-size: 10px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.todo-item.completed .todo-item-checkbox {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.todo-item.completed .todo-item-checkbox i {
    opacity: 1;
    transform: scale(1);
}

.todo-item-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.todo-item-time {
    font-weight: 800;
    color: var(--primary-color);
    font-size: 12px;
}

.todo-item-patient {
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 13px;
}

.todo-item-treatment {
    color: var(--text-muted);
    font-size: 12px;
}

.slot-list {
    max-height: 550px;
    overflow-y: auto;
    padding-right: 8px;
}

.slot-list::-webkit-scrollbar {
    width: 6px;
}

.slot-list::-webkit-scrollbar-track {
    background: transparent;
}

.slot-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.slot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #f8fafc;
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slot-item:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.slot-item.booked {
    border-style: solid;
    border-color: #cbd5e1;
    background-color: #f1f5f9;
    cursor: not-allowed;
}

.slot-time {
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 15px;
}

.slot-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 20px;
}

.status-free {
    background-color: #d1fae5;
    color: #065f46;
}

.status-booked {
    background-color: #fee2e2;
    color: #991b1b;
}

/* FullCalendar Customization */
#calendar {
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px;
    min-height: 550px;
}

.fc-theme-standard td, .fc-theme-standard th {
    border-color: var(--border-color) !important;
}

.fc-header-toolbar {
    margin-bottom: 20px !important;
}

.fc-button-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.fc-button-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.fc-button-active {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
}

.fc-event {
    background-color: var(--primary-light) !important;
    border-left: 4px solid var(--primary-color) !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    color: var(--secondary-color) !important;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.fc-day-today {
    background-color: rgba(227, 30, 36, 0.03) !important;
}

.fc-day-past {
    background-color: #f1f5f9 !important;
    opacity: 0.85;
}

/* --- LABORATUVAR TAHLİL SAYFASI TASARIMI --- */

.lab-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

@media (max-width: 992px) {
    .lab-layout {
        grid-template-columns: 1fr;
    }
}

.test-category {
    margin-bottom: 24px;
}

.category-name {
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-name::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background-color: var(--border-color);
}

.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

/* Custom Checkbox Design */
.test-checkbox-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.test-checkbox-card:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.test-checkbox-card.selected {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(227, 30, 36, 0.08);
}

.test-label-side {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 80%;
}

.checkbox-custom {
    min-width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.checkbox-custom i {
    color: #fff;
    font-size: 12px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.test-checkbox-card.selected .checkbox-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.test-checkbox-card.selected .checkbox-custom i {
    opacity: 1;
    transform: scale(1);
}

.test-info {
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-color);
}

.test-price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 14px;
}

/* Dinamik Hesaplama & Sağ Panel */
.sticky-panel {
    position: sticky;
    top: 90px;
}

.receipt-summary-card {
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 24px;
}

.selected-test-list {
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
}

.selected-test-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 6px 0;
    color: var(--text-color);
}

.selected-test-item span {
    font-weight: 500;
}

.selected-test-item strong {
    color: var(--secondary-color);
}

.total-price-box {
    margin: 20px 0;
    padding: 16px;
    background-color: var(--primary-light);
    border-radius: var(--radius-md);
    border: 1px solid rgba(227, 30, 36, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-price-title {
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 15px;
}

.total-price-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
    font-family: var(--font-heading);
}

/* Özel Tetkik Alanı */
.custom-test-row {
    display: grid;
    grid-template-columns: 1fr 120px auto;
    gap: 10px;
    background-color: #f1f5f9;
    padding: 12px;
    border-radius: var(--radius-md);
    margin-top: 15px;
    border: 1px solid var(--border-color);
}

@media (max-width: 576px) {
    .custom-test-row {
        grid-template-columns: 1fr;
    }
}

/* --- MODAL PENCERELER --- */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.modal-backdrop.open .modal-container {
    transform: translateY(0);
}

.modal-header {
    background: linear-gradient(135deg, var(--secondary-color), #334155);
    padding: 20px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #ffffff;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    background-color: #f8fafc;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* --- YAZDIRMA (RECEIPT) ŞABLONU VE PRINT STİLLERİ --- */

#receipt-print-area {
    display: none;
}

@media print {
    /* Ekrandaki her şeyi gizle */
    body * {
        visibility: hidden;
    }
    
    /* Sadece fiş alanını göster */
    #receipt-print-area, #receipt-print-area * {
        visibility: visible;
    }
    
    #receipt-print-area {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 80mm; /* Standart Termal Fiş Boyutu */
        padding: 10px;
        background-color: #fff;
        color: #000;
        font-family: 'Courier New', Courier, monospace; /* Fiş havası için */
        font-size: 12px;
    }

    .receipt-header {
        text-align: center;
        margin-bottom: 15px;
        border-bottom: 1px dashed #000;
        padding-bottom: 10px;
    }

    .receipt-title {
        font-weight: bold;
        font-size: 14px;
        text-transform: uppercase;
        margin-bottom: 2px;
    }

    .receipt-info {
        margin-bottom: 10px;
        font-size: 11px;
    }

    .receipt-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 15px;
    }

    .receipt-table th {
        border-bottom: 1px solid #000;
        text-align: left;
        font-weight: bold;
        padding: 4px 0;
    }

    .receipt-table td {
        padding: 4px 0;
        font-size: 11px;
    }

    .receipt-total {
        border-top: 1.5px dashed #000;
        padding-top: 8px;
        text-align: right;
        font-size: 13px;
        font-weight: bold;
    }

    .receipt-footer {
        text-align: center;
        margin-top: 20px;
        font-size: 10px;
        border-top: 1px dashed #000;
        padding-top: 8px;
    }
}

/* ======================================================= */
/* YENİ STİLLER: MOBİL NAVİGASYON, ÖNCELİK BADGE VE SİLME  */
/* ======================================================= */

@media (max-width: 600px) {
    .header-wrapper {
        flex-direction: column !important;
        gap: 16px !important;
        align-items: stretch !important;
    }
    .logo-area {
        justify-content: center;
    }
    .nav-tabs {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        width: 100% !important;
        background-color: transparent !important;
        border: none !important;
        padding: 0 !important;
    }
    .nav-tabs .tab-btn {
        justify-content: center;
        width: 100% !important;
        font-size: 13px !important;
        padding: 12px 8px !important;
        background-color: var(--card-bg) !important;
        border: 1px solid var(--border-color) !important;
    }
    .nav-tabs .tab-btn.active {
        color: #ffffff !important;
        background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)) !important;
        border-color: var(--primary-color) !important;
    }
    .nav-tabs a.btn {
        grid-column: span 1 !important;
        justify-content: center !important;
        width: 100% !important;
        padding: 12px !important;
        font-size: 13px !important;
        display: flex !important;
    }
}

/* To-Do List Priority Badges */
.todo-priority-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    margin-top: 4px;
    text-transform: uppercase;
    width: fit-content;
}

.todo-priority-badge.priority-normal {
    background-color: #e2e8f0;
    color: #475569;
}

.todo-priority-badge.priority-yüksek {
    background-color: #ffedd5;
    color: #c2410c;
}

.todo-priority-badge.priority-acil {
    background-color: #fee2e2;
    color: #991b1b;
    animation: priority-pulse 1.5s infinite;
}

@keyframes priority-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* To-Do Item Delete Button */
.todo-item {
    position: relative;
    padding-right: 40px !important; /* Silme butonu için yer ayır */
}

.todo-delete-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.todo-delete-btn:hover {
    color: var(--danger-color);
    background-color: rgba(239, 68, 68, 0.1);
}

/* FullCalendar Customization for Priorities */
.fc-event.fc-event-priority-yüksek {
    background-color: #fff7ed !important;
    border-left: 4px solid #f97316 !important;
    color: #c2410c !important;
}

.fc-event.fc-event-priority-acil {
    background-color: #fef2f2 !important;
    border-left: 4px solid #ef4444 !important;
    color: #b91c1c !important;
}

/* Booked Slot Custom Colors based on Priority */
.slot-item.booked.slot-priority-yüksek {
    border-color: #fed7aa !important;
    background-color: #fff7ed !important;
}

.slot-item.booked.slot-priority-yüksek .slot-time {
    color: #c2410c !important;
}

.slot-item.booked.slot-priority-yüksek .status-booked {
    background-color: #ffedd5 !important;
    color: #c2410c !important;
}

.slot-item.booked.slot-priority-acil {
    border-color: #fecaca !important;
    background-color: #fef2f2 !important;
}

.slot-item.booked.slot-priority-acil .slot-time {
    color: #b91c1c !important;
}

.slot-item.booked.slot-priority-acil .status-booked {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
}

/* Slot Cancel Button */
.slot-item {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.slot-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.slot-cancel-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slot-cancel-btn:hover {
    color: var(--danger-color);
    background-color: rgba(239, 68, 68, 0.1);
}

/* --- DATA TABLE VE HASTA TAHLİL GEÇMİŞİ STİLLERİ --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 15px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.data-table th, .data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table th {
    background-color: #f8fafc;
    font-weight: 700;
    color: var(--secondary-color);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

.data-table td {
    color: var(--text-color);
    font-weight: 500;
}

.patient-tests-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 500px;
}

.patient-tests-badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-radius: 6px;
    font-weight: 600;
    border: 1px solid rgba(227, 30, 36, 0.1);
}

/* =========================================================== */
/* TXT DOSYASI YÜKLEME ALANI                                    */
/* =========================================================== */
.lab-top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
    align-items: end;
}
.lab-top-row .form-group {
    min-width: 0;
    margin-bottom: 0;
}
.lab-top-row .form-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.txt-upload-zone {
    margin-bottom: 28px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #f8fafc, #fff);
    transition: all 0.3s ease;
    overflow: hidden;
}
.txt-upload-zone.drag-over {
    border-color: var(--primary-color);
    background: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(227, 30, 36, 0.1);
}
.txt-upload-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    flex-wrap: wrap;
    cursor: pointer;
}
.txt-upload-inner:hover { background-color: rgba(227,30,36,0.02); }
.txt-upload-icon { font-size: 36px; color: var(--primary-color); opacity: 0.7; flex-shrink: 0; }
.txt-upload-text { display: flex; flex-direction: column; gap: 4px; flex-grow: 1; }
.txt-upload-text strong { font-size: 14px; font-weight: 700; color: var(--secondary-color); }
.txt-upload-text span { font-size: 12px; color: var(--text-muted); }

.txt-upload-result {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border-top: 1px solid #a7f3d0;
    padding: 16px 24px;
}
.txt-result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 12px;
    font-size: 14px;
}
.txt-match-summary { display: flex; gap: 12px; flex-wrap: wrap; }
.txt-match-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}
.txt-match-chip.matched   { background-color: #d1fae5; color: #065f46; }
.txt-match-chip.unmatched { background-color: #fee2e2; color: #991b1b; cursor: pointer; }
.txt-match-chip.total-price { background-color: var(--primary-light); color: var(--primary-color); font-size: 14px; }
.txt-unmatched {
    margin-top: 10px;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    padding: 10px 14px;
}
.txt-unmatched-title { font-size: 11px; font-weight: 700; color: #991b1b; text-transform: uppercase; margin-bottom: 6px; }
.txt-unmatched-item { display: inline-block; background-color:#fee2e2; color:#991b1b; padding:3px 8px; border-radius:4px; font-size:11px; margin:2px; font-weight:600; }

/* =========================================================== */
/* HASTA LİSTESİ BAŞLIK, FİLTRE VE İSTATİSTİK KARTLARI        */
/* =========================================================== */
.patient-list-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    flex-wrap: wrap;
}
.patient-list-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.search-bar-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.search-bar-wrapper .search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
    z-index: 1;
}
.search-bar-wrapper .form-control {
    padding-left: 34px;
    width: 200px;
    height: 38px;
    font-size: 13px;
}
.patient-list-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card {
    background: linear-gradient(135deg, #f8fafc, #ffffff);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: box-shadow 0.2s ease;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card-icon { font-size: 18px; margin-bottom: 6px; }
.stat-card-value { font-size: 20px; font-weight: 800; font-family: var(--font-heading); color: var(--secondary-color); }
.stat-card-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }

@media (max-width: 768px) {
    .patient-list-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .patient-list-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .search-bar-wrapper {
        width: 100%;
    }
    .search-bar-wrapper .form-control {
        width: 100%;
    }
    #clear-patient-filter-btn {
        width: 100%;
        height: 38px;
        justify-content: center;
    }
    #reset-tests-btn {
        width: 100%;
        height: 38px;
        justify-content: center;
    }
    .lab-top-row {
        grid-template-columns: 1fr;
        gap: 14px;
        background-color: #f8fafc;
        padding: 16px;
        border-radius: var(--radius-md);
        border: 1px solid var(--border-color);
    }
    .lab-top-row .form-group {
        width: 100%;
    }
    .lab-top-row .form-label {
        font-size: 13px;
        font-weight: 700;
    }
    .lab-top-row .form-control {
        width: 100%;
        font-size: 14px;
    }
}
