/* Smart Doctor - تحسينات الواجهة والجوال */

/* ===== الهيدر ===== */
.doctor-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.doctor-header .header-search input {
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: white;
}
.doctor-header .header-search input::placeholder { color: rgba(255,255,255,0.6); }
.doctor-header .header-search button {
    border-radius: 8px;
    background: var(--primary-light, #14b8a6);
    color: white;
    border: none;
    cursor: pointer;
}
.sidebar li a {
    transition: background 0.2s, color 0.2s;
    padding: 10px 14px;
    border-radius: 8px;
    display: block;
}
.sidebar li a:hover {
    background: rgba(255,255,255,0.08);
}
.sidebar li a.active {
    background: rgba(20, 184, 166, 0.2);
    border-radius: 8px;
    color: #14b8a6 !important;
}
.sidebar li.sidebar-group {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    padding: 12px 14px 6px;
    margin-top: 8px;
}
.sidebar-quick-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    margin: 0;
}
.sidebar-quick-item .sidebar-quick-name {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0;
    border-radius: 8px;
}
.sidebar-quick-item .sidebar-quick-icon {
    flex-shrink: 0;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    padding: 4px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.sidebar-quick-item .sidebar-quick-icon:hover {
    color: #14b8a6;
}

/* ===== لوحة التحكم الرئيسية ===== */
.doctor-dashboard-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
    background: linear-gradient(to left, rgba(13, 148, 136, 0.05), transparent);
    padding: 20px;
    border-radius: 12px;
}
.doctor-greeting h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}
.doctor-subtitle {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.doctor-quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.doctor-quick-actions .btn-primary,
.doctor-quick-actions .btn-secondary {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.doctor-quick-actions .btn-primary:hover,
.doctor-quick-actions .btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* بطاقات الإحصائيات */
.doctor-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.doctor-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    min-height: 130px;
    overflow: hidden;
}
.doctor-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary, #0d9488), rgba(13, 148, 136, 0.5));
    opacity: 0;
    transition: opacity 0.3s;
}
.doctor-stat-card:hover::before {
    opacity: 1;
}
.doctor-stat-card:hover {
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.15);
    transform: translateY(-4px);
    border-color: var(--primary, #0d9488);
}
.doctor-stat-card-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.doctor-stat-card-link:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}
.doctor-stat-card-warning:hover {
    border-color: #ef4444;
}
.doctor-stat-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.9;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: transform 0.3s;
}
.doctor-stat-card:hover .doctor-stat-icon {
    transform: scale(1.1);
}
.doctor-stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
    margin: 4px 0;
    transition: color 0.3s;
}
.doctor-stat-card-link .doctor-stat-value { color: var(--primary); }
.doctor-stat-card-warning .doctor-stat-value { color: #ef4444; }
.doctor-stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
    width: 100%;
}
.doctor-stat-trend {
    font-size: 0.75rem;
    margin-top: 8px;
    font-weight: 500;
    width: 100%;
    text-align: center;
}
.doctor-stat-trend.positive { color: #22c55e; }
.doctor-stat-trend.negative { color: #ef4444; }

/* تنبيهات */
.doctor-alert {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.doctor-alert-critical {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fecaca;
    color: #b91c1c;
}
.doctor-alert-icon { font-size: 1.5rem; }
.doctor-alert-content { flex: 1; min-width: 200px; }
.doctor-alert-action {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    white-space: nowrap;
}
.doctor-alert-action:hover { opacity: 0.9; }

/* تذكيرات */
.doctor-reminder-card {
    margin-bottom: 20px;
    border-right: 4px solid;
}
.doctor-reminder-overdue { border-right-color: #dc2626; }
.doctor-reminder-upcoming { border-right-color: #f59e0b; }
.doctor-card-title { margin-top: 0; margin-bottom: 12px; }

/* تقرير شهري */
.doctor-monthly-report { margin-bottom: 24px; }
.doctor-monthly-report .btn-secondary {
    margin-bottom: 12px;
    display: inline-block;
}

/* رسوم بيانية */
.doctor-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
.doctor-chart-card .doctor-card-title { margin-top: 0; }
.doctor-recent-orders .doctor-card-title { margin-top: 0; }

/* الوضع الداكن */
body.dark-mode .doctor-stat-card {
    background: var(--bg-secondary, #1e293b);
    border-color: rgba(255,255,255,0.1);
}
body.dark-mode .doctor-alert-critical {
    background: linear-gradient(135deg, rgba(127,29,29,0.3), rgba(185,28,28,0.2));
    border-color: rgba(239,68,68,0.4);
}

@media (max-width: 768px) {
    .doctor-dashboard-header { flex-direction: column; }
    .doctor-quick-actions { width: 100%; }
    .doctor-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .doctor-charts-grid { grid-template-columns: 1fr; }
    .doctor-header .top-bar-left { flex-wrap: wrap; }
    .doctor-header .header-search { order: 3; width: 100%; margin-top: 8px; }
    .doctor-header .header-search input { min-width: 100% !important; }
    .top-bar-right { flex-wrap: wrap; gap: 8px; }
    .layout { flex-direction: column; }
    .sidebar { width: 100%; }
    .sidebar ul { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 12px; }
    .sidebar li { margin: 0; }
    .sidebar li.sidebar-group { display: none; }
    .content { padding: 12px; }
    .page-header { flex-direction: column; align-items: flex-start !important; gap: 12px; }
    .form-grid { grid-template-columns: 1fr !important; }
    .card table { font-size: 0.85rem; }
    .card th, .card td { padding: 8px 6px; }
}
@media (max-width: 480px) {
    .doctor-stats-grid { grid-template-columns: 1fr; }
    .doctor-header strong { font-size: 0.95rem; }
    .top-bar { padding: 12px; }
}
/* ما يحتاج مراجعة اليوم */
.doctor-today-tasks { margin-bottom: 24px; }
.doctor-today-tasks-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.doctor-task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: transform 0.2s, box-shadow 0.2s;
}
.doctor-task-item:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.doctor-task-urgent { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.doctor-task-overdue { border-color: #fed7aa; background: #fff7ed; color: #c2410c; }
.doctor-task-pending { border-color: #fef3c7; background: #fffbeb; color: #b45309; }
.doctor-task-done { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.doctor-task-icon { font-size: 1.25rem; }
.doctor-task-text { flex: 1; font-weight: 500; }
.doctor-task-action { font-size: 0.85rem; color: var(--primary); }

/* ===== مؤشر النشاط ===== */
.doctor-activity-indicator {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
}
.doctor-activity-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}
.doctor-activity-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}
.doctor-activity-fill {
    height: 100%;
    background: linear-gradient(90deg, #0d9488, #14b8a6);
    border-radius: 4px;
    transition: width 0.3s;
}

/* بطاقة المريض السريعة */
.doctor-patient-card-tooltip {
    position: fixed;
    z-index: 9999;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 16px;
    max-width: 320px;
    font-size: 0.9rem;
}
.doctor-patient-card-loading, .doctor-patient-card-error { color: var(--text-muted); }
.doctor-patient-card a { color: var(--primary); }

/* وضع التركيز */
body.doctor-focus-mode .sidebar { display: none !important; }
body.doctor-focus-mode .layout { display: block; }
body.doctor-focus-mode .content { max-width: 100%; }
.doctor-focus-exit {
    padding: 6px 12px;
    background: var(--primary);
    color: white !important;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    margin-right: 8px;
}

/* بحث - فلاتر ووسوم */
.doctor-search-form { max-width: 100%; }
.doctor-search-row { display: flex; gap: 8px; margin-bottom: 12px; position: relative; }
.doctor-search-row input { flex: 1; }
.doctor-search-row input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15) !important;
    outline: none;
}
.doctor-search-filters { 
    display: grid; 
    grid-template-columns: auto 1fr 1fr; 
    gap: 16px; 
    align-items: center; 
    font-size: 0.9rem; 
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 10px;
}
@media (max-width: 768px) {
    .doctor-search-filters {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}
.doctor-recent-search { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.doctor-recent-search-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.doctor-search-tag {
    padding: 10px 18px;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 20px;
    text-decoration: none;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.doctor-search-tag:hover { 
    background: var(--primary); 
    color: white; 
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

/* تقويم التذكيرات */
.doctor-calendar-card { padding: 20px; }
.doctor-calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 0;
}
.doctor-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.cal-weekday { font-size: 0.75rem; color: var(--text-muted); text-align: center; padding: 4px; }
.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.9rem;
    position: relative;
}
.cal-day.cal-has-reminder { background: rgba(13, 148, 136, 0.15); color: var(--primary); }
.cal-dot { position: absolute; bottom: 2px; font-size: 0.65rem; color: var(--primary); }

/* ===== صفحة تذكيرات المتابعة ===== */
.doctor-reminders-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}
.doctor-reminders-header h1 { margin: 0; font-size: 1.6rem; }
.doctor-reminders-subtitle {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.doctor-reminders-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.doctor-reminders-actions .btn-secondary.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.doctor-reminders-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
@media (max-width: 600px) {
    .doctor-reminders-summary { grid-template-columns: repeat(2, 1fr); }
}
.doctor-rem-summary-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
    background: var(--bg-card);
}
.doctor-rem-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.doctor-rem-summary-num {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}
.doctor-rem-summary-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }
.doctor-rem-overdue { border-right: 4px solid #ef4444; }
.doctor-rem-overdue .doctor-rem-summary-num { color: #ef4444; }
.doctor-rem-today { border-right: 4px solid #f59e0b; }
.doctor-rem-today .doctor-rem-summary-num { color: #f59e0b; }
.doctor-rem-week { border-right: 4px solid #10b981; }
.doctor-rem-week .doctor-rem-summary-num { color: #10b981; }
.doctor-rem-done { border-right: 4px solid #6b7280; opacity: 0.9; }
.doctor-rem-done .doctor-rem-summary-num { color: #6b7280; }

.doctor-add-reminder-card {
    margin-bottom: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-right: 4px solid var(--primary, #0d9488);
}
.doctor-add-reminder-title {
    margin: 0;
    padding: 16px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}
.doctor-add-reminder-form { padding: 20px; }
.doctor-add-reminder-grid {
    display: grid;
    grid-template-columns: 1fr 160px 1fr auto;
    gap: 16px;
    align-items: end;
}
.doctor-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.doctor-form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}
.doctor-form-group input,
.doctor-form-group select {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary, #f8fafc);
    font-size: 0.95rem;
}
.doctor-form-group input:focus,
.doctor-form-group select:focus {
    outline: none;
    border-color: var(--primary, #0d9488);
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.15);
}
.doctor-form-group-note { min-width: 0; }
.doctor-form-group-patient { position: relative; }
.doctor-patient-search-input {
    margin-bottom: 6px;
    padding: 8px 12px 8px 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary, #f8fafc);
    font-size: 0.9rem;
}
.doctor-patient-search-input::placeholder { color: var(--text-muted); }
.doctor-patient-search-input:focus {
    outline: none;
    border-color: var(--primary, #0d9488);
}
.doctor-patient-suggest {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    z-index: 40;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow, 0 10px 25px rgba(15,23,42,0.12));
    max-height: 260px;
    overflow-y: auto;
    padding: 4px;
    display: none;
}
.doctor-patient-suggest-item {
    display: block;
    width: 100%;
    text-align: right;
    padding: 6px 8px;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
}
.doctor-patient-suggest-item:hover {
    background: var(--bg-secondary);
}
.doctor-add-reminder-submit {
    display: flex;
    align-items: flex-end;
}
.doctor-add-reminder-submit .btn-primary {
    padding: 10px 20px;
    white-space: nowrap;
}
.doctor-smart-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 14px 0 0;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}
.doctor-inline-search-wrap {
    margin-top: 10px;
}
.doctor-inline-patient-search {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.doctor-inline-patient-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* ===== صفحة المواعيد اليومية ===== */
.doctor-appointments-page .content { padding: 20px; }
.doctor-appointments-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}
.doctor-appointments-header h1 { margin: 0; font-size: 1.6rem; }
.doctor-appointments-subtitle { margin: 4px 0 0; color: var(--text-muted); font-size: 0.95rem; }
.doctor-appointments-date-nav { margin-bottom: 24px; padding: 16px 20px; }
.doctor-date-nav-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.doctor-date-input {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 1rem;
}
.doctor-add-appointment-card { margin-bottom: 24px; border-right: 4px solid var(--primary, #0d9488); }
.doctor-add-appointment-title { margin: 0; padding: 16px 20px; font-size: 1.1rem; font-weight: 600; border-bottom: 1px solid var(--border); }
.doctor-add-appointment-form { padding: 20px; }
.doctor-add-appointment-grid {
    display: grid;
    grid-template-columns: 1fr 120px 100px 1fr auto;
    gap: 16px;
    align-items: end;
}
.doctor-add-appointment-submit .btn-primary { padding: 10px 20px; white-space: nowrap; }
.doctor-form-group-time .doctor-time-display {
    min-width: 120px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 38px;
    font-weight: 500;
}
.doctor-form-group-time label { display: flex; align-items: center; gap: 4px; }

/* منتقي الوقت - شكل الساعة */
.doctor-time-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.doctor-time-picker-overlay.show {
    opacity: 1;
    visibility: visible;
}
.doctor-time-picker-modal {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    overflow: hidden;
    min-width: 280px;
}
.doctor-time-picker-header {
    background: #334155;
    padding: 18px;
    text-align: center;
}
.doctor-time-digital {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    letter-spacing: 2px;
}
.doctor-time-picker-body {
    padding: 20px;
}
.doctor-time-spinner-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.doctor-time-spinner-row:last-child { margin-bottom: 0; }
.doctor-time-spinner-row label {
    min-width: 70px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}
.doctor-time-spinner {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.doctor-spinner-input {
    width: 64px;
    padding: 12px;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
}
.doctor-spinner-updown {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.doctor-spinner-btn {
    width: 36px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.doctor-spinner-btn:hover {
    background: var(--border);
}
.doctor-ampm-inline {
    display: flex;
    gap: 6px;
}
.doctor-ampm-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.doctor-ampm-btn:hover { background: var(--border); }
.doctor-ampm-btn.active {
    background: #334155;
    color: white;
    border-color: #334155;
    font-weight: 600;
}
.doctor-time-picker-modal.doctor-time-picker-spinner { min-width: 300px; }
.doctor-time-picker-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    align-items: center;
    flex-wrap: wrap;
}
.doctor-time-btn {
    flex: 1;
    min-width: 70px;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.doctor-time-btn:hover { background: var(--border); }
.doctor-time-set {
    background: var(--primary, #0d9488);
    color: white;
    border-color: var(--primary);
}
.doctor-time-set:hover { filter: brightness(1.1); }
.doctor-appointments-list { margin-bottom: 24px; }
.doctor-appointments-list-title { margin: 0; padding: 16px 20px; font-size: 1.1rem; font-weight: 600; border-bottom: 1px solid var(--border); }
.doctor-appointments-empty { padding: 32px 20px; text-align: center; color: var(--text-muted); }
.doctor-appointments-table-wrapper { overflow-x: auto; }
.doctor-appointments-table { width: 100%; }
.doctor-appointments-table th { padding: 12px 16px; text-align: right; background: var(--bg-secondary); }
.doctor-appointments-table td { padding: 12px 16px; }
.doctor-apt-time { font-weight: 600; white-space: nowrap; }
.doctor-apt-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
}
.doctor-apt-scheduled { background: #dbeafe; color: #1d4ed8; }
.doctor-apt-confirmed { background: #fef3c7; color: #b45309; }
.doctor-apt-completed { background: #d1fae5; color: #047857; }
.doctor-apt-cancelled { background: #f3f4f6; color: #6b7280; }
.doctor-apt-no_show { background: #fee2e2; color: #dc2626; }
.doctor-apt-actions { 
    display: flex; 
    gap: 8px; 
    flex-wrap: wrap; 
    align-items: center;
    justify-content: flex-start;
}
.doctor-apt-cancel { 
    font-size: 0.85rem; 
    color: #dc2626; 
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #dc2626;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s;
    font-weight: 500;
}
.doctor-apt-cancel:hover { 
    background: #dc2626;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

/* بطاقات الملخص */
.doctor-apt-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.doctor-apt-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}
.doctor-apt-summary-num { display: block; font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.doctor-apt-summary-label { font-size: 0.8rem; color: var(--text-muted); }
.doctor-apt-summary-scheduled .doctor-apt-summary-num { color: #1d4ed8; }
.doctor-apt-summary-confirmed .doctor-apt-summary-num { color: #b45309; }
.doctor-apt-summary-completed .doctor-apt-summary-num { color: #047857; }
.doctor-apt-summary-upcoming .doctor-apt-summary-num { color: #0d9488; }
.doctor-apt-summary-week .doctor-apt-summary-num { color: #6366f1; }

/* تنبيهات */
.doctor-apt-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.doctor-apt-alert-upcoming { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }
.doctor-apt-alert-overdue { background: #fef3c7; border: 1px solid #fde68a; color: #b45309; }
.doctor-apt-alert-overlap { background: #fee2e2; border: 1px solid #fecaca; color: #dc2626; }

/* تقويم مصغر */
.doctor-mini-calendar {
    display: flex;
    gap: 6px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.doctor-mini-cal-day {
    width: 36px;
    height: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.85rem;
}
.doctor-mini-cal-day:hover { background: var(--border); }
.doctor-mini-cal-day.is-today { border-color: var(--primary); background: rgba(13,148,136,0.1); }
.doctor-mini-cal-day.is-selected { background: var(--primary); color: white; border-color: var(--primary); }
.doctor-mini-cal-num { font-weight: 600; }
.doctor-mini-cal-dow { font-size: 0.65rem; color: var(--text-muted); }

/* تصفية وعرض */
.doctor-appointments-list-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.doctor-appointments-list-title { margin: 0; }
.doctor-appointments-list-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.doctor-apt-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.doctor-apt-search {
    display: flex;
}
.doctor-apt-search-input {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.85rem;
    min-width: 180px;
}
.doctor-apt-search-input::placeholder {
    color: var(--text-muted);
}
.doctor-apt-search-input:focus {
    outline: none;
    border-color: var(--primary, #0d9488);
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.15);
}
.doctor-filter-chip {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
}
.doctor-filter-chip:hover { background: var(--border); }
.doctor-filter-chip.active { background: var(--primary); color: white; border-color: var(--primary); }
.doctor-apt-view-toggle { display: flex; gap: 4px; }
.doctor-view-btn {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 1rem;
    text-decoration: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.doctor-view-btn:hover { background: var(--border); color: var(--text-primary); }
.doctor-view-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* بطاقات المواعيد */
.doctor-apt-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 20px;
}
.doctor-apt-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
}
.doctor-apt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}
.doctor-apt-card-time { font-weight: 600; }
.doctor-apt-card-body { padding: 16px; }
.doctor-apt-card-name { font-weight: 600; font-size: 1.05rem; display: block; margin-bottom: 6px; }
.doctor-apt-card-meta { font-size: 0.9rem; color: var(--text-muted); margin: 8px 0 0; }
.doctor-apt-card-actions { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; }
.doctor-apt-reminder-badge { font-size: 0.8rem; margin-right: 6px; }
.doctor-apt-overlap { border-color: #dc2626 !important; box-shadow: 0 0 0 2px rgba(220,38,38,0.2); }

/* مواعيد متأخرة اليوم */
.doctor-apt-late {
    background: #fff7ed;
}
.doctor-appointments-table .doctor-appointment-row.doctor-apt-late .doctor-apt-time {
    color: #b45309;
}
.doctor-appointments-table .doctor-appointment-row.doctor-apt-late .doctor-apt-time::before {
    content: "⏰ ";
}


/* جدول زمني */
.doctor-apt-timeline { position: relative; min-height: 400px; padding: 20px; }
.doctor-timeline-ruler {
    position: relative;
    height: 30px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.doctor-timeline-hour {
    position: absolute;
    font-size: 0.75rem;
    color: var(--text-muted);
    transform: translateX(-50%);
}
.doctor-timeline-slots {
    position: relative;
    height: 540px;
    background: #f8fafc;
    border-radius: 8px;
}
.doctor-timeline-slot {
    position: absolute;
    left: 8px;
    right: 8px;
    min-height: 40px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.1);
}
.doctor-timeline-slot-inner {
    padding: 8px 10px;
    font-size: 0.85rem;
    height: 100%;
    overflow: hidden;
}
.doctor-timeline-time { font-weight: 600; display: block; margin-bottom: 4px; }
.doctor-timeline-slot-actions { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.doctor-timeline-slot-actions a, .doctor-timeline-slot-actions button { font-size: 0.75rem; }

@media (max-width: 768px) {
    .doctor-add-appointment-grid { grid-template-columns: 1fr; }
    .doctor-add-appointment-submit .btn-primary { width: 100%; }
    .doctor-date-nav-form { flex-direction: column; align-items: stretch; }
    .doctor-appointments-list-header { flex-direction: column; align-items: stretch; }
    .doctor-apt-cards-grid { grid-template-columns: 1fr; }
}

@media print {
    .doctor-apt-summary-cards, .doctor-apt-alert, .doctor-add-appointment-card, .doctor-apt-filter, .doctor-apt-view-toggle, .doctor-apt-print, .doctor-mini-calendar, .doctor-apt-edit-btn, .doctor-apt-card-actions .btn, .doctor-apt-actions a[href*="confirm"], .doctor-apt-actions a[href*="complete"], .doctor-apt-actions a[href*="no_show"], .doctor-apt-actions a[href*="copy"], .doctor-apt-cancel { display: none !important; }
    .doctor-appointments-list-header { border: none; }
}

.doctor-reminders-section {
    margin-bottom: 28px;
    scroll-margin-top: 80px;
}
.doctor-rem-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 1.1rem;
    font-weight: 600;
}
.doctor-rem-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.doctor-rem-overdue-title .doctor-rem-dot { background: #ef4444; }
.doctor-rem-today-title .doctor-rem-dot { background: #f59e0b; }
.doctor-rem-week-title .doctor-rem-dot { background: #10b981; }

.doctor-reminders-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.doctor-reminder-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.doctor-reminder-card:hover { box-shadow: var(--shadow-sm); }
.doctor-reminder-overdue { border-right: 4px solid #ef4444; }
.doctor-reminder-today { border-right: 4px solid #f59e0b; }
.doctor-reminder-upcoming { border-right: 4px solid #10b981; }
.doctor-reminder-later { border-right: 4px solid #6b7280; }
.doctor-reminder-done { opacity: 0.85; border-right: 4px solid #9ca3af; }
.doctor-reminder-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}
.doctor-reminder-patient {
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}
.doctor-reminder-patient:hover { text-decoration: underline; }
.doctor-reminder-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}
.doctor-reminder-overdue .doctor-reminder-badge { background: #fef2f2; color: #ef4444; }
.doctor-reminder-today .doctor-reminder-badge { background: #fffbeb; color: #f59e0b; }
.doctor-reminder-upcoming .doctor-reminder-badge { background: #ecfdf5; color: #10b981; }
.doctor-reminder-date { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 6px; }
.doctor-reminder-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 12px;
    line-height: 1.4;
}
.doctor-reminder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.doctor-reminder-actions .btn-sm { padding: 6px 10px; font-size: 0.8rem; }
.doctor-reminder-delete {
    font-size: 0.8rem;
    color: #ef4444;
    margin-right: auto;
}
.doctor-reminder-delete:hover { text-decoration: underline; }
.doctor-reminder-edit-form {
    display: none;
    width: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.doctor-reminder-edit-form.show { display: block; }
.doctor-reminder-edit-form form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.doctor-reminder-edit-form input[type="date"] { padding: 6px 10px; }
.doctor-reminder-edit-form input[type="text"] { min-width: 140px; padding: 6px 10px; }

.doctor-reminders-done { margin-top: 24px; }
.doctor-rem-done-summary {
    cursor: pointer;
    padding: 12px 16px;
    font-weight: 500;
    list-style: none;
}
.doctor-rem-done-summary::-webkit-details-marker { display: none; }
.doctor-reminders-done-list {
    padding: 0 16px 16px;
    margin-top: 8px;
}
.doctor-reminders-done-list .doctor-reminder-card {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
}
.doctor-reminders-empty {
    text-align: center;
    padding: 48px 24px;
}
.doctor-reminders-empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.6; }
.doctor-reminders-empty h3 { margin: 0 0 8px; }
.doctor-reminders-empty p { color: var(--text-muted); margin: 0 0 16px; }

/* رأس البطاقة */
.doctor-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.doctor-shortcut-hint { font-size: 0.8rem; color: var(--text-muted); }

/* ===== صفحة نتائج التحاليل ===== */
.doctor-results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}
.doctor-results-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-muted);
}
.doctor-results-breadcrumb a { color: var(--primary); }
.doctor-results-breadcrumb span:last-child { color: var(--text-primary); font-weight: 500; }
.doctor-results-actions-top { display: flex; gap: 8px; flex-wrap: wrap; }
.doctor-results-order-info { margin-bottom: 20px; }
.doctor-order-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.doctor-order-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.doctor-order-label { font-size: 0.8rem; color: var(--text-muted); }
.doctor-order-value { font-weight: 500; }
.doctor-order-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}
.doctor-order-badge.status-new { background: #dbeafe; color: #1d4ed8; }
.doctor-order-badge.status-progress { background: #fef3c7; color: #b45309; }
.doctor-order-badge.status-completed { background: #d1fae5; color: #047857; }
.doctor-order-badge.status-cancelled { background: #fee2e2; color: #b91c1c; }
.btn-sm { 
    padding: 6px 12px; 
    font-size: 0.85rem; 
    border-radius: 6px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}
.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.doctor-results-actions { margin-bottom: 20px; }
.doctor-actions-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.doctor-results-table-card { margin-bottom: 20px; }
.doctor-results-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.doctor-results-filter-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.doctor-results-table-wrap { overflow-x: auto; }
.doctor-results-table { min-width: 600px; }
.doctor-results-table .result-row-abnormal { background: rgba(239, 68, 68, 0.06); }
.doctor-results-table .result-row-critical { background: rgba(220, 38, 38, 0.12); border-right: 3px solid #dc2626; }
.doctor-results-table .result-test-name { font-weight: 600; }
.doctor-results-table .result-value { font-weight: 600; }
.doctor-results-table .result-flag {
    padding: 4px 10px;
    border-radius: 6px;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
}
.result-prev { font-size: 0.9rem; margin-right: 4px; opacity: 0.85; }
.result-prev.prev-up { color: #ef4444; }
.result-prev.prev-down { color: #3b82f6; }
.result-prev.prev-same { color: var(--text-muted); }

/* بطاقة المريض */
.doctor-patient-card { margin-bottom: 20px; }
.doctor-patient-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.doctor-patient-tab {
    padding: 6px 12px;
    border-radius: 8px 8px 0 0;
    border: 1px solid transparent;
    text-decoration: none;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: transparent;
}
.doctor-patient-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.doctor-patient-tab-active {
    background: var(--bg-card);
    border-color: var(--border);
    border-bottom-color: var(--bg-card);
    color: var(--text-primary);
}
.doctor-patient-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}
.doctor-patient-name { margin: 0 0 8px; font-size: 1.25rem; }
.doctor-patient-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.doctor-health-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
}
.doctor-health-icon { font-size: 1.1rem; }
.doctor-patient-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.doctor-patient-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 16px;
}
.doctor-patient-stat-card {
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}
.doctor-patient-stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.doctor-patient-stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* جدول زمني الطلبات */
.doctor-patient-orders { margin-bottom: 20px; }
.doctor-orders-count { font-size: 0.85rem; font-weight: normal; color: var(--text-muted); }
.doctor-empty-message { color: var(--text-muted); padding: 20px; text-align: center; }
.doctor-orders-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.doctor-order-timeline-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.doctor-order-timeline-item:last-child { border-bottom: none; }
.doctor-order-timeline-dot {
    width: 12px;
    height: 12px;
    min-width: 12px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 6px;
}
.doctor-order-timeline-content { flex: 1; min-width: 0; }
.doctor-order-timeline-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.doctor-order-num { font-weight: 600; }
.doctor-order-date { font-size: 0.9rem; color: var(--text-muted); }
.doctor-order-timeline-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* الملاحظات الطبية */
.doctor-notes-card { margin-bottom: 20px; }
.doctor-note-form { margin-bottom: 16px; }
.doctor-note-form-grid {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 12px;
    align-items: end;
}
@media (max-width: 768px) {
    .doctor-note-form-grid { grid-template-columns: 1fr; }
}
.doctor-note-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.doctor-note-filter-chip {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    font-size: 0.8rem;
    cursor: pointer;
}
.doctor-note-filter-chip.doctor-note-filter-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.doctor-note-item {
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 8px;
}
.doctor-note-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.doctor-note-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.doctor-note-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}
.doctor-note-delete {
    font-size: 0.8rem;
    color: #dc2626;
}
.doctor-note-delete:hover {
    text-decoration: underline;
}
.doctor-note-content {
    margin: 6px 0 0;
}
.doctor-note-edit-form {
    display: none;
    margin-top: 8px;
    border-top: 1px solid var(--border);
    padding-top: 8px;
}
.doctor-note-edit-grid {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    gap: 8px;
    align-items: end;
}
.doctor-note-edit-content textarea {
    width: 100%;
    resize: vertical;
}
.doctor-note-edit-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
@media (max-width: 768px) {
    .doctor-note-edit-grid {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .doctor-note-edit-actions {
        flex-direction: row;
        justify-content: flex-end;
    }
}

/* حساسية الأدوية */
.doctor-allergy-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 8px;
}
.doctor-allergy-badge {
    padding: 4px 10px;
    border-radius: 999px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.8rem;
}
.doctor-allergy-add-btn {
    margin-top: 4px;
}

/* فلاتر النتائج */
.doctor-results-filter-card { margin-bottom: 20px; }
.doctor-results-filter-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.doctor-results-filter-form > * { flex-shrink: 0; }

.doctor-share-box {
    margin-top: 16px;
    padding: 16px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
}
.doctor-share-input-wrap {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.doctor-share-input-wrap input { flex: 1; padding: 10px;font-size: 0.9rem; }
.doctor-critical-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #b91c1c;
}
.doctor-critical-icon { font-size: 1.25rem; }
.doctor-abnormal-summary {
    margin-top: 16px;
    padding: 16px;
    background: #fefce8;
    border: 1px solid #fef08a;
    border-radius: 8px;
    color: #854d0e;
}
.doctor-abnormal-list {
    margin: 10px 0 0;
    padding-right: 24px;
    list-style: none;
}
.doctor-abnormal-list li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(133, 77, 14, 0.2);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.doctor-abnormal-list li:last-child { border-bottom: none; }
.doctor-abnormal-test { font-weight: 500; }
.doctor-abnormal-value { font-weight: 600; }
.doctor-abnormal-flag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: white;
}
.doctor-abnormal-flag.flag-critical { background: #dc2626; }
.doctor-abnormal-flag.flag-warning { background: #f59e0b; }
.doctor-abnormal-date { font-size: 0.85rem; color: var(--text-muted); }

/* ===== صفحة الإحصائيات ===== */
.doctor-statistics-page { padding-bottom: 40px; }
.doctor-stats-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.doctor-stats-subtitle { color: var(--text-muted); margin: 6px 0 0; }
.doctor-stats-filters { display: flex; flex-direction: column; gap: 12px; }
.doctor-stats-quick-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.doctor-stats-date-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.doctor-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.doctor-chart-card { padding: 24px; }
.doctor-chart-full { grid-column: 1 / -1; min-height: 380px; }
.doctor-chart-title {
    margin: 0 0 20px;
    font-size: 1.1rem;
    font-weight: 600;
}
.doctor-chart-container {
    position: relative;
    width: 100%;
}
.doctor-chart-doughnut { height: 280px; }
.doctor-chart-bar { height: 260px; }
.doctor-chart-line { height: 320px; }
.doctor-stats-per-test .doctor-chart-bar { height: 300px; }
.doctor-chart-abnormal { height: 220px; margin-bottom: 16px; }

@media (max-width: 900px) {
    .doctor-charts-row { grid-template-columns: 1fr; }
    .doctor-chart-card { min-height: 280px; }
    .doctor-chart-full { min-height: 320px; }
    .doctor-chart-doughnut { height: 240px; }
    .doctor-chart-bar { height: 220px; }
    .doctor-chart-line { height: 260px; }
}

/* نافذة الاختصارات */
.doctor-shortcuts-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.doctor-shortcuts-overlay.doctor-shortcuts-show {
    opacity: 1;
    visibility: visible;
}
.doctor-shortcuts-modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}
.doctor-shortcuts-modal h3 { margin: 0 0 16px; }
.doctor-shortcuts-table { width: 100%; margin-bottom: 16px; }
.doctor-shortcuts-table td { padding: 8px 0; }
.doctor-shortcuts-table td:first-child { width: 140px; }
.doctor-shortcuts-table kbd {
    padding: 2px 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 0.85rem;
}

/* تحسينات صفحة البحث */
.doctor-search-empty {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 2px dashed var(--border);
}

/* تحسينات صفحة المرضى - عمود الإجراءات */
.table td:last-child {
    min-width: 200px;
}
.table td:last-child > div {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start;
}

/* تحسينات صفحة الملف الشخصي */
.doctor-profile-page .page-header {
    margin-bottom: 24px;
}
.doctor-profile-stat-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.doctor-profile-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(13, 148, 136, 0.3));
    opacity: 0;
    transition: opacity 0.3s;
}
.doctor-profile-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.doctor-profile-stat-card:hover::before {
    opacity: 1;
}

/* Modals للحسابات المالية */
.doctor-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}
.doctor-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}
.doctor-modal {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.doctor-modal-overlay.show .doctor-modal {
    transform: scale(1);
}
.doctor-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}
.doctor-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}
.doctor-modal-body {
    padding: 20px;
}
.doctor-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid var(--border);
}

/* تحسينات جدول المرضى */
.doctor-patients-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.doctor-patients-table thead th {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    color: white;
    font-weight: 600;
    padding: 14px 12px;
    text-align: right;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}
.doctor-patients-table thead th:first-child {
    border-top-right-radius: 8px;
}
.doctor-patients-table thead th:last-child {
    border-top-left-radius: 8px;
}
.doctor-patients-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: all 0.2s ease;
}
.doctor-patients-table tbody tr:hover {
    background: var(--bg-hover);
    transform: translateX(-2px);
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
}
.doctor-patients-table tbody tr:last-child {
    border-bottom: none;
}
.doctor-patients-table tbody td {
    padding: 14px 12px;
    vertical-align: middle;
}
.doctor-patient-row:hover {
    background: linear-gradient(90deg, rgba(13, 148, 136, 0.05) 0%, transparent 100%);
}

.doctor-patients-actions-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

.doctor-patient-action-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.doctor-patient-action-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.doctor-patient-action-badge.critical {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
}
.doctor-patient-action-badge.notes {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.3);
}

.doctor-patient-profile-btn {
    padding: 7px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    border-radius: 8px;
}
.doctor-patient-profile-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.doctor-account-btn {
    background: linear-gradient(135deg, #0d9488, #14b8a6) !important;
    color: white !important;
    border: none !important;
    padding: 7px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 8px;
}
.doctor-account-btn:hover {
    background: linear-gradient(135deg, #14b8a6, #0d9488) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.doctor-copy-btn {
    padding: 7px 10px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-radius: 8px;
}
.doctor-copy-btn:hover {
    background: var(--primary) !important;
    color: white !important;
    transform: translateY(-2px);
}

.doctor-patient-reminder-btn {
    font-size: 1.1rem;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.2s ease;
    background: rgba(13, 148, 136, 0.1);
    border: 1px solid rgba(13, 148, 136, 0.2);
}
.doctor-patient-reminder-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

/* تحسين الجداول في البحث */
.doctor-search-results-table {
    border-collapse: separate;
    border-spacing: 0;
}
.doctor-search-results-table tbody tr {
    transition: all 0.2s;
}
.doctor-search-results-table tbody tr:hover {
    background: rgba(13, 148, 136, 0.05);
    transform: translateX(-2px);
}

@media (max-width: 768px) {
    .doctor-order-meta { grid-template-columns: 1fr; }
    .doctor-patient-header { flex-direction: column; }
    .doctor-results-filter-form { flex-direction: column; align-items: stretch; }
    .doctor-reminders-header { flex-direction: column; }
    .doctor-reminders-cards { grid-template-columns: 1fr; }
    .doctor-add-reminder-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .doctor-add-reminder-submit { justify-content: stretch; }
    .doctor-add-reminder-submit .btn-primary { width: 100%; }
    .doctor-reminder-actions { flex-wrap: wrap; }
    .doctor-search-filters {
        grid-template-columns: 1fr !important;
    }
    .doctor-search-row {
        flex-direction: column;
    }
    .doctor-search-row button {
        width: 100%;
    }
}

/* طباعة - إخفاء العناصر غير الضرورية */
@media print {
    .no-print, .sidebar, .top-bar, .doctor-header, header { display: none !important; }
    .content { padding: 0 !important; }
    a[href^="tel:"] { text-decoration: none; color: inherit; }
}

/* لوحة معلومات سريعة */
.doctor-quick-info-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.doctor-quick-info-modal {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.doctor-quick-info-loading {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

/* تحسينات التنبيهات */
.doctor-alert-item {
    transition: all 0.2s;
}
.doctor-alert-item:hover {
    background: rgba(13, 148, 136, 0.08) !important;
}

/* تحسينات المهام */
.doctor-task-item {
    transition: all 0.2s;
}
.doctor-task-item:hover {
    background: rgba(13, 148, 136, 0.05) !important;
}

/* ===== تحسينات إضافية للواجهة ===== */
.doctor-quick-actions .btn-primary,
.doctor-quick-actions .btn-secondary {
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
.doctor-quick-actions .btn-primary:hover,
.doctor-quick-actions .btn-secondary:hover {
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
    transform: translateY(-2px);
}

/* بطاقات محسّنة */
.card {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s ease;
}
.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* تحسين الأزرار */
.btn-primary, .btn-secondary {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 10px 18px;
}
.btn-primary {
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    border: none;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #0f766e, #0d9488);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

/* تحسين الجداول */
.table {
    border-radius: 8px;
    overflow: hidden;
}
.table thead {
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    color: white;
}
.table tbody tr {
    transition: background 0.2s;
}
.table tbody tr:hover {
    background: rgba(13, 148, 136, 0.05);
}

/* تحسين الرسوم البيانية */
.doctor-chart-card {
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* تحسين التنبيهات */
.doctor-alert {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تحسين بطاقات المهام */
.doctor-task-item {
    border-radius: 10px;
    transition: all 0.3s ease;
}
.doctor-task-item:hover {
    transform: translateX(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* تحسين مؤشر النشاط */
.doctor-activity-bar {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.doctor-activity-fill {
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.4);
    animation: progressFill 1s ease;
}
@keyframes progressFill {
    from { width: 0; }
}

/* تحسين التذكيرات */
.doctor-reminder-card {
    border-radius: 12px;
    transition: all 0.3s ease;
}
.doctor-reminder-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* تحسين البحث */
.header-search input {
    transition: all 0.3s ease;
}
.header-search input:focus {
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
    border-color: var(--primary);
}

/* تحسين الشريط الجانبي */
.sidebar {
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}
.sidebar li a.active {
    background: linear-gradient(90deg, rgba(13, 148, 136, 0.2), rgba(20, 184, 166, 0.15));
    border-right: 3px solid var(--primary);
    font-weight: 600;
}

/* تحسين الوضع الداكن */
body.dark-mode .doctor-stat-card {
    background: #1e293b;
    border-color: rgba(255,255,255,0.1);
}
body.dark-mode .card {
    background: #1e293b;
    border-color: rgba(255,255,255,0.1);
}
body.dark-mode .doctor-alert-critical {
    background: linear-gradient(135deg, rgba(127,29,29,0.4), rgba(185,28,28,0.3));
    border-color: rgba(239,68,68,0.5);
}
