/* ===== إعدادات عامة مريحة لضعف النظر ===== */
:root {
    --font-scale: 1.5;
    --font-family-base: Arial, sans-serif;
    --font-size-base-base: 16px;
    --font-size-md-base: 14px;
    --font-size-sm-base: 10px;
    --font-size-count-base: 18px;
    --font-size-lg-base: 20px;
    --font-size-print-base: 17px;
    --font-size-xxl-base: 24px;
    --font-size-icon-base: 26px;
    --font-size-base: calc(var(--font-size-base-base) * var(--font-scale));
    --font-size-md: calc(var(--font-size-md-base) * var(--font-scale));
    --font-size-sm: calc(var(--font-size-sm-base) * var(--font-scale));
    --font-size-count: calc(var(--font-size-count-base) * var(--font-scale));
    --font-size-lg: calc(var(--font-size-lg-base) * var(--font-scale));
    --font-size-print: calc(var(--font-size-print-base) * var(--font-scale));
    --font-size-xxl: calc(var(--font-size-xxl-base) * var(--font-scale));
    --font-size-icon: calc(var(--font-size-icon-base) * var(--font-scale));
    --font-weight-bold: 700;
    --link-blue: #0d6efd;
}

body {
    font-family: var(--font-family-base);
    direction: rtl;
    background: #f4f6f8;
    color: #111;
    font-size: var(--font-size-lg);   /* أكبر بوضوح */
    font-weight: var(--font-weight-bold);
    line-height: 1.9;  /* تباعد مريح */
    margin: 0;
}

/* ===== العناوين ===== */
h1 {
    font-size: var(--font-size-lg);
    margin-bottom: 18px;
}

h2 {
    font-size: var(--font-size-lg);
    margin-bottom: 18px;
}

h3 {
    font-size: var(--font-size-lg);
    margin-bottom: 14px;
}

/* ===== الشريط العلوي ===== */
.topbar {
    background: #0d6efd;
    color: #fff;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar .title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
}

.topbar a {
    color: #fff;
    text-decoration: none;
    margin-left: 14px;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
}

/* ===== الحاوية ===== */
.container {
    padding: 18px;
}

/* ===== الأزرار ===== */
.btn {
    display: inline-block;
    padding: 14px 18px;   /* أكبر للمس */
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    background: #0d6efd;
}

.btn-success {
    background: #198754;
}

.btn-danger {
    background: #dc3545;
}

/* زر بإطار (مفيد للأزرار الثانوية) */
.btn-outline {
    background: #fff;
    color: #0d6efd;
    border: 2px solid #0d6efd;
}

/* زر مفعّل (مثلا عند تفعيل فلتر المتابعات) */
.btn-active {
    background: #dc3545;
    color: #fff;
    border: none;
}

/* ===== النماذج ===== */
label {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
}

textarea, select, input[type="text"], input[type="password"] {
    width: 100%;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    padding: 14px;
    margin-top: 8px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

input::placeholder,
textarea::placeholder {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
}

/* ===== البطاقات ===== */
.card {
    background: #fff;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* ===== الجداول ===== */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th, td {
    padding: 16px;
    border-bottom: 1px solid #ddd;
    font-size: var(--font-size-lg);
}

th {
    background: #eef1f4;
}

/* ===== نجمة المتابعة الحمراء =====
   تظهر بجانب اسم المريض إذا لديه متابعة مفتوحة
*/
.followup-star {
    color: #dc3545 !important;
    font-size: var(--font-size-icon);
    font-weight: var(--font-weight-bold);
    margin-left: 10px;
     margin-right: 10px;
    vertical-align: middle;
    line-height: 1;
}


/* ترتيب الاسم والنجمة معًا */
.name-with-star {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}


/* تنسيق جدول الزيارات بحيث يتطابق الرأس مع البيانات */
.visits-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    direction: rtl;
}

.visits-table th,
.visits-table td {
    text-align: center;
    vertical-align: middle;
    padding: 16px;
    border-bottom: 1px solid #ddd;
    font-size: var(--font-size-lg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* عمود التاريخ */
.visits-table th:nth-child(1),
.visits-table td:nth-child(1) {
    width: 160px;
}

/* عمود المتابعة */
.visits-table th:nth-child(3),
.visits-table td:nth-child(3) {
    width: 130px;
}

/* عمود التفاصيل */
.visits-table th:nth-child(4),
.visits-table td:nth-child(4) {
    width: 140px;
}

/* عمود الشكوى نسمح له بالالتفاف لو كان طويلًا */
.visits-table th:nth-child(2),
.visits-table td:nth-child(2) {
    white-space: normal;
}


/* تنسيق جدول المرضى: تثبيت الرأس مع البيانات */
.patients-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    direction: rtl;
    background: #fff;
}

.patients-table th,
.patients-table td {
    text-align: center;
    vertical-align: middle;
    padding: 16px;
    border-bottom: 1px solid #ddd;
    font-size: var(--font-size-lg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* العمود 1: الاسم (أوسع) */
.patients-table th:nth-child(1),
.patients-table td:nth-child(1) {
    width: 260px;
    white-space: normal; /* الاسم قد يكون طويلًا */
}

/* العمود 2: العمر */
.patients-table th:nth-child(2),
.patients-table td:nth-child(2) {
    width: 90px;
}

/* العمود 3: المنطقة */
.patients-table th:nth-child(3),
.patients-table td:nth-child(3) {
    width: 180px;
    white-space: normal;
}

/* العمود 4: عدد الزيارات */
.patients-table th:nth-child(4),
.patients-table td:nth-child(4) {
    width: 120px;
}

/* العمود 5: آخر زيارة */
.patients-table th:nth-child(5),
.patients-table td:nth-child(5) {
    width: 140px;
}

/* العمود 6: إجراءات (أزرار) */
.patients-table th:nth-child(6),
.patients-table td:nth-child(6) {
    width: 260px;
    white-space: normal;
}

.btn-small {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
}

.btn-link {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--link-blue);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    text-decoration: underline;
}

.btn-clear {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--link-blue);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
}
