/* PICADS CSS - Removed problematic tailwindcss import */
/* --- General & Root Start --- */
/* المتغيرات الأساسية */
:root {
  --font-main: 'Tajawal', sans-serif;
  --bg-body: #f4f7f6;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --color-text-main: #2c3e50;
  --color-text-muted: #7f8c8d;
  --color-border: #e2e8f0;
  --color-green: #10b981;
  --color-red: #ef4444;
  --color-blue: #3b82f6;
  --color-primary: #343468;
  --color-primary-rgb: 52, 52, 104;
  --bg-procedure: #f8fafc;
  --bg-clinic-anas: #ffffff;
  --bg-nutrition: #fff7ed;
  --bg-done: #ecfdf5;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
  --border-radius: 12px;
  /* باليت التصنيفات الموحدة: عيادة د.أنس أزرق، تغذية أخضر، إجراء بنفسجي */
  --color-type-dr-anas: #3b82f6;
  --color-type-nutrition: #10b981;
  --color-type-procedure: #343468;
}
svg.lucide {
  width: 1.3em;
  height: 1.3em;
  vertical-align: middle;
  stroke-width: 2.3px;
}
/* زر موحد (مستخدم في الإعدادات والنوافذ) */
.btn-export {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(var(--color-primary-rgb), 0.16);
  background: rgba(var(--color-primary-rgb), 0.08);
  color: var(--color-primary);
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  transition: 0.2s;
}
.btn-export:hover {
  background: rgba(var(--color-primary-rgb), 0.14);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(52, 52, 104, 0.12);
}
.btn-export:active {
  transform: translateY(0);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-main);
  -webkit-tap-highlight-color: transparent !important;
}
body {
  color: var(--color-text-main);
  min-height: 100vh;
  transition: 0.3s;
  font-size: 16px;
  background: #fff;
}
h1.page-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom:5px;
   margin-top:4px;
  display: flex;
  align-items: center; 
  gap: 10px;
  border-right: 3px solid var(--color-type-dr-anas);
  padding-right:5px;
}
.app-layout {
  display: flex;
  flex-direction: row;
  height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}
.main-content {
  flex: 1;
  display: flex;
  justify-content: center;
    padding-top:  5px;
}
.screen-container {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 0 auto;
 
  background: var(--bg-card);
  border-radius: 0;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
@media (max-width: 768px) {
body {
    font-size: 14px;
  }
svg.lucide {
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
    stroke-width: 2.2px;
  }
.app-layout {
    flex-direction: column;
    max-width: 100%;
    height: auto;
    min-height: 100vh;
  }
.screen-container {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  .main-content {
    padding-top:  0;
  }
  h1.page-title {
  font-size: 1.1rem;
  margin-bottom: 7px;
  gap: 7px;
  }

}
@media (max-width: 480px) {
body {
    overflow-x: hidden;
  }
.screen,
  .screen-container {
    overflow-x: hidden;
  }
/* تصغير نصوص خانات المريض في شاشة 480 */
  #bookingName,
  #bookingFile,
  #bookingPhone {
    font-size: 0.78rem !important;
  }
/* تصغير الأيقونات في المودال في شاشة 480 */
  .modal-content .input-with-icon i,
  .modal-content .input-with-icon .lucide,
  .modal-content .input-with-icon svg {
    width: 16px !important;
    height: 16px !important;
    right: 12px !important;
  }
.modal-content .styled-input {
    padding-right: 36px !important;
  }
  h1.page-title {
  font-size: 1rem;
  margin-bottom: 4px;
  gap: 6px;
  padding-right:3px;
  }
}
@media (max-width: 380px) {
body {
    overflow-x: hidden;
  }
.screen,
  .screen-container {
    overflow-x: hidden;
  }
body {
    font-size: 12.5px;
  }
svg.lucide {
    width: 1em;
    height: 1em;
    vertical-align: middle;
    stroke-width: 2px;
  }
/* تصغير إضافي للنصوص والأيقونات في شاشة 380 */
  #bookingName,
  #bookingFile,
  #bookingPhone {
    font-size: 0.72rem !important;
  }
.modal-content .input-with-icon i,
  .modal-content .input-with-icon .lucide,
  .modal-content .input-with-icon svg {
    width: 14px !important;
    height: 14px !important;
    right: 10px !important;
  }
.modal-content .styled-input {
    padding-right: 32px !important;
  }
}
/* --- General & Root End --- */
/* --- Navigation & Header Start --- */
/* الهيدر الثابت (تم عكس الاتجاه) */
.fixed-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-procedure);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 17px 29px;
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
@media (min-width: 769px) {
.fixed-header {
    position: fixed;
    top: 0;
    right: max(0px, calc((100vw - 1200px) / 2));
    width: 1200px;
    margin: 0;
    border-right: 5px solid var(--color-primary);
  }
.fixed-header .logo-img {
    height: 82px;
    width: 82px;
  }
.fixed-header .logo-text {
    font-size: 1.38rem;
  }
.fixed-header .header-stats-mini {
    font-size: 12.5px;
	
  }
.screen-container {
    padding-top: 92px;
  }
}
.fixed-header {
    display: flex;
    flex-wrap: wrap; /* يسمح بالعناصر بالنزول لسطر جديد */
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    gap: 10px;
}
.header-side {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-branding {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.logo-img {
  height: 70px;
  width: 70px;
  border-radius: 12px;
  object-fit: contain;
  background: white;
  border: 1px solid var(--color-border);
  padding: 2px;
}
.logo-text-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.logo-text {
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.2;
}

.clinic-name {
  font-weight: 500;
  font-size: 1rem;
 color: var(--color-text-muted);
 margin: 5px;
}


 
.header-stats-mini {
    width: 100%; 
   
	  display: none;
	flex-wrap: wrap; /* يسمح بالعناصر بالنزول لسطر جديد */
    justify-content: space-between;
    gap: 5px;
    padding-top: 4px;
    margin-top: 3px;
    border-top: 1px solid var(--color-border); /* اختيار اختياري لفصل الصفين */
    justify-content: flex-start; /* يمكنك تغييرها لـ center إذا أردتها في المنتصف */
}

/* تعديل بسيط لضمان تناسق الشعار */

.hsm-sep {
  color: var(--color-border);
}
.year-text {
  font-size: 14px;
  color: var(--color-text-muted);
  font-weight: 700;
  background: var(--bg-procedure);
  padding: 2px 6px;
  border-radius: 6px;
}
.user-badge {
  display: flex;
  align-items: center;
  gap: 0;
  font-weight: 700;
  font-size: 0.9rem;
  background: linear-gradient(145deg, #ffffff, #f0f4ff);
  border: 1px solid rgba(var(--color-primary-rgb), 0.22);
  color: #3b82f6;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.user-badge-info {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.user-badge-info:hover {
  background: rgba(var(--color-primary-rgb), 0.05);
}

.refresh-profile-btn {
  background: rgba(var(--color-primary-rgb), 0.08);
  border: none;
  border-right: 1px solid rgba(var(--color-primary-rgb), 0.15);
  color: var(--color-primary);
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.refresh-profile-btn:hover {
  background: var(--color-primary);
  color: white;
}

.refresh-profile-btn i {
  width: 16px;
  height: 16px;
}
.icon-btn {
  background: transparent;
  border: none;
  font-size: 1.15rem;
  color: var(--color-text-main);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: 0.2s;
}
.icon-btn:hover {
  background: var(--color-border);
}
.screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 31px;
  overflow-y: auto;
  background: var(--bg-card);
}
@media (max-width: 768px) {
.fixed-header {
    padding: 10px 20px;
    position: relative;
    /* إلغاء خاصية sticky أو fixed */
  }
.logo-text {
    font-size: 1.15rem;
  }
.user-badge {
    font-size: 0.8rem;
    padding: 0;
  }
.user-badge-info {
    padding: 4px 8px;
}
.refresh-profile-btn {
    padding: 4px 6px;
}
.icon-btn {
    font-size: 1.1rem;
    padding: 6px;
  }
.screen {
    padding: 20px;
    height: auto;
    overflow-y: visible;
  }
}
@media (max-width: 480px) {
.fixed-header {
     padding: 10px 12px 5px 12px;
  }
.logo-img {
    height: 59px;
    width: 59px;
  }
.logo-text {
    font-size: 1.05rem;
  }
.header-stats-mini {
    font-size: 10px;
	 display: flex;
  }
.screen {
    padding: 16px;
  }
  .clinic-name {
  font-weight: 500;
  font-size: 0.85rem;
  margin:2px;
 
}
  .user-badge {
    font-size: 0.7rem;
    padding: 0;
  }
  .user-badge-info {
    padding: 4px 6px;
  }
  .refresh-profile-btn {
    padding: 4px 5px;
  }
.icon-btn {
    font-size: 0.85rem;
    padding: 5px;
  }
  .user-badge-icon {
  font-size: 0.75rem !important;
}
}
@media (max-width: 380px) {
.fixed-header {
    padding: 10px 12px 5px 12px;
  }
.logo-img {
    height: 52px;
    width: 52px;
  }
.logo-text {
    font-size: 1rem;
  }
.screen {
    padding: 14px;
  }
}
/* الهيدر العلوي الفرعي (Navigation) */
/* الهيدر العلوي الفرعي (Navigation) - تأثير الأيقونة المتمددة */
.sub-nav-header {
  position: sticky;
  top: 91px;
  z-index: 99;
  background: var(--bg-header);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 13px 23px;
  border-bottom: 1px solid var(--color-border);
  gap: 12px;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transition: all 0.3s ease;
}
.sub-nav-item {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--color-text-main);
  font-weight: 500;
  font-size: 0.75rem;
  padding: 10px;
  border-radius: 50px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  max-width: 40px;
  /* حجم الأيقونة فقط */
  white-space: nowrap;
  background: rgba(var(--color-primary-rgb), 0.05);
  border: 1px solid transparent;
  opacity:0.9;
}
.sub-nav-item i {
  font-size: 1rem;
  min-width: 22px;
  display: flex;
  justify-content: center;
}
.sub-nav-item span {
  opacity: 0;
  max-width: 0;
  transition: all 0.3s ease-in-out;
  display: inline-block;
}
@media (min-width: 769px) {
.sub-nav-item span {
    font-weight: 800;
  }
}
.sub-nav-item:hover {
  background:rgba(71, 25, 216, 0.09);
  color: var(--color-primary);
  border-color: rgba(var(--color-primary-rgb), 0.18);
  opacity:1;
}
.sub-nav-item.active {
  color: white;
  background: var(--color-text-main)  ;
  font-weight: 600;
  max-width: 220px;
  /* تمدد لإظهار النص */
  padding: 10px 22px;
 opacity:1;
  border-color: rgba(255, 255, 255, 0.1);
}
.sub-nav-item.active i {
  margin-left: 8px;
  /* مسافة بين الأيقونة والنص في العربي */
}
.sub-nav-item.active span {
  opacity: 1;
  max-width: 160px;
}
@media (min-width: 769px) {
.mobile-only-flex {
    display: none !important;
  }
.sub-nav-header {
    position: fixed;
    top: 92px;
    right: max(0px, calc((100vw - 1200px) / 2));
    bottom: 0;
    width: 290px;
    height: calc(100vh - 92px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 38px 16px 16px;
    gap: 10px;
    border-bottom: none;
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    border-right: 5px solid var(--color-primary);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: none;
  }
.main-content {
    margin-right: 0;
    justify-content: flex-end;
  }
.screen-container {
    max-width: calc(1200px - 290px);
    margin: 0;
  }
.sub-nav-item {
    width: 100%;
    max-width: none;
    justify-content: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
  }
.sub-nav-item span {
    opacity: 1;
    max-width: none;
    font-size: 0.95rem;
  }
.sub-nav-item.active {
    max-width: none;
    padding: 12px 14px;
    box-shadow: 0 10px 24px rgba(52, 52, 104, 0.18);
  }
}
@media (min-width: 769px) and (max-width: 1200px) {
.fixed-header {
    right: 0;
    left: 0;
    width: 100%;
  }
.sub-nav-header {
    right: 0;
  }
.screen-container {
    max-width: calc(100vw - 290px);
  }
}
@media (max-width: 768px) {
.sub-nav-header {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    padding: 10px 12px;
    gap: 6px;
    border-bottom: none;
    border-top: 1.5px solid rgba(0, 0, 0, 0.16);
    /* حد أكثر وضوحاً */
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.05);
  }
.main-content {
    margin-right: 0;
  }
.sub-nav-item {
    max-width: none;
    flex-direction: column;
    justify-content: center;
    padding: 8px 6px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent;
  }
.sub-nav-item.sidebar-only {
    display: none;
  }
.nav-icon {
    font-size: 22px;
    /* الحجم الأساسي للهواتف (768px) */
    min-width: 0;
  }
.sub-nav-item span {
    opacity: 1;
    max-width: none;
    font-size: 11px;
    font-weight: 600;
  }
.sub-nav-item.active span {

    font-weight: 800;
  }
.sub-nav-item.active {
    padding: 6px 8px;
    box-shadow: none;
    max-width: none;
	 font-weight: 800;
    background: rgba(var(--color-primary-rgb), 0.12);
    color: var(--color-primary);
    border-color: rgba(var(--color-primary-rgb), 0.22);
  }
.screen {
    padding-bottom: 92px;
  }
.fab-button {
    display: none !important;
  }
.fab-nav-item {
    background: var(--color-primary) !important;
    color: white !important;
    border-radius: 50% !important;
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    box-shadow: none !important;
    flex-shrink: 0 !important;
  }
.fab-nav-item .nav-icon {
    font-size: 1.6rem !important;
    /* تكبير أيقونة الـ + */
    stroke-width: 3.5px !important;
    /* وزن خط 800 تقريباً */
    margin: 0 !important;
  }
}
/* زر الحجز العائم (FAB) */
.fab-button {
  position: fixed;
  bottom: 23px;
  left: 23px;
  width: 53px;
  height: 53px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(52, 52, 104, 0.4);
  cursor: pointer;
  z-index: 1000;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.fab-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(52, 52, 104, 0.5);
}
.fab-button i {
  font-size: 1.4rem;
}
@media (max-width: 480px) {
.nav-icon {
    font-size: 16px;
    /* تصغير طفيف للـ 480px */
  }
.sub-nav-header {
    gap: 3px;
    padding: 8px 6px;
  }
.sub-nav-item {
    padding: 6px 6px;
	gap:3px;
  }
.fab-nav-item {
    width: 42px !important;
    height: 42px !important;
  }
.fab-nav-item .nav-icon {
    font-size: 1.5rem !important;
  }
}
@media (max-width: 380px) {
.sub-nav-header {
    gap: 2px;
    padding: 6px 3px;
  }
.sub-nav-item {
    padding: 6px 2px;
  }
.nav-icon {
    font-size: 18px;
    /* تصغير أكثر للشاشات الصغيرة جداً 380px */
  }
.sub-nav-item span {
    font-size: 10px;
    font-weight: 700;
  }
.fab-nav-item {
    width: 36px !important;
    height: 36px !important;
  }
.fab-nav-item .nav-icon {
    font-size: 1.3rem !important;
  }
}
/* Month Picker Overlay */
.month-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.month-picker-popup {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  width: min(320px, 90vw);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.month-picker-header {
  text-align: center;
  margin-bottom: 16px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-primary);
}
.month-picker-year-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
}
.month-picker-nav {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-procedure);
  color: var(--color-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.month-picker-nav:hover {
  background: var(--color-primary);
  color: white;
}
.month-picker-year-label {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-text-main);
  min-width: 60px;
  text-align: center;
}
.month-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.month-picker-item {
  padding: 12px 8px;
  border: none;
  background: var(--bg-procedure);
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--color-text-main);
}
.month-picker-item:hover {
  background: rgba(var(--color-primary-rgb), 0.1);
}
.month-picker-item.active {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 4px 10px rgba(52, 52, 104, 0.3);
}
.month-picker-close {
  width: 100%;
  padding: 12px;
  border: none;
  background: var(--bg-procedure);
  border-radius: 10px;
  font-family: var(--font-main);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--color-text-main);
  transition: all 0.2s ease;
}
.month-picker-close:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-red);
}
@media (max-width: 480px) {
.month-picker-grid {
    gap: 5px;
  }
.month-picker-item {
    padding: 8px 4px;
    font-size: 0.7rem;
  }
.month-picker-popup {
    width: 92vw;
    padding: 16px;
  }
.month-picker-year-row {
    gap: 16px;
  }
.month-picker-nav {
    width: 32px;
    height: 32px;
  }
.month-picker-year-label {
    font-size: 1rem;
  }
.month-picker-close {
    padding: 10px;
    font-size: 0.85rem;
  }
}
@media (max-width: 380px) {
.month-picker-popup {
    width: 94vw;
    padding: 12px;
    border-radius: 12px;
  }
.month-picker-header {
    font-size: 0.95rem;
    margin-bottom: 12px;
  }
.month-picker-grid {
    gap: 4px;
  }
.month-picker-item {
    padding: 6px 2px;
    font-size: 0.65rem;
    border-radius: 6px;
  }
.month-picker-year-row {
    gap: 12px;
    margin-bottom: 12px;
  }
.month-picker-nav {
    width: 28px;
    height: 28px;
  }
.month-picker-nav i {
    font-size: 0.85rem;
  }
.month-picker-year-label {
    font-size: 0.9rem;
  }
.month-picker-close {
    padding: 8px;
    font-size: 0.8rem;
  }
}
/* --- Navigation & Header End --- */
/* التقويم */
.stats-today-bar {
  background: var(--bg-card);
  border-radius: 40px;
  padding: 10px 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: var(--shadow-md);
  font-weight: 500;
}
.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-icon {
  font-size: 1.1rem;
  width: 24px;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.stat-value {
  font-weight: 800;
}
/* --- صفحة التقويم --- */
.today-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-primary);
  color: white;
  padding: 13px;
  border-radius: 10px;
  margin-bottom: 13px;
  font-size: 0.85rem;
  font-weight: 700;
}
/* Flash animation for today's card */
@keyframes flashToday {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    border-color: var(--color-green);
  }
  50% { 
    box-shadow: 0 0 20px 5px rgba(16, 185, 129, 0.5);
    border-color: var(--color-green);
    transform: scale(1.02);
  }
}
.day-card.is-today-flash {
  animation: flashToday 1s ease-in-out 3;
  border: 2px solid var(--color-green);
  z-index: 10;
}
/* Responsive adjustments for calendar toolbar */
@keyframes slideInLeft {
  0% {
    transform: translateX(60px) scale(0.95);
    opacity: 0;
    filter: blur(2px);
  }
  50% {
    filter: blur(1px);
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
    filter: blur(0);
  }
}
@keyframes slideInRight {
  0% {
    transform: translateX(-60px) scale(0.95);
    opacity: 0;
    filter: blur(2px);
  }
  50% {
    filter: blur(1px);
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
    filter: blur(0);
  }
}
@keyframes slideOutLeft {
  0% {
    transform: translateX(0) scale(1);
    opacity: 1;
    filter: blur(0);
  }
  100% {
    transform: translateX(-60px) scale(0.95);
    opacity: 0;
    filter: blur(2px);
  }
}
@keyframes slideOutRight {
  0% {
    transform: translateX(0) scale(1);
    opacity: 1;
    filter: blur(0);
  }
  100% {
    transform: translateX(60px) scale(0.95);
    opacity: 0;
    filter: blur(2px);
  }
}
.weekday-cell {
  text-align: center;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  padding: 8px 0;
  border-radius: 10px;
  background: var(--bg-procedure);
  border: 1px solid var(--color-border);
}
@media (max-width: 768px) {
.weekday-cell {
    font-size: 0.72rem;
    padding: 6px 0;
  }
}
@media (max-width: 480px) {
.weekday-cell {
    font-size: 0.62rem;
    padding: 5px 0;
  }
}
@media (max-width: 380px) {
.weekday-cell {
    font-size: 0.58rem;
    padding: 4px 0;
  }
}
.day-card {
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0;
  /* Remove padding to let background fill header */
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: 0.2s;
  overflow: hidden;
  /* Ensure background doesn't leak */
}
.day-card.is-disabled {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.35);
  cursor: default;
  pointer-events: none;
  filter: grayscale(1);
  opacity: 0.75;
}
.day-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}
.day-card.is-pre-offday {
  box-shadow: none;
}
.day-card.is-month-start {
  border: 1px solid var(--color-red);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.14), 0 0 14px rgba(239, 68, 68, 0.18);
}
.day-card.is-vacation {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.3);
  cursor: default;
  position: relative;
}
.day-card.is-vacation::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0,0,0,0.02) 10px, rgba(0,0,0,0.02) 20px);
  pointer-events: none;
}
.day-card.is-vacation .dc-date {
  color: var(--color-text-muted);
  opacity: 0.6;
}
.day-card.is-vacation .dc-data-container {
  display: none;
}
/* Booking type segmented: force active text white (even if inline type color exists) */
#bookingTypeGroup .seg-btn {
  color: var(--color-text-muted) !important;
}
#bookingTypeGroup .seg-btn.active {
  color: #fff !important;
}
/* Ensure icon vertical centering (especially stopwatch/clock) */
.input-with-icon i,
.input-with-icon svg {
  top: 50%;
  transform: translateY(-50%);
  line-height: 1;
}
/* Native date input for booking picker (visual only; some browsers ignore) */
#bookingDateNative {
  border: 1px solid rgba(var(--color-primary-rgb), 0.9);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
/* Additional notes: taller */
#bookingPublicNote {
  min-height: 92px;
}
.calendar-empty {
  background: transparent;
  border: 1px dashed rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  min-height: 96px;
}
.calendar-empty.is-offday {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.06);
}
.dc-row1 {
  background: var(--bg-procedure);
  /* نفس درجة اللون الباهت في الهيدر */
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: clamp(4px, 1.2vw, 8px) 0;
  margin-bottom: 8px;
}
.dc-date {
  font-weight: 800;
  font-size: clamp(1.02rem, 3.5vw, 1.22rem);
  line-height: 1.1;
  color: #8b1a1a;
  margin-top: 5px;
}
.dc-month {
  font-size: clamp(0.58rem, 2.2vw, 0.72rem);
  color: var(--color-text-muted);
  font-weight: 400;
  margin-top: 0;
}
.dc-weekday {
  font-size: clamp(0.56rem, 2.4vw, 0.79rem);
  font-weight: 500;
  color: var(--color-text-main);
  margin-top: 2px;
}
.dc-data-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 4px;
}
.dc-data-row {
  display: flex;
  width: 100%;
  justify-content: space-evenly;
  padding-bottom: 4px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}
.dc-data-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.dc-data-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5px;
  flex: 1;
}
.dc-data-item i,
.dc-data-item svg {
  font-size: 0.82rem;
  width: 1em;
  height: 1em;
  line-height: 1;
  opacity: 0.6;
}
.dc-data-item span {
  font-weight: 700;
  font-size: clamp(0.62rem, 2.5vw, 0.74rem);
  opacity: 0.8;
}
@media (max-width: 420px) {
.dc-data-row {
    gap: 4px;
  }
}
@media (max-width: 768px) {
.dc-data-item i,
  .dc-data-item svg {
    font-size: 0.56rem;
  }
}
.icon-picker-popover {
  width: min(520px, 92vw);
  border-radius: 14px;
}
.icon-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.icon-picker-title {
  font-weight: 900;
  color: var(--color-primary);
}
.icon-picker-item {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.icon-picker-item i {
  font-size: 1.15rem;
}
.icon-picker-item:hover {
  transform: scale(1.08);
  border-color: color-mix(in srgb, var(--pick-color, #0ea5e9) 60%, rgba(148, 163, 184, 0.25));
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--pick-color, #0ea5e9) 25%, transparent),
    0 10px 22px rgba(0, 0, 0, 0.18);
}
.icon-picker-item:active {
  transform: scale(0.98);
}
.stat-blue {
  color: var(--color-blue);
}
.stat-red {
  color: var(--color-red);
}
.stat-green {
  color: var(--color-green);
}
/* تصنيفات موحدة (نوع الخدمة) */
.type-dr-anas {
  color: var(--color-type-dr-anas);
}
.type-nutrition {
  color: var(--color-type-nutrition);
}
.type-procedure {
  color: var(--color-type-procedure);
}
.border-type-dr-anas {
  border-color: var(--color-type-dr-anas);
}
.border-type-nutrition {
  border-color: var(--color-type-nutrition);
}
.border-type-procedure {
  border-color: var(--color-type-procedure);
}
/* صنف الزيارة (جديد / عودة) */
.category-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}
.hide-380 {
  display: inline;
}
.search-group {
  width: 35%;
}
.view-group {
  width: 20%;
  display: flex;
  justify-content: flex-end;
}
@media (max-width: 380px) {
.hide-380 {
    display: none;
  }
/* تصغير إضافي لزر الحجز والقوائم في شاشة 380 */
  .btn-empty-booking {
    padding: 6px 16px !important;
    font-size: 0.78rem !important;
  }
}
@media (max-width: 480px) {
.btn-empty-booking {
    padding: 8px 20px !important;
    font-size: 0.82rem !important;
    border-radius: 10px !important;
  }
}
.appt-card {
  border-bottom: 1px solid var(--color-border);
  border-radius: 2px;
  padding: 15px;
  margin-bottom: 0;
  position: relative;
  background: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: visible;
}
@media (max-width: 768px) {
.appt-card {
    padding: 12px;
    margin-bottom: 12px;
  }
}
.appt-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
/* دبوس ملاحظات ذكي */
.sticky-pin {
  position: absolute;
  top: -8px;
  left: 15px;
  width: 24px;
  height: 24px;
  background: #fbbf24;
  color: #92400e;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 0 4px 4px;
  font-size: 0.7rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 10;
  cursor: help;
}
/* محرك الحالة (Advanced Scheduling) */
.report-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.report-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}
.status-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 5;
}
.status-select {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.7rem;
  padding: 2px 4px;
  font-family: 'Tajawal', sans-serif;
  font-weight: 500;
  background: transparent;
  color: var(--color-text-main);
  cursor: pointer;
  pointer-events: auto;
  outline: none;
}
/* تلوين الكروت حسب الحالة */
.appt-card.status-ready {
  border-right-width: 6px !important;
}
.appt-card.status-wait {
  border-color: var(--color-border);
}
.appt-card.status-in-now {
  border-color: var(--color-border);
  animation: in-now-pulse 1.6s ease-in-out infinite;
}
.appt-card.status-skip {
  border-color: var(--color-border);
}
.appt-card.status-done {
  border-color: var(--color-border);
}
.appt-card.status-bypass {
  border-color: var(--color-border);
}
.appt-card.status-away {
  border-color: var(--color-border);
}
.appt-card.status-postpone {
  border-color: var(--color-border);
}
.appt-card.status-break {
  border-style: dashed;
}
.appt-card.status-urgent {
  border-color: var(--color-border);
}
@keyframes in-now-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.14);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}
@keyframes flash-border {
  0% {
    border-color: #ef4444;
  }

  50% {
    border-color: transparent;
  }

  100% {
    border-color: #ef4444;
  }
}
.appt-card.done {
  background: #fff;
  border-color: var(--color-border);
  opacity: 1;
}
/* تعديل الهيدر ليحتوي على زر التشيك بجوار الوقت */
.appt-header {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}
.appt-name {
  font-weight: 500;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
@media (max-width: 480px) {
.appt-card {
    padding: 10px 10px;
  }
.appt-name {
    font-size: 0.82rem;
  }
.appt-time {
    font-size: 0.68rem;
  }
.appt-details {
    font-size: 0.64rem;
  }
.status-select {
    font-size: 0.64rem;
  }
}
@media (max-width: 380px) {
.appt-card {
    padding: 9px 9px;
  }
.appt-name {
    font-size: 0.78rem;
  }
.appt-time {
    font-size: 0.66rem;
  }
.appt-details {
    font-size: 0.62rem;
  }
.status-select {
    font-size: 0.62rem;
  }
}
.appt-time {
  font-size: 0.75rem;
  font-weight: 500;
  background: transparent;
  color: var(--color-text-main);
  border: 1px solid var(--color-border);
  padding: 2px 6px;
  border-radius: 6px;
}
.check-btn {
  color: var(--color-border);
  font-size: 1.1rem;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  width: 32px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.check-btn:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text-muted);
}
.check-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 52, 104, 0.12);
}
.check-btn:hover,
.check-btn:focus {
  transform: scale(1.05);
}
.appt-card.done .check-btn {
  color: var(--color-green);
  border-color: var(--color-green);
}
.appt-card.status-ready .status-select {
  color: var(--color-green);
  border-color: var(--color-green);
}
.appt-card.status-wait .status-select {
  color: var(--color-text-main);
  border-color: var(--color-border);
}
.appt-card.status-in-now .status-select {
  color: var(--color-green);
  border-color: var(--color-green);
}
.appt-card.status-bypass .status-select {
  color: #3b82f6;
  border-color: #3b82f6;
}
.appt-card.status-skip .status-select {
  color: #3b82f6;
  border-color: #3b82f6;
}
.appt-card.status-away .status-select {
  color: #f59e0b;
  border-color: #f59e0b;
}
.appt-card.status-postpone .status-select {
  color: var(--color-text-muted);
  border-color: var(--color-text-muted);
}
.appt-card.status-break .status-select {
  color: var(--color-text-muted);
  border-color: var(--color-text-muted);
}
.appt-card.status-urgent .status-select {
  color: #ef4444;
  border-color: #ef4444;
}
.appt-card.status-done .status-select {
  color: var(--color-green);
  border-color: var(--color-green);
}
.appt-type-title {
  margin: 14px 0 8px 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
}
@media (min-width: 769px) {
.appt-type-title {
    font-size: 1.05rem;
  }
}
@media (max-width: 480px) {
.appt-type-title {
    font-size: 0.9rem;
  }
.btn-action i,
  .check-btn i {
    font-size: 0.85rem;
  }
}
.appt-details {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* جعل التفاصيل يمين والأزرار يسار */
  gap: 8px;
  margin-bottom: 6px;
  border-top: 1px dashed var(--color-border);
  padding-top: 8px;
  margin-top: 4px;
}
.appt-info-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.appt-info-side span {
  white-space: nowrap;
}
.info-sep {
  width: 1px;
  height: 12px;
  background: var(--color-border);
  margin: 0 2px;
}
.appt-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.btn-action {
  background: none;
  border: none;
  font-size: 0.95rem;
  /* تصغير حجم الأزرار */
  cursor: pointer;
  color: var(--color-text-muted);
  /* لون موحد */
  transition: all 0.25s ease;
  padding: 6px;
  border-radius: 8px;
}
.btn-action:hover {
  color: var(--color-green);
  /* يتغير للأخضر الفاتح */
  transform: scale(1.1);
}
/* Header Stats */
.header-stats {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0;
  background: var(--bg-procedure);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
}
.header-stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.header-stat-value {
  font-weight: 800;
  color: var(--color-text-main);
}
/* --- المودال (النوافذ المنبثقة) --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.modal.active {
  display: flex;
}
.modal-content {
  background: var(--bg-card);
  width: 95%;
  max-width: 600px;
  max-height: 90vh;
  margin: auto;
  border-radius: 20px;
  padding: 16px 16px 40px 16px;
  padding-bottom: max(50px, env(safe-area-inset-bottom));
  overflow-y: auto;
  animation: scaleInModal 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes scaleInModal {
  from {
    transform: scale(0.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}
.booking-content {
  background: var(--bg-card);
  width: 99%;
  max-width: 600px;
  max-height: 90vh;
  margin: auto;
  border-radius: 20px;
  padding: 16px 5px 40px 5px;
  padding-bottom: max(50px, env(safe-area-inset-bottom));
  overflow-y: auto;
  animation: scaleInModal 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.form-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  align-items: center;
  width: 100%;
}
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}


.form-row .input-with-icon,
.input-with-icon.flex-1 {
  flex: 1;
}

.input-with-icon i,
.input-with-icon .lucide,
.input-with-icon svg {
  position: absolute;
  right: 14px;
  /* تثبيت في جهة اليمين */
  left: auto;
  color: #64748b;
  width: 18px;
  /* توحيد الحجم */
  height: 18px;
  stroke-width: 2px;
  /* توحيد السمك */
  z-index: 2;
  pointer-events: none;
  transition: all 0.2s ease;
}
/* تخصيص أيقونة التقويم date picker */
/* تحسين مظهر نافذة اختيار التاريخ والوقت (Native Pickers) */
input[type="date"],
input[type="time"] {
  border: 1.5px solid var(--color-primary) !important;
  border-radius: 12px !important;
  background-color: #ffffff !important;
  color: var(--color-primary) !important;
  padding: 8px 12px !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
input[type="date"]:focus,
input[type="time"]:focus {
  border-color: var(--color-green) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.8;
  transition: 0.2s;
  background-color: var(--color-primary);
  padding: 5px;
  border-radius: 6px;
  filter: invert(1);
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background-color: var(--color-secondary);
}
/* إزاحة النص لليمين لتجنب الأيقونة في واجهة RTL */
.styled-input {
  width: 100%;
  padding: 10px 42px 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--bg-body);
  color: var(--color-text-main);
  font-size: 0.85rem;
  outline: none;
  font-weight: 500;
  transition: all 0.2s ease;
}
.styled-input:focus {
  border-color: var(--color-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.08);
}
.seg-btn {
  flex: 1;
  text-align: center;
  padding: 12px 2px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: 0.2s;
}
.seg-btn.active {
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}
.seg-btn.active-green {
  background: var(--color-green);
  color: white;
}
.btn-primary:hover {
  background: #4a4a8c;
  transform: translateY(-2px);
}
.btn-submit {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 4px 10px rgba(52, 52, 104, 0.2);
}
.btn-submit:hover {
  background: #4a4a8c;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(52, 52, 104, 0.3);
}
.btn-submit-sms {
  background: transparent;
  color: #0ea5e9;
  border: 1px solid #0ea5e9;
  box-shadow: none;
}
.btn-submit-sms:hover {
  background: rgba(14, 165, 233, 0.1);
  transform: translateY(-2px);
  box-shadow: none;
}
.btn-cancel {
  background: var(--bg-procedure);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.btn-cancel:hover {
  background: var(--color-border);
  color: var(--color-text-main);
  transform: translateY(-2px);
}
/* زر إضافة ملف جديد في صفحة الملفات */
.btn-add-file {
  background: rgba(71, 25, 216, 0.04);
  color: var(--color-primary);
  border: 1px solid var(--color-primary) !important;
  font-weight: 800;
  box-shadow: none !important;
}
.btn-add-file:hover {
  background: var(--color-primary);
  color: white;
}
@media (max-width: 480px) {
#patientDetailsModal .btn-submit,
  #patientDetailsModal .btn-cancel {
    font-size: 0.66rem;
  }
}
@media (max-width: 380px) {
#patientDetailsModal .btn-submit,
  #patientDetailsModal .btn-cancel {
    font-size: 0.62rem;
  }
}
/* تنسيق موحد لأيقونة البحث في جهة اليسار */
.search-box-container i,
.search-box-container .lucide,
.search-box-container svg {
  display: block !important;
  left: 14px !important;
  right: auto !important;
}
.search-input,
#patientsSearchInput {
  padding-left: 42px !important;
  padding-right: 12px !important;
}
/* Desktop readability: larger table text only */
/* Patient details modal scaling on small screens */
@media (max-width: 480px) {
#patientDetailsModal .modal-content {
    padding: 12px 12px 28px 12px;
    border-radius: 16px 16px 0 0;
  }
#patientDetailsModal .modal-header-row h3 {
    font-size: 0.95rem;
  }
#patientDetailsModal .btn-submit,
  #patientDetailsModal .btn-cancel {
    font-size: 0.6rem;
    padding: 7px 10px;
  }
}
@media (max-width: 380px) {
#patientDetailsModal .modal-header-row h3 {
    font-size: 0.9rem;
  }
#patientDetailsModal .btn-submit,
  #patientDetailsModal .btn-cancel {
    font-size: 0.66rem;
    padding: 6px 9px;
  }
}
.visit-stats-box {
  display: flex;
  gap: 4px;
}
.vs-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.7rem;
}
.vs-total {
  background: var(--bg-procedure);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
}
.vs-returns {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
}
.patient-name{
  color: var(--color-red);
  font-weight: 500;
}
.history-item {
  margin-top: 6px;
  font-size: 0.75rem;
  position: relative;
}
.history-item::before {
  content: '';
  position: absolute;
  right: -15px;
  top: 4px;
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
}
.flex-gap-8 {
  display: flex;
  gap: 8px;
}
.flex-1-5 {
  flex: 1.5;
}
.flex-2 {
  flex: 2;
}
.flex-3 {
  flex: 3;
}
.flex-7 {
  flex: 7;
}
.w-70 {
  width: 70%;
}
.w-30 {
  width: 30%;
}
.text-right {
  text-align: right;
}
.text-muted {
  color: var(--color-text-muted);
}
.font-800 {
  font-weight: 800;
}
.font-700 {
  font-weight: 700;
}
.font-size-sm {
  font-size: 0.75rem;
}
.font-size-md {
  font-size: 0.9rem;
}
.font-size-lg {
  font-size: 1rem;
}
/* عناصر مشتركة للهيدر والمودال */
.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px;
}
.user-badge-text {
  color: var(--color-primary);
}
.sync-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f8fafc;
  color: var(--color-green);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  margin-left: 10px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: 0;
}
.sync-action-btn.has-pending {
  color: var(--color-red);
  background: #fff1f2;
  border-color: rgba(var(--color-red-rgb), 0.2);
}
.sync-action-btn .sync-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--color-red);
  color: white;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.sync-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  background: white;
}
.sync-action-btn:active {
  transform: translateY(0);
}
.sync-action-btn i {
  width: 20px;
  height: 20px;
}
.user-badge-icon {
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  .sync-action-btn {
    width: 34px;
    height: 34px;
    margin-left: 8px;
  }
  .sync-action-btn .sync-badge {
    min-width: 16px;
    height: 16px;
    font-size: 9px;
    top: -1px;
    right: -1px;
  }
  .sync-action-btn i {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 480px) {
  .sync-action-btn {
    width: 30px;
    height: 30px;
    margin-left: 5px;
  }
  .sync-action-btn .sync-badge {
    min-width: 14px;
    height: 14px;
    font-size: 8px;
    border-width: 1px;
    top: 0;
    right: 0;
  }
  .sync-action-btn i {
    width: 16px;
    height: 16px;
  }
  .sync-action-btn:hover {
    transform: none;
    box-shadow: border-box;
    background: #f8fafc;
  }
  .sync-action-btn.has-pending:hover {
    background: #fff1f2;
  }
}



@media (max-width: 480px) {
.year-text {
    font-size: 0.78rem;
  }
}
/* تنسيق النوافذ المنبثقة لأزرار التصدير */
@media (max-width: 380px) {
.year-text {
    font-size: 0.72rem;
    padding: 2px 5px;
  }
}
/* إحصائيات الهيدر */
.header-stats {
  display: flex;
  gap: 10px;
  font-size: 0.65rem;
  color: var(--color-text-muted);
  font-weight: 700;
  margin-top: 1px;
}
.h-stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.h-stat-icon {
  font-size: 0.7rem;
}
/* Appointments Page Specific Styles */
.list-mode .appt-card:not(.is-expanded) .appt-service,
.list-mode .appt-card:not(.is-expanded) .appt-details {
  display: none;
}
/* إظهار توقيت الموعد بوضوح بجانب اسم المريض في وضع القائمة */
.list-mode .appt-card:not(.is-expanded) .appt-time {
  font-size: 0.8rem;
  margin-right: auto;
  margin-left: 10px;
}
.list-mode .appt-card:not(.is-expanded) .status-wrap .status-select {
  display: none;
}
.list-mode .appt-card:not(.is-expanded) .status-wrap {
  gap: 0;
}
.list-mode .appt-card:not(.is-expanded) .appt-header {
  margin-bottom: 0;
}
.list-mode .appt-card:not(.is-expanded) {
  padding: 8px 12px;
  margin-bottom: 4px;
}
/* تصغير أزرار الهيدر (موعد جديد، طباعة...) في الشاشات الصغيرة لتجنب انكسار السطر */
@media (max-width: 480px) {
/* تصغير أسهم التنقل في الشاشات الصغيرة لتناسب حجم التاريخ */

}
@media (max-width: 380px) {
/* تصغير أسهم التنقل في الشاشات 380px */

}
/* Expanded card: name in first full-width row, rest below */
.appt-card.is-expanded .appt-header {
  flex-wrap: wrap;
  align-items: flex-start;
}
.appt-card.is-expanded .appt-name {
  flex: 0 0 100%;
  width: 100%;
}
@media (max-width: 480px) {
.appt-card.is-expanded .appt-service {
    font-size: 0.68rem !important;
    margin-bottom: 6px !important;
  }
.appt-card.is-expanded .appt-details {
    font-size: 0.62rem;
  }
.appt-card.is-expanded .appt-actions {
    gap: 6px;
  }
.appt-card.is-expanded .btn-action {
    padding: 5px;
    font-size: 0.82rem;
  }
.appt-card.is-expanded .check-btn {
    width: 30px;
    height: 26px;
  }
}
@media (max-width: 380px) {
.appt-card.is-expanded .appt-service {
    font-size: 0.64rem !important;
  }
.appt-card.is-expanded .appt-details {
    font-size: 0.6rem;
  }
.appt-card.is-expanded .btn-action {
    padding: 4px;
    font-size: 0.78rem;
  }
.appt-card.is-expanded .check-btn {
    width: 28px;
    height: 25px;
  }
}
.view-toggle-btn {
  background: var(--bg-procedure);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 800;
  transition: 0.2s;
}
.view-toggle-btn.active {
  background: var(--color-primary);
  color: white;
}
/* أزرار الاتصال بألوان الباستيل في كرت الموعد */
.btn-pastel-call {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border: none !important;
  box-shadow: none !important;
}
.btn-pastel-call:hover {
  background: #bae6fd !important;
}
.btn-pastel-sms {
  background: #f3e8ff !important;
  color: #7e22ce !important;
  border: none !important;
  box-shadow: none !important;
}
.btn-pastel-sms:hover {
  background: #e9d5ff !important;
}
.btn-pastel-wa {
  background: #dcfce7 !important;
  color: #16a34a !important;
  border: none !important;
  box-shadow: none !important;
}
.btn-pastel-wa:hover {
  background: #bbf7d0 !important;
}
.day-card {
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: 0.2s;
}
.day-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}
.day-card.is-today {
  border: 2px solid var(--color-primary);
  background: var(--bg-procedure);
  box-shadow: 0 0 10px rgba(52, 52, 104, 0.15);
  position: relative;
  transform: scale(1.02);
  z-index: 1;
}
.day-card.is-today::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--color-primary);
  color: white;
  width: 10px;
  height: 10px;
  border-radius: 0 0 0 10px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55);
}
@media (max-width: 768px) {
.day-card {
    padding: 5px 3px;
  }
}
/* Progress cells mode */
.progress-cells {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  height: 100%;
  width: 100%;
  padding: 3px;
}
.progress-cell {
  height: 100%;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.progress-cell.is-inactive {
  opacity: 0.38;
  background: rgba(0, 0, 0, 0.06);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03);
}
.progress-cell.is-done {
  background: linear-gradient(90deg, var(--color-green), #34d399);
  box-shadow: 0 6px 14px rgba(16, 185, 129, 0.18);
}
.progress-cells.is-complete .progress-cell.is-done {
  position: relative;
  overflow: hidden;
}
.progress-cells.is-complete .progress-cell.is-done::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: progress-shimmer 1.4s ease-in-out infinite;
}
@keyframes progress-shimmer {
  0% {
    left: -40%;
  }

  100% {
    left: 110%;
  }
}
.progress-marker {
  position: absolute;
  top: -6px;
  width: 4px;
  height: 32px;
  background: var(--color-text-main);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left 0.3s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.progress-value-label {
  color: var(--color-primary);
}
@media (max-width: 480px) {
#manualReportModal .modal-header-row h3 {
    font-size: 0.9rem;
    font-weight: 500;
  }
#manualReportModal .icon-btn {
    font-size: 1.05rem;
  }
#manualReportModal textarea {
    font-size: 0.78rem;
  }
}
@media (max-width: 380px) {
#manualReportModal .modal-header-row h3 {
    font-size: 0.86rem;
  }
}
/* Accordion cards (Appointment types/categories settings) */
.appt-acc {
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.appt-acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 0;
  cursor: pointer;
  text-align: right;
}
.appt-acc-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.appt-acc-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex: 0 0 auto;
}
.appt-acc-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appt-acc-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--bg-procedure);
  color: var(--color-text-muted);
  flex: 0 0 auto;
  transition: transform 0.18s ease;
}
.appt-acc.open .appt-acc-chevron {
  transform: rotate(180deg);
}
.appt-acc-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}
.appt-acc-inner {
  padding: 10px 12px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* Soft Select (custom dropdown) */
.soft-select-wrap {
  position: relative;
  width: 100%;
}
.soft-select-native {
  display: none !important;
}
.soft-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.soft-select-trigger .soft-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.soft-select-trigger .soft-select-caret {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.06);
}
.soft-select-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
  z-index: 9998;
  display: none;
}
.soft-select-menu {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(520px, calc(100vw - 24px));
  max-height: min(60vh, 420px);
  overflow: auto;
  background: var(--bg-card);
  border: 1px solid rgba(17, 24, 39, 0.25);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(17, 24, 39, 0.25);
  z-index: 9999;
  display: none;
}
.soft-select-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--color-text-main);
  padding: 12px 12px;
  text-align: right;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 500;
}
.soft-select-item:hover {
  background: rgba(var(--color-primary-rgb), 0.08);
}
.soft-select-item.active {
  background: rgba(var(--color-primary-rgb), 0.12);
}
.soft-select-item .soft-select-check {
  width: 22px;
  height: 22px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}
.settings-group {
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.btn-pastel-sms.is-sent,
.btn-pastel-wa.is-sent {
  border-color: rgba(16, 185, 129, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}
.btn-pastel-sms.is-sent i,
.btn-pastel-sms.is-sent svg,
.btn-pastel-wa.is-sent i,
.btn-pastel-wa.is-sent svg {
  color: var(--color-green) !important;
}
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  transition: 0.2s;
  cursor: pointer;
}
.setting-item:last-child {
  border-bottom: none;
}
.setting-item:hover {
  background: var(--bg-procedure);
}
.progress-bar-wrap {
  padding: 14px 16px;
  width: 100%;
}
.progress-bar-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}
.progress-live-time {
  color: var(--color-primary);
  font-weight: 800;
}
.progress-value-label {
  color: var(--color-primary);
}
@keyframes report-glow {

  0%,
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.6));
  }

  50% {
    opacity: 0.9;
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.9));
  }
}
.filters-row-label {
  display: none;
  /* تم استبدال العنونة بالـ h3 في الـ html */
}
/* حاويات الإحصائيات الثلاث - تم نقل التنسيق للأسفل لضمان الأولوية */
/* Dynamic stats cards mount (fills width based on count) */
#dashboardStatsCards {
  display: grid;
  width: 100%;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}
.stats-card {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border-radius: 7px 3px 3px 7px;
  position: relative;
  overflow: hidden;
  box-shadow: none !important;
  transition: none !important;
}
/* Dynamic type color binding */
.stats-card[data-gauge-key] {
  border-right: 2px solid var(--type-color, rgba(52, 52, 104, 0.22)) !important;
}
.stats-card[data-gauge-key] .stats-card-value {
  color: var(--type-color, var(--color-primary)) !important;
}
.stats-card[data-gauge-key] .dashboard-section-icon {
  color: var(--type-color, var(--color-primary)) !important;
}
.stats-card:hover {
  transform: none !important;
  box-shadow: none !important;
}
.stats-card .dashboard-section-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0;
  gap: 4px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-text-muted);
}
.stats-card .dashboard-section-icon {
  font-size: 2rem;
  /* جعل الإيقونة العنصر الأكبر بوضوح */
  margin-bottom: 10px;
  color: inherit;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.stats-card:hover .dashboard-section-icon {
  transform: scale(1.2);
}
.stats-card-value {
  font-size: 1.85rem;
  font-weight: 800;
  font-family: var(--font-main);
  line-height: 1.1;
  margin-top: 2px;
}
.stats-card-values {
  display: flex;
  justify-content: space-evenly;
  width: 100%;
  gap: 12px;
  margin-top: 4px;
}
.stats-card-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.stats-card-label {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
}
.stats-card-label i,
.stats-card-label svg {
  width: 10px;
  height: 10px;
  stroke-width: 2.5px;
  opacity: 0.7;
}
@media (max-width: 480px) {
#dashboardStatsCards {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }
.stats-card {
    padding: 10px 6px !important;
    gap: 4px !important;
  }
.stats-card .dashboard-section-title {
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    gap: 2px !important;
  }
.stats-card .dashboard-section-icon {
    font-size: 1.25rem !important;
    margin-bottom: 2px !important;
  }
.stats-card-value {
    font-size: 1.15rem !important;
  }
.stats-card-label {
    font-size: 0.55rem !important;
    font-weight: 500 !important;
  }
}
@media (max-width: 380px) {
.stats-card {
    padding: 14px 10px;
    gap: 4px;
  }
.stats-card .dashboard-section-title {
    font-size: 0.74rem !important;
    font-weight: 800 !important;
  }
.stats-card-label {
    font-size: 0.5rem !important;
    font-weight: 500 !important;
  }
}
/* تم نقل تنسيقات stats-card-value للأعلى ضمن تعريف الكرت */
.stats-card.type-dr-anas .stats-card-value {
  color: var(--color-type-dr-anas);
}
.stats-card.type-nutrition .stats-card-value {
  color: var(--color-type-nutrition);
}
.stats-card.type-procedure .stats-card-value {
  color: var(--color-type-procedure);
}
.stats-card-change {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-top: 4px;
  font-family: var(--font-main);
}
.stats-card-change .change-up {
  color: var(--color-green);
}
.stats-card-change .change-down {
  color: var(--color-red);
}
.dashboard-gauges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
/* إصلاح مشكلة انكماش الكروت في الداشبورد */
.dashboard-stats-cards {
  display: block !important;
  /* إلغاء الجريد من الحاوية الكبرى ليعمل الجريد الداخلي بحرية */
  width: 100%;
  margin-top: 0px !important;
  /* إلغاء الهامش العلوي للاقتراب من الهيدر */
  margin-bottom: 14px;
  /* الحفاظ على الهامش السفلي فقط */
}
/* الحاوية الفعلية للكروت */
#dashboardStatsCards {
  display: grid;
  width: 100%;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
}
@media (max-width: 900px) {
.dashboard-gauges:not(.dashboard-stats-cards) {
    grid-template-columns: repeat(2, 1fr);
  }
#dashboardStatsCards {
    grid-template-columns: repeat(3, 1fr);
    /* Force 3 columns even here */
  }
}
@media (max-width: 500px) {
.dashboard-gauges:not(.dashboard-stats-cards) {
    grid-template-columns: 1fr;
  }
#dashboardStatsCards {
    grid-template-columns: repeat(3, 1fr) !important;
    /* Force 3 columns on small screens */
  }
}
.dashboard-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 14px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}
/* --- تحسينات المودال العام --- */
.modal-content {
  padding-bottom: 30px !important;
  /* مساحة تهوية في الأسفل */
}
.modal-content .form-row {
  margin-bottom: 18px;
  /* مسافة بين الصفوف */
}
.modal-header-row .icon-btn {
  color: var(--color-red);
  /* أيقونة X حمراء */
}
/* أيقونة الملاحظات بمحاذاة التيكست أريا من الأعلى جهة اليمين */
.modal-content .input-with-icon textarea~i,
.modal-content .input-with-icon textarea~svg {
  top: 15px;
  transform: none;
  right: 14px;
}
#bookingSaveSmsBtn {
  background: #ffffff !important;
  /* خلفية بيضاء */
  color: #0369a1 !important;
  /* نص أزرق */
  border: 1px solid #bae6fd !important;
  /* حد أزرق فاتح */
  box-shadow: none !important;
  /* إزالة الظل */
}
#bookingSaveSmsBtn:hover {
  background: #f0f9ff !important;
}
.btn-cancel {
  color: var(--color-red) !important;
  border: 1px solid var(--color-red) !important;
  background: transparent !important;
  text-align: center;
  justify-content: center;
}
.btn-cancel:hover {
  background: rgba(239, 68, 68, 0.05) !important;
}
.btn-submit,
.btn-cancel {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
/* تأثير الانزلاق لصف "نوع الموعد" */
#bookingCategoryRow {
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.3s ease;
  max-height: 100px;
}
#bookingCategoryRow.hidden-row {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  pointer-events: none;
}
/* أنيميشن النبض لزر التأكيد */
@keyframes confirm-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 52, 104, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(52, 52, 104, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(52, 52, 104, 0);
  }
}
.btn-submit.pulse-ready {
  animation: confirm-glow 1.5s infinite;
  border-color: var(--color-primary);
  box-shadow: 0 4px 15px rgba(52, 52, 104, 0.2);
}
.dashboard-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-primary);
}
.dashboard-section-icon {
  font-size: 0.7rem;
}
.gauge-card {
  text-align: center;
}
.gauge-wrap {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto 8px;
}
.gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.gauge-bg {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 8;
}
.gauge-ring {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 289;
  stroke-dashoffset: 289;
  transition: stroke-dashoffset 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}
.gauge-ring-1 {
  stroke: var(--color-green);
}
.gauge-ring-2 {
  stroke: var(--color-blue);
}
.gauge-ring-3 {
  stroke: var(--color-primary);
}
.gauge-ring-progress {
  stroke: var(--color-green);
}
.gauge-ring-dr-anas {
  stroke: var(--color-type-dr-anas);
}
.gauge-ring-nutrition {
  stroke: var(--color-type-nutrition);
}
.gauge-ring-procedure {
  stroke: var(--color-type-procedure);
}
.header-filter-wrap {
  margin-top: 4px;
}
.header-filter-select {
  font-family: var(--font-main);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--bg-card);
  color: var(--color-text-main);
  max-width: 140px;
}
.pulse-category-group {
  flex-shrink: 0;
}
.gauge-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.gauge-number {
  font-weight: 800;
  font-size: 1.3rem;
}
.gauge-unit {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.gauge-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-muted);
}
.dashboard-layout-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  align-items: stretch;
}
@media (max-width: 768px) {
.dashboard-layout-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
#clinicPulseChart {
  width: 100%;
  height: 100%;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  padding: 6px 8px;
  border-radius: 10px;
  background: var(--bg-procedure);
}
.activity-item i {
  color: var(--color-green);
}
.activity-text {
  font-weight: 500;
}
.activity-time {
  font-weight: 500;
}
@keyframes connection-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
    opacity: 1;
  }

  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    opacity: 0.95;
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    opacity: 1;
  }
}
/* Responsive dashboard adjustments */
@media (max-width: 480px) {
.progress-bar-wrap {
    padding: 12px 12px;
  }
.progress-bar-meta {
    font-size: 0.72rem;
  }
.dashboard-section-title {
    font-size: 0.88rem;
  }
.dashboard-layout-row {
    gap: 10px;
  }
.filters-row-label {
    font-size: 0.78rem;
  }
}
@media (max-width: 380px) {
.activity-item {
    font-size: 0.72rem;
  }
.stats-card-value {
    font-size: 1.3rem !important;
  }
.stats-card-label {
    font-size: 0.5rem !important;
    font-weight: 500 !important;
  }
.filters-row-label {
    font-size: 0.74rem;
  }
#manualReportModal textarea {
    font-size: 0.75rem;
  }
}
.activity-time {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-right: auto;
}
.broadcast-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--color-border);
}
.broadcast-mode-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}
.toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-main);
}
.toggle-switch {
  position: relative;
  width: 60px;
  height: 30px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-border);
  transition: 0.4s;
  border-radius: 34px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
.toggle-switch input:checked+.toggle-slider {
  background-color: var(--color-primary);
}
.toggle-switch input:checked+.toggle-slider:before {
  transform: translateX(30px);
}
.toggle-labels {
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-text-muted);
}
.broadcast-section {
  margin-bottom: 30px;
}
.broadcast-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-main);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.broadcast-section-title i {
  color: var(--color-primary);
}
.patient-name {
  font-weight: 500;
}
.status-calling {
  color: var(--color-green);
  font-weight: 600;
}
.queue-actions {
  display: flex;
  gap: 5px;
  justify-content: center;
}
.btn-call,
.btn-delay,
.btn-enter {
  padding: 6px 8px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.10);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}
.btn-call {
  background: var(--color-blue);
  color: white;
}
.btn-call:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}
.btn-delay {
  background: var(--color-red);
  color: white;
}
.btn-delay:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.22);
}
.btn-enter {
  background: var(--color-green);
  color: white;
}
.btn-enter:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(5, 150, 105, 0.22);
}
.media-label {
  font-size: 12px;
  color: var(--color-text-main);
  font-weight: 500;
}
.control-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-main);
}
.btn-mood {
  padding: 8px 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
  margin: 0 5px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.10);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}
.btn-break {
  background: var(--color-green);
  color: white;
}
.btn-break:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(5, 150, 105, 0.22);
}
.btn-emergency {
  background: var(--color-red);
  color: white;
}
.btn-emergency:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.22);
}
.btn-normal {
  background: var(--color-blue);
  color: white;
}
.btn-normal:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}
.btn-mood.active {
  opacity: 0.8;
  transform: scale(0.95);
}
/* Responsive adjustments for broadcast panel */
@media (max-width: 768px) {
.broadcast-header {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }
}
.broadcast-mode-card {
  margin-bottom: 30px;
}
.broadcast-mode-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.mode-selector {
  display: flex;
  align-items: center;
  gap: 15px;
}
.mode-label {
  font-weight: 500;
  color: var(--color-text-main);
}
.mode-info {
  display: flex;
  gap: 20px;
}
.mode-description {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  background: var(--bg-body);
  border-radius: 8px;
  color: var(--color-text-muted);
  font-size: 14px;
}
.queue-stats {
  display: flex;
  gap: 15px;
}
.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--bg-body);
  border-radius: 15px;
  font-size: 14px;
  font-weight: 500;
}
.preview-container {
  display: flex;
  justify-content: center;
  padding: 20px;
}
.preview-mini-tv {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 16 / 10;
  height: auto;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.preview-header {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 5px 15px;
  border-radius: 15px;
  color: white;
  font-size: 12px;
  z-index: 10;
}
.preview-content {
  display: flex;
  height: calc(100% - 40px);
  margin-top: 30px;
}
.preview-queue {
  flex: 0 0 60%;
  padding: 15px;
  color: white;
}
.preview-queue-header {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  text-align: center;
}
.preview-queue-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.preview-queue-item {
  display: flex;
  justify-content: space-between;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 12px;
}
.preview-media {
  flex: 0 0 40%;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-media img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}
.preview-ticker {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 8px;
  color: white;
  font-size: 12px;
  text-align: center;
}
.widget-preview {
  display: flex;
  justify-content: center;
}
.mini-tv-preview {
  width: 280px;
  height: 165px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.preview-body {
  display: flex;
  height: calc(100% - 50px);
  margin-top: 20px;
}
.preview-queue-mini {
  flex: 0 0 60%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.queue-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 18px;
  font-weight: 700;
}
.preview-media-mini {
  flex: 0 0 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.preview-media-mini img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
}
.preview-ticker-mini {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 4px;
  color: white;
  font-size: 9px;
  text-align: center;
}
.status-break {
  color: var(--color-blue);
}
.status-emergency {
  color: var(--color-red);
}
.mood-buttons {
  display: flex;
  gap: 6px;
}
/* Responsive adjustments */
@media (max-width: 768px) {
.preview-mini-tv {
    width: 300px;
    height: 200px;
  }
.mini-tv-preview {
    width: 240px;
    height: 142px;
  }
.mode-info {
    flex-direction: column;
  }
}
.command-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInLeft 0.3s ease;
}
.command-item.new {
  border-right: 4px solid var(--color-blue);
  background: #f0f9ff;
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
/* --- Notification Toast --- */
.doctor-toast {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 9999;
  background: white;
  border-right: 6px solid var(--color-blue);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  padding: 16px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 300px;
  transform: translateX(-120%);
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.doctor-toast.show {
  transform: translateX(0);
}
/* --- Refined Command Widget Styles --- */
.command-item {
  padding: 8px 10px; 
  gap: 10px;
  border-radius: 8px;
}
.command-item.cmd-next { border-right: 4px solid #10b981; background: #f0fdf4; }
.command-item.cmd-urgent { border-right: 4px solid #ef4444; background: #fef2f2; }
.command-item.cmd-wait { border-right: 4px solid #f59e0b; background: #fffbeb; }
.command-item.cmd-info { border-right: 4px solid #3b82f6; background: #eff6ff; }
/* --- Calendar Page Specific Enhancements --- */
@media (max-width: 480px) {
.dc-weekday { font-size: calc(clamp(0.56rem, 2.4vw, 0.79rem) - 1px); margin-top: 3px; }
.dc-date { font-size: calc(clamp(1.02rem, 3.5vw, 1.22rem) + 1px); }
}
@media (max-width: 380px) {
.dc-weekday { font-size: calc(clamp(0.56rem, 2.4vw, 0.79rem) - 1px); margin-top: 3px; }
.dc-date { font-size: calc(clamp(1.02rem, 3.5vw, 1.22rem) + 1px); }
}
@media (min-width: 769px) {
.dc-weekday { font-size: calc(clamp(0.56rem, 2.4vw, 0.79rem) + 2px); margin-top: 5px; }
.dc-date { font-size: calc(clamp(1.02rem, 3.5vw, 1.22rem) + 4px); }
}
/* --- Appointments Page Specific Enhancements --- */
.appt-name {
    font-weight: 600 !important;
}
.category-badge {
    font-weight: 500 !important;
    font-size: calc(100% - 1px) !important; 
    border-radius: 4px;
}
/* Force duration to hide when collapsed, but show status-select */
.list-mode .appt-card:not(.is-expanded) .status-wrap .appt-duration {
    display: none !important;
}
.list-mode .appt-card:not(.is-expanded) .status-wrap .status-select {
    display: inline-block !important; /* Override the hiding of status-select */
}








/* تنسيق النوافذ المنبثقة لأزرار التصدير */
.export-menu-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  min-width: 120px;
  overflow: hidden;
  margin-top: 5px;
  border: 1px solid var(--color-border);
}

.export-menu-dropdown button {
  width: 100%;
  text-align: right;
  padding: 10px 15px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--color-text-main);
  transition: 0.2s;
}

.export-menu-dropdown button:hover {
  background: var(--color-bg-secondary);
  color: var(--color-primary);
}

.export-menu-dropdown button:not(:last-child) {
  border-bottom: 1px solid #eee;
}






.search-input,
.files-search-filter-row .styled-input {
  width: 100%;
  padding: 7px 12px;
  /* زيادة الارتفاع */
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--bg-card);
  font-size: 0.85rem;
  /* زيادة حجم الخط */
}


/* Filters typography scaling */
@media (min-width: 769px) {

  .filter-select,
  .filter-toggle,
  .search-input,
  .view-toggle-btn,
  .files-search-filter-row select,
  .files-search-filter-row .styled-input {
    font-size: calc(0.85rem + 2px);
    background: var(--bg-card);
    padding: 8px 12px;
  }
}


@media (max-width: 480px) {

  .filter-select,
  .filter-toggle,
  .search-input,
  .view-toggle-btn,
  .files-search-filter-row select,
  .files-search-filter-row .styled-input {
    font-size: 0.7rem !important;
    /* تقليل 1-2 بكسل */
    padding: 8px 8px !important;
  }

  .btn-empty-booking {
    padding: 8px 20px !important;
    font-size: 0.82rem !important;
    border-radius: 10px !important;
  }

  .export-menu-dropdown {
    min-width: 100px !important;
    padding: 8px 12px !important;
  }
   .export-menu-dropdown {
    min-width: 90px !important;
  }

  .export-menu-dropdown button {
    padding: 6px 10px !important;
    font-size: 0.72rem !important;
  }

  .filters-bar {
    gap: 6px;
  }

  .filter-group {
    width: 50%;
  }

  .search-group {
    width: 40%;
  }

  .view-group {
    width: 10%;
  }

  .filter-toggle {
    min-width: 0;
    flex: 1.05;
  }

  .filter-select {
    width: 48%;
  }
}




@media (max-width: 380px) {

  /* تصغير نصوص الفلاتر في شاشة 380 بنسبة إضافية */
  .filter-select,
  .filter-toggle,
  .search-input,
  .view-toggle-btn,
  .files-search-filter-row select,
  .files-search-filter-row .styled-input {
    font-size: 0.64rem !important;
  }
}


@media (max-width: 380px) {
  
  
  /* تصغير نصوص الفلاتر في شاشة 380 */
  .filter-select,
  .filter-toggle,
  .search-input,
  .files-search-filter-row select,
  .files-search-filter-row .styled-input {
    font-size: 0.65rem !important;
  }
}

 
.btn-submit,
.btn-submit-sms,
.btn-reset,
.btn-cancel {
  padding: 8px 12px;
  font-size: 0.75rem;
  border-radius: 8px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;  
  align-items: center;  
  justify-content: center; 
  gap: 5px;
}

.btn-primary:hover {
  background: #4a4a8c;
  transform: translateY(-2px);
}

.btn-submit {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 4px 10px rgba(52, 52, 104, 0.2);
}

.btn-submit:hover {
  background: #4a4a8c;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(52, 52, 104, 0.3);
}

.btn-submit-sms {
  background: transparent;
  color: #0ea5e9;
  border: 1px solid #0ea5e9;
  box-shadow: none;
}

.btn-submit-sms:hover {
  background: rgba(14, 165, 233, 0.1);
  transform: translateY(-2px);
  box-shadow: none;
}
.btn-reset {
	flex:1;
  background: transparent;
  color: #d38500;
  border: 1px solid #d38500;
  box-shadow: none;
  text-align:center;
}

.btn-reset:hover {
  background: rgba(255, 173, 0, 0.09);
  transform: translateY(-2px);
  box-shadow: none;
}
.btn-cancel {
  background: var(--bg-procedure);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.btn-cancel:hover {
  background: var(--color-border);
  color: var(--color-text-main);
  transform: translateY(-2px);
}

/* زر إضافة ملف جديد في صفحة الملفات */
.btn-add-file {
  background: rgba(71, 25, 216, 0.04);
  color: var(--color-primary);
  border: 1px solid var(--color-primary) !important;
  font-weight: 800;
  box-shadow: none !important;
}

.btn-add-file:hover {
  background: var(--color-primary);
  color: white;
}

.btn-group-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}




@media (max-width: 480px) {
  .files-search-filter-row {
    gap: 8px;
  }

  .files-table {
    font-size: 0.7rem;
  }

  .modal-report-content textarea,
  .modal-report-content .report-modal-message,
  .modal-report-content #manualReportSmartSummary {
    font-size: 11px !important;
  }

  #patientDetailsModal .btn-submit,
  #patientDetailsModal .btn-cancel {
    font-size: 0.66rem;
  }
}


@media (max-width: 380px) {
  .files-table {
    font-size: 0.66rem;
  }

  .modal-report-content textarea,
  .modal-report-content .report-modal-message,
  .modal-report-content #manualReportSmartSummary {
    font-size: 10px !important;
  }

  #patientDetailsModal .btn-submit,
  #patientDetailsModal .btn-cancel {
    font-size: 0.62rem;
  }
}


/* Patient details modal scaling on small screens */
@media (max-width: 480px) {
  #patientDetailsModal .modal-content {
    padding: 12px 12px 28px 12px;
    border-radius: 16px 16px 0 0;
  }

  #patientDetailsModal .modal-header-row h3 {
    font-size: 0.95rem;
  }

  #patientDetailsModal .pi-label,
  #patientDetailsModal .pi-val {
    font-size: 0.7rem;
  }

  #patientDetailsModal .btn-submit,
  #patientDetailsModal .btn-cancel {
    font-size: 0.6rem;
    padding: 7px 10px;
  }
}


@media (max-width: 380px) {
  #patientDetailsModal .modal-header-row h3 {
    font-size: 0.9rem;
  }

  #patientDetailsModal .pi-label,
  #patientDetailsModal .pi-val {
    font-size: 0.64rem;
  }

  #patientDetailsModal .btn-submit,
  #patientDetailsModal .btn-cancel {
    font-size: 0.66rem;
    padding: 6px 9px;
  }

  #patientDetailsModal .patient-modal-actions {
    gap: 8px;
  }

  #patientDetailsModal .btn-row {
    gap: 8px;
  }
}


/* ألوان أزرار الأكشن في المودال */
.btn-submit.btn-whatsapp {
  background: #25d366 !important;
}

.btn-submit,
.btn-cancel {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}


