/* --- DEĞİŞKENLER VE TEMEL AYARLAR --- */
:root {
    --primary-color: #002e6e; /* Görsellere hizalı ana mavi */
    --secondary-color: #2b7a78;
    --bg-color: #f4f7f6;
    --sidebar-bg: #1a3b5d;
    --sidebar-hover: #244a73;
    --text-color: #333;
    --text-light: #64748b;
    --white: #ffffff;
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden; /* Dış scroll'u kapat, sadece içerik scroll olsun */
}

/* --- ANA YAPI (LAYOUT) --- */
.app-container {
    display: flex;
    height: 100vh;
}

/* --- SOL MENÜ (SIDEBAR) --- */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--white);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.sidebar-logo {
    padding: 20px;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background-color: rgba(0,0,0,0.1);
}
.sidebar-logo i {
    font-size: 20px;
}
.sidebar-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.sidebar-logo-text span {
    font-size: 15px;
    font-weight: 700;
}
.sidebar-logo-text small {
    font-size: 11px;
    color: #cbd5e1;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: #cbd5e1;
    text-decoration: none;
    gap: 15px;
    transition: 0.2s;
    font-size: 15px;
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.sidebar-nav a:hover {
    background-color: var(--sidebar-hover);
    color: var(--white);
}

.sidebar-nav a.active {
    background-color: var(--primary-color);
    color: var(--white);
    border-left: 4px solid #60a5fa;
}

.sidebar-profile {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.08);
}
.sidebar-profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.2);
}
.sidebar-profile-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.sidebar-profile-name {
    font-size: 12px;
    color: #f8fafc;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-profile-role {
    font-size: 11px;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- SAĞ İÇERİK ALANI --- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- ÜST HEADER --- */
.top-header {
    height: 70px;
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-color);
    cursor: pointer;
    display: none; /* Mobilde açılacak */
}

.breadcrumb {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 18px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.lang-switcher {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    border: 1px solid var(--border-color);
}

.lang-switcher .lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-light);
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.lang-switcher .lang-btn:hover:not(.active) {
    color: var(--primary-color);
    background: rgba(0, 46, 110, 0.06);
}

.lang-switcher .lang-btn.active {
    background: var(--primary-color);
    color: #fff;
}

.header-action {
    position: relative;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-light);
}

.header-action .badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
}

.user-role {
    font-size: 12px;
    color: var(--text-light);
}

/* --- ANA İÇERİK SAYFASI (MAIN) --- */
.content-area {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.page-header {
    margin-bottom: 25px;
}

.page-header h2 {
    font-size: 24px;
    color: var(--text-color);
    margin-bottom: 5px;
}

.page-header p {
    color: var(--text-light);
    font-size: 14px;
}

.placeholder-content {
    background: var(--white);
    padding: 40px;
    text-align: center;
    border-radius: 8px;
    border: 1px dashed var(--border-color);
    color: var(--text-light);
}

/* --- RESPONSIVE EKRANLAR (MOBİL UYUM) --- */
@media (max-width: 992px) {
    .menu-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: -260px; /* Varsayılan olarak kapalı */
        top: 0;
        bottom: 0;
        z-index: 1000;
        box-shadow: 4px 0 10px rgba(0,0,0,0.1);
    }

    .sidebar.active {
        left: 0; /* Butona basınca açılacak */
    }

    .user-info {
        display: none; /* Mobilde ismi gizle sadece profil fotoğrafı kalsın */
    }
}

/* --- BUTONLAR --- */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: #0c3e69; }
.btn-secondary { background-color: var(--sidebar-hover); color: white; }
.btn-outline-primary { background-color: transparent; border: 1px solid var(--primary-color); color: var(--primary-color); }
.btn-outline-primary:hover { background-color: var(--primary-color); color: white; }
.btn-outline-secondary { background-color: transparent; border: 1px solid #94a3b8; color: #475569; }
.btn-outline-secondary:hover { background-color: #f1f5f9; }
.w-100 { width: 100%; justify-content: center; }
.mb-10 { margin-bottom: 10px; }
.btn-icon { background: #f1f5f9; border: none; color: #475569; width: 32px; height: 32px; border-radius: 6px; cursor: pointer; transition: 0.2s; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn-icon:hover { background: var(--primary-color); color: white; }

/* --- DASHBOARD HEADER --- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}
.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}
.date-filter {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    font-size: 14px;
    outline: none;
}

/* --- KPI KARTLARI --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.kpi-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--border-color);
}
.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.kpi-icon.blue { background: #e0f2fe; color: #0284c7; }
.kpi-icon.yellow { background: #fef08a; color: #ca8a04; }
.kpi-icon.green { background: #dcfce3; color: #16a34a; }
.kpi-icon.purple { background: #f3e8ff; color: #9333ea; }
.kpi-icon.red { background: #fee2e2; color: #dc2626; }

.kpi-details h3 {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 5px;
}
.kpi-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}
.trend { font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 4px; }
.trend.up { background: #dcfce3; color: #16a34a; }
.trend.down { background: #fee2e2; color: #dc2626; }

/* --- ORTA GRİD (Tablo ve Hızlı Araçlar) --- */
.dashboard-middle-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}
.card {
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    overflow: hidden;
}
.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-header h3 { font-size: 16px; color: var(--text-color); }
.view-all { font-size: 13px; color: var(--primary-color); text-decoration: none; font-weight: 500; }
.view-all:hover { text-decoration: underline; }

/* --- TABLO STİLLERİ --- */
.table-responsive { overflow-x: auto; }
.styled-table { width: 100%; border-collapse: collapse; }
.styled-table th, .styled-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}
.styled-table th { background: #f8fafc; color: var(--text-light); font-weight: 600; font-size: 13px; text-transform: uppercase;}
.styled-table tbody tr:hover { background-color: #f8fafc; }

/* Hasta Avatar Bilgisi */
.patient-info { display: flex; align-items: center; gap: 12px; }
.patient-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-color); color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; }
.patient-img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.p-name { display: block; font-weight: 600; color: var(--text-color); }
.p-meta { display: block; font-size: 12px; color: var(--text-light); }
td small { color: var(--text-light); }

/* ROZETLER (Badges - Döküman Tavsiyesi) */
.badge { padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; }
/* Durum Etiketleri */
.badge-status-yellow { background: #fef9c3; color: #a16207; } /* İncelemede, Evrak Bekleniyor */
.badge-status-blue { background: #dbeafe; color: #1d4ed8; } /* Hastane Aranıyor, Hastane Seçildi */
.badge-status-purple { background: #f3e8ff; color: #7e22ce; } /* Elçilik / Tedavide */
.badge-status-green { background: #dcfce3; color: #16a34a; } /* Onaylandı */
/* Öncelik Etiketleri */
.badge-priority-red { background: #fee2e2; color: #b91c1c; } /* Acil */
.badge-priority-yellow { background: #ffedd5; color: #c2410c; } /* Orta */
.badge-priority-green { background: #ecfdf5; color: #047857; } /* Rutin */

/* --- HIZLI ARAÇLAR --- */
.tools-content { padding: 20px; }
.search-box label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text-color);}
.input-group { display: flex; }
.input-group input { flex: 1; padding: 10px; border: 1px solid var(--border-color); border-radius: 6px 0 0 6px; outline: none; }
.input-group .btn { border-radius: 0 6px 6px 0; }
.tools-content hr { border: 0; border-top: 1px solid var(--border-color); margin: 20px 0; }

/* --- GRAFİKLER GRİDİ --- */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
.chart-body {
    padding: 20px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- MOBİL UYUMLULUK --- */
@media (max-width: 1200px) {
    .charts-grid { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .kpi-grid { grid-template-columns: 1fr; }
}

/* --- YARDIMCI SINIFLAR --- */
.hidden { display: none !important; }
.d-flex-between { display: flex; justify-content: space-between; align-items: center; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.p-20 { padding: 20px; }
.text-right { text-align: right; }
.text-muted { color: var(--text-light); }
.text-red { color: #dc2626; }
.text-bold-red { color: #dc2626; font-weight: bold; }
.bg-light { background-color: #f8fafc; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* --- TOOLBAR (Araç Çubuğu) --- */
.toolbar {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}
.filters { display: flex; gap: 10px; }

/* --- FORM ELEMANLARI --- */
.form-grid { display: flex; flex-direction: column; gap: 30px; }
.form-section h3 { font-size: 15px; color: var(--primary-color); margin-bottom: 15px; border-bottom: 1px solid var(--border-color); padding-bottom: 5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text-color); }
.form-control { width: 100%; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 14px; outline: none; transition: 0.2s; }
.form-control:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(0, 46, 110, 0.12); }
.form-control[readonly] { background-color: #f1f5f9; color: var(--text-light); cursor: not-allowed; }
.full-width { grid-column: 1 / -1; }
.read-only-box { padding: 12px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 14px; background: white; min-height: 44px;}

/* --- HASTA DETAY PROFIL KARTI --- */
.profile-header {
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, #ffffff, #f8fafc);
}
.profile-main { display: flex; align-items: center; gap: 20px; }
.patient-avatar.large { width: 80px; height: 80px; font-size: 28px; }
.profile-info h2 { font-size: 22px; margin-bottom: 5px; color: var(--text-color); }
.profile-meta { display: flex; gap: 15px; font-size: 13px; color: var(--text-light); flex-wrap: wrap; }
.profile-meta span { display: flex; align-items: center; gap: 5px; }
.profile-actions { display: flex; gap: 10px; }

/* --- SEKMELER (TABS) --- */
.tabs-nav {
    display: flex;
    list-style: none;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
    padding: 0 10px;
}
.tabs-nav li {
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tabs-nav li:hover { color: var(--primary-color); }
.tabs-nav li.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    background: white;
    border-radius: 6px 6px 0 0;
}
.tabs-content { padding: 25px; border-top: none; border-radius: 0 0 10px 10px; }
.tab-pane h3 { font-size: 16px; margin-bottom: 10px; color: var(--text-color); }

/* --- RADYOLOJİ GRID --- */
.radiology-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.radio-card { border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; background: white; text-align: center; cursor: pointer; transition: 0.2s;}
.radio-card:hover { border-color: var(--primary-color); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.radio-img { height: 120px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; }
.radio-info { padding: 12px; border-top: 1px solid var(--border-color); }
.radio-info h4 { font-size: 13px; margin-bottom: 4px; }
.radio-info span { font-size: 11px; color: var(--text-light); }
.upload-zone { border: 2px dashed #cbd5e1; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 185px; color: #64748b; cursor: pointer; transition: 0.2s;}
.upload-zone:hover { border-color: var(--primary-color); color: var(--primary-color); background: #f8fafc; }
.upload-zone i { font-size: 30px; margin-bottom: 10px; }

/* --- DOKÜMAN LİSTESİ --- */
.document-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.document-list li { display: flex; justify-content: space-between; align-items: center; padding: 15px; border: 1px solid var(--border-color); border-radius: 8px; background: white; transition: 0.2s; }
.document-list li:hover { border-color: #cbd5e1; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
.doc-info { display: flex; align-items: center; gap: 15px; }
.doc-icon { font-size: 24px; }
.doc-icon.pdf { color: #ef4444; }
.doc-icon.word { color: #2563eb; }
.doc-info h4 { font-size: 14px; margin-bottom: 3px; }
.doc-info span { font-size: 12px; color: var(--text-light); }
.doc-actions { display: flex; gap: 5px; }

/* --- ORTAK MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background: white;
    width: 500px;
    max-width: calc(100vw - 30px);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.close-modal {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-light);
    cursor: pointer;
}

/* --- YARDIMCI FLEX SINIFLARI --- */
.flex-between-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.flex-end-wrap {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.detail-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.toolbar-search {
    width: 100%;
    max-width: 340px;
}

/* --- SAYFA MODÜLLERİ (Responsive hedefleri) --- */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

@media (max-width: 1400px) {
    .referral-grid {
        grid-template-columns: 280px 1fr 280px;
    }
    .visa-grid {
        grid-template-columns: 240px 1fr 280px;
    }
}

@media (max-width: 1200px) {
    .referral-grid,
    .visa-grid,
    .treatment-grid {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
    }
    .referral-grid .panel {
        min-height: 280px;
        max-height: 520px;
    }
    .referral-grid .chat-area {
        min-height: 220px;
    }
    .fin-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .hospital-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .analytics-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    body {
        overflow: hidden;
    }

    .content-area {
        padding: 16px;
    }

    .top-header {
        padding: 10px 14px;
        min-height: 60px;
        height: auto;
    }

    .header-right {
        gap: 14px;
    }

    .breadcrumb {
        font-size: 16px;
        line-height: 1.3;
    }

    .page-header h2 {
        font-size: 20px;
    }

    .page-header.d-flex-between,
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-header .header-actions {
        width: 100%;
    }

    .dashboard-header .date-filter {
        flex: 1;
        min-width: 0;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .toolbar .search-box,
    .toolbar .input-group,
    .toolbar-search {
        width: 100% !important;
        max-width: none;
    }

    .filters {
        flex-wrap: wrap;
        width: 100%;
    }

    .filters .form-control {
        flex: 1 1 140px;
        min-width: 0;
    }

    .profile-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
    }

    .profile-actions {
        flex-wrap: wrap;
        width: 100%;
    }

    .profile-actions .btn {
        flex: 1 1 auto;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .financial-header,
    .treatment-header,
    .embassy-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 18px;
    }

    .fin-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stepper-wrapper {
        overflow-x: auto;
        justify-content: flex-start;
        gap: 8px;
        padding: 0 4px 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .stepper-wrapper::before {
        display: none;
    }

    .step {
        width: auto;
        min-width: 88px;
        flex-shrink: 0;
    }

    .step-text {
        font-size: 11px;
        line-height: 1.3;
    }

    .tabs-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 0 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .tabs-nav li {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 12px 14px;
        font-size: 13px;
    }

    .tabs-content {
        padding: 16px;
    }

    .card-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .document-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .doc-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .doctor-profile {
        flex-wrap: wrap;
    }

    .meta-info,
    .t-meta {
        flex-wrap: wrap;
        gap: 10px;
    }

    .analytics-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .period-toggle {
        flex-wrap: wrap;
    }

    .export-actions {
        flex-wrap: wrap;
    }

    .hospital-grid {
        grid-template-columns: 1fr !important;
    }

    .detail-nav-bar .btn {
        flex: 1 1 auto;
    }

    .styled-table th,
    .styled-table td {
        padding: 12px 14px;
    }
}

@media (max-width: 768px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .fin-summary-grid,
    .analytics-kpis {
        grid-template-columns: 1fr;
    }

    .analytics-grid .span-8,
    .analytics-grid .span-6,
    .analytics-grid .span-4 {
        grid-column: span 12;
    }

    .styled-table th,
    .styled-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .kpi-value {
        font-size: 20px;
        flex-wrap: wrap;
    }

    .chart-body {
        height: 260px;
        padding: 14px;
    }

    .chart-body.small {
        height: 220px;
    }

    .log-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .log-input-area > div {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px;
    }

    .log-input-area #log-type {
        width: 100% !important;
    }

    .log-input-area .btn {
        width: 100%;
        justify-content: center;
    }

    .doc-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .doc-item .doc-action {
        align-self: flex-end;
    }

    .msg {
        max-width: 95%;
    }

    .price-tag {
        font-size: 24px;
    }

    .app-code {
        font-size: 18px;
        word-break: break-all;
    }

    .pdf-placeholder {
        width: 92% !important;
        height: 85% !important;
    }

    .modal-content {
        width: 100% !important;
        max-width: calc(100vw - 24px);
        padding: 18px;
        margin: 12px;
    }

    .modal-footer-actions,
    .flex-end-wrap {
        justify-content: stretch;
    }

    .modal-footer-actions .btn,
    .flex-end-wrap .btn {
        flex: 1 1 45%;
    }

    .radiology-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 14px;
    }

    .patient-avatar.large {
        width: 64px;
        height: 64px;
        font-size: 22px;
    }

    .profile-info h2 {
        font-size: 18px;
    }

    .fin-card .amount {
        font-size: 18px;
    }

    .input-group {
        flex-wrap: nowrap;
    }

    .input-group .btn {
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .content-area {
        padding: 12px;
    }

    .top-header {
        padding: 8px 10px;
    }

    .header-right {
        gap: 10px;
    }

    .user-info {
        display: none;
    }

    .lang-switcher .lang-btn {
        min-width: 30px;
        padding: 5px 8px;
        font-size: 11px;
    }

    .btn {
        padding: 9px 14px;
        font-size: 13px;
    }

    .page-header h2 {
        font-size: 18px;
    }

    .placeholder-content {
        padding: 24px 16px;
    }

    .detail-nav-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .detail-nav-bar .btn {
        width: 100%;
        justify-content: center;
    }

    .fin-summary-grid {
        grid-template-columns: 1fr;
    }
}
