/* عيادتي — تنسيق بسيط فوق Bootstrap 5 */
:root {
  --color-primary: #0d6efd;
  --color-primary-dark: #0b5ed7;
  --color-primary-soft: #e7f1ff;
  --color-bg: #f5f5f5;
  --color-surface: #fff;
  --color-text: #222;
  --color-muted: #666;
  --color-border: #ddd;
  --color-success: #198754;
  --color-success-soft: #e8f6ee;
  --color-danger: #dc3545;
  --color-danger-soft: #f8e8ea;
  --color-warning: #fd7e14;
  --color-warning-soft: #fff3e8;
  --sidebar-w: 230px;
  --topbar-h: 56px;
  --bs-primary: #0d6efd;
  --bs-primary-rgb: 13, 110, 253;
  --bs-body-font-family: Arial, Tahoma, sans-serif;
}

* { font-family: Arial, Tahoma, sans-serif !important; }
html, body { background: var(--color-bg); color: var(--color-text); }
body { min-height: 100vh; }
a { text-decoration: none; }

.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-left: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
}
@media (min-width: 992px) {
  .sidebar.offcanvas-lg {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    transform: none !important;
    visibility: visible !important;
    background: #fff !important;
  }
  .app-main { margin-right: var(--sidebar-w); }
}
.sidebar .brand {
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar .brand strong { font-size: 18px; }

.role-panel { padding: 12px 16px; border-bottom: 1px solid var(--color-border); }
.role-panel small { display: block; color: var(--color-muted); margin-bottom: 6px; }
.role-switch { display: flex; gap: 6px; }
.role-btn {
  flex: 1;
  border: 1px solid var(--color-border);
  background: #fff;
  padding: 4px 8px;
  font-size: 13px;
}
.role-btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.nav-list { list-style: none; margin: 0; padding: 8px 0; }
.nav-list a {
  display: block;
  padding: 10px 16px;
  color: #333;
}
.nav-list a:hover { background: #f0f0f0; }
.nav-list a.active { background: #e7f1ff; color: #0b5ed7; font-weight: bold; }
.nav-list li.d-none { display: none !important; }
.sidebar-footer { margin-top: auto; padding: 12px 16px; border-top: 1px solid var(--color-border); }
.sidebar-footer a { color: #dc3545; }

.app-main { min-height: 100vh; opacity: 1 !important; }
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.topbar .hamburger { border: 1px solid var(--color-border); background: #fff; width: 36px; height: 36px; }
.topbar .breadcrumb { margin: 0; background: none; padding: 0; }
.topbar .search-box { position: relative; margin-inline-start: auto; width: 240px; }
.topbar .search-box i { display: none; }

.page-content { padding: 20px; }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.page-header h3 { margin: 0; font-size: 22px; }
.page-header p { margin: 4px 0 0; color: var(--color-muted); font-size: 14px; }

.card, .modal-content, .accordion {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-shadow: none;
  background: #fff;
}
.card-header { background: #fafafa; font-weight: bold; }
.metric-card { padding: 16px; }
.metric-card .value { font-size: 26px; font-weight: bold; }
.metric-card .title { color: var(--color-muted); font-size: 13px; }

.btn-soft { background: #fff; border: 1px solid var(--color-border); color: #333; }
.btn-icon {
  width: 32px; height: 32px; padding: 0; border: 1px solid var(--color-border);
  background: #fff; color: #555;
}
.btn-icon.edit:hover { color: #0d6efd; }
.btn-icon.delete:hover { color: #dc3545; }

.file-no { background: #e7f1ff; color: #0b5ed7; padding: 2px 8px; font-size: 13px; }
.avatar-sm {
  width: 32px; height: 32px; background: #eee; display: inline-grid; place-items: center; font-weight: bold;
}

.chip {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border: 1px solid var(--color-border);
  background: #f8f8f8;
}
.chip::before { content: none; }
.chip-completed { color: #198754; background: #e8f6ee; }
.chip-cancelled { color: #dc3545; background: #f8e8ea; }
.chip-pending { color: #fd7e14; background: #fff3e8; }
.chip-confirmed { color: #0d6efd; background: #e7f1ff; }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 6px; }
.status-picker .dropdown-toggle { width: 100%; text-align: right; background: #fff; border: 1px solid var(--color-border); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px solid #eee; }
.timeline .dot { display: none; }
.timeline .time { font-size: 12px; color: var(--color-muted); }
.timeline .text { font-size: 14px; }

.doctor-card { text-align: center; padding: 16px; position: relative; }
.doctor-card .avatar-lg {
  width: 64px; height: 64px; margin: 8px auto 10px; background: #e7f1ff; color: #0d6efd;
  display: grid; place-items: center; font-size: 28px;
}
.doctor-card .specialty { display: block; color: var(--color-muted); font-size: 13px; margin-top: 4px; }
.doctor-card .room { position: absolute; top: 8px; left: 8px; background: #333; color: #fff; font-size: 12px; padding: 2px 6px; }
.doctor-card .status { position: absolute; top: 8px; right: 8px; }
.doctor-card .actions { margin-top: 12px; padding-top: 10px; border-top: 1px solid #eee; }
.doctor-card .actions a { font-size: 13px; color: #555; margin: 0 6px; }

.patient-banner {
  background: #fff;
  border: 1px solid var(--color-border);
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}
.patient-banner .avatar { width: 48px; height: 48px; background: #eee; display: grid; place-items: center; }
.patient-banner h4 { color: inherit; }
.patient-banner .info-pill { border: 1px solid var(--color-border); padding: 6px 12px; }
.patient-banner .info-pill small { display: block; color: var(--color-muted); font-size: 12px; }
.patient-banner .allergy { border-color: #dc3545; }

.history-date-block { cursor: pointer; }
.rx-line { padding: 6px 0; border-bottom: 1px dashed #ddd; }

.search-hero { text-align: center; padding: 20px 0; }
.search-hero .giant { position: relative; max-width: 640px; margin: 12px auto 0; }
.search-hero .giant i { display: none; }
.badge-soft { background: #f0f0f0; padding: 3px 8px; font-size: 13px; }
.empty-state { text-align: center; padding: 40px; color: var(--color-muted); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; padding: 24px; }
.input-icon { position: relative; }

.form-select { background-position: left .75rem center; padding-left: 2.25rem; padding-right: 12px; }

@media print {
  .no-print, .sidebar, .topbar, .btn, .hamburger { display: none !important; }
  .app-main { margin: 0 !important; }
  .page-content { padding: 0 !important; }
  body, html { background: #fff !important; }
}
.print-only { display: none; }
@media print { .print-only { display: block !important; } }
