﻿/* mainsystem-staging/wwwroot/css/site.css */

/* ========= 1) Base / Reset ========= */
html {
  box-sizing: border-box;
  font-size: 14px;
  position: relative;
  min-height: 100%;
}
*, *::before, *::after { box-sizing: inherit; }

@media (min-width: 768px) {
  html { font-size: 16px; }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem #258cfb;
}

body {
  margin-top: 0px;
  background: linear-gradient(0deg, #37429dab 0%, #020083c9 100%);
}

/* Preserve whitespace utility */
.preserve-lines { white-space: pre-wrap; }

/* ========= 2) Auth / Login ========= */
.auth-page {
  margin: 0;
  margin-bottom: 60px;
  background: linear-gradient(135deg, #1439ba2b 0%, #48c6ef1c 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  max-width: 900px;
  width: 100%;
  height: 600px;
  margin: 2rem auto;
  display: flex;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.1);
}
.login-image {
  flex: 1;
  background: url('/images/3726895.jpg') center/cover no-repeat;
}
.login-form {
  flex: 1;
  background: #fff;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-form .brand {
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: #333;
}
.login-form .form-floating > .form-control:focus ~ label,
.login-form .form-floating > .form-control:not(:placeholder-shown) ~ label {
  opacity: 1;
  transform: scale(.85) translateY(-0.5rem);
}
.login-form .btn-primary {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border-radius: 0.5rem;
}
.login-form .text-muted a {
  color: #48c6ef;
  text-decoration: none;
}
.login-form .text-muted a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .login-container {
    flex-direction: column-reverse;
    height: 800px;
    margin: 1rem auto;
  }
  .login-form { padding: 1rem; }
}

/* ========= 3) Navbar ========= */
.navbar {
  overflow: visible;
  padding-top: max(env(safe-area-inset-top, 0px), 6px);
  padding-bottom: 6px;
  min-height: 56px;
  transition: all 0.3s ease;
}
.navbar .navbar-brand {
  display: flex;
  align-items: center;
}
.navbar .nav-link {
  font-weight: 500;
  color: #444 !important;
  transition: .2s;
}
.navbar .nav-link:hover,
.navbar .nav-link.active { color: #007bff !important; }
.navbar .btn-outline-danger {
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.9rem;
}
.navbar-toggler { font-size: 2.25rem; }

.brand-logo {
  height: 56px;
  width: auto;
}
@media (max-width: 576px) {
  .brand-logo { height: 40px; }
}

@media (max-width: 767px) {
  .navbar-brand span { display: none; }
  .navbar-nav .nav-link { padding-left: 12px; }
  .navbar .btn-outline-danger {
    width: 100%;
    margin-top: 10px;
  }
  .navbar.shadow-sm { box-shadow: none !important; display: none; }
  .navbar-collapse {
    background: linear-gradient(135deg, #5faadf 0%, #b1b3b7 100%);

  }
}

/* Optional gradient helper */
.bg-white { background: #fff !important; }
.bg-gradient-white { background: linear-gradient(135deg, #5faadf 0%, #b1b3b7 100%); }


/* ========= 4) Hero / Cards / Tables ========= */
.dashboard-hero {
  background: linear-gradient(135deg, #48c6ef75 0%, #b1b3b7b8 100%);
  color: #fff;
  text-align: center;
  padding: 2rem 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
  margin-bottom: 1rem;
}

/* Quick actions as responsive grid */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  justify-content: center;
  margin: 1rem 0 2rem;
}
.action-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem 1rem;
  text-align: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
  transition: all .25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #333;
  text-decoration: none;
}
.action-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}
.action-card i { color: #007bff; margin-bottom: 10px; }
.action-card h3 {
  font-size: 1.5rem;
  margin-bottom: .3rem;
  font-weight: 700;
}
.action-card span { color: #6c757d; font-size: .9rem; }

@media (max-width: 576px) {
  .quick-actions { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .action-card { padding: 1rem; border-radius: 12px; }
  .action-card h3 { font-size: 1.2rem; }
  .action-card i { font-size: 1.5rem; }
}
@media (max-width: 400px) {
  .quick-actions { grid-template-columns: 1fr; }
}

/* Search bar */
.search-container .input-group {
  max-width: 400px; 
  margin: 0 auto;
  box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.05);
  border-radius: 0.5rem;
  overflow: hidden;
}
.search-container .input-group-text {
  background: #fff;
  border: none;
  font-size: 1.2rem;
  color: #888;
}
.search-container .form-control {
  border: none;
  padding: 0.75rem 1rem;
  font-size: 1rem;
}

/* Compact search variant */
.search-container .input-group .btn {
  border: none;
  background: #fff;
}
.search-container .input-group .btn:hover { background: #f0f8ff; }

/* Table wrapper */
.table-card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.08);
  padding: 1rem;
  margin-bottom: 2rem;
}
.table-card table { margin-bottom: 0; }
.table-card thead { background: #48c6ef; color: #333; }
.table-card tbody tr:hover { background: #f0f8ff; }

/* ========= 5) Form Card & Floating Labels ========= */
.form-card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.08);
  padding: 2rem;
  max-width: 600px;
  margin-bottom: 2rem;
}
@media (min-width: 768px) {
  .form-card { max-width: 800px; }
}
.form-card .form-floating > .form-control:focus ~ label,
.form-card .form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-card .form-floating > .form-select:focus ~ label,
.form-card .form-floating > .form-select:not([value=""]) ~ label {
  opacity: 1;
  transform: scale(.85) translateY(-0.5rem);
}
.form-card .form-floating .form-select {
  height: calc(3.5rem + 2px);
  padding: 1rem 0.75rem;
}
.form-card .btn {
  font-size: 1rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-left: 25%;
}

/* Filter + stats */
.filter-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.filter-card {
  flex: 2 1 300px;
  background: #fff;
  padding: 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.08);
  justify-items: center;
  align-content: center;
}
.stats-card {
  flex: 1 1 200px;
  background: #fff;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.08);
  text-align: center;
}
.stats-card h5 {
  margin-bottom: 0.5rem;
  color: #555;
}
.stats-card p { color: #333; }

/* ========= 6) Detail / Info Cards ========= */
.info-card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.08);
  padding: 1.5rem;
}
.info-card dl.row { margin: 0; }

.patient-info-card,
.combined-info-card,
.doctor-card {
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.08);
  overflow: hidden;
}
.patient-info-card .card-header,
.combined-info-card .card-header {
  background: linear-gradient(135deg, #48c6ef75 0%, #b1b3b7b8 100%);
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.patient-info-card .card-body { padding: 1.5rem; }

.doctor-card .card-header {
  background: #48c6ef;
  color: #fff;
  font-weight: 600;
}
.doctor-card .badge { font-size: 0.9rem; }
.doctor-card .patient-list {
  max-height: 220px;
  overflow-y: auto;
}
.doctor-card .patient-list::-webkit-scrollbar { width: 6px; }
.doctor-card .patient-list::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.2);
  border-radius: 3px;
}

/* ========= 7) Hero filter ========= */
.hero-filter {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.hero-filter .form-floating { width: auto; }
.hero-filter .form-floating > .form-control-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}
.hero-filter .btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}
.hero-filter .form-floating > .form-control-sm:focus ~ label,
.hero-filter .form-floating > .form-control-sm:not(:placeholder-shown) ~ label {
  opacity: 1;
  transform: scale(.85) translateY(-0.5rem);
}

/* ========= 8) Pagination ========= */
.pagination-wrapper {
  overflow-x: auto;
  padding: 0.5rem 0;
  margin-top: 1rem;
  font-size: 0.9rem;
}
.pagination {
  display: flex;
  flex-wrap: nowrap !important;
  gap: 0.5rem;
  justify-content: center;
  padding: 0;
  margin: 0;
}
.pagination .page-item .page-link {
  min-width: 2.5rem;
  text-align: center;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: none;
  background: #fff;
  box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.05);
  transition: background .2s, color .2s;
}
.pagination .page-link:hover,
.pagination .page-link:focus {
  background: rgba(72,198,239,0.1);
  color: #48c6ef;
}
.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, #48c6ef, #1439ba);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.1);
}
.pagination .page-item.disabled .page-link {
  color: #ccc;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

/* ========= 9) Tables mobile tweaks ========= */
@media (max-width: 768px) {
  .table-responsive { border: none; }
  table.table th, table.table td {
    font-size: 0.85rem;
    white-space: nowrap;
  }
  table.table td:nth-child(5),
  table.table td:nth-child(6),
  table.table td:nth-child(7),
  table.table td:nth-child(8),
  table.table th:nth-child(5),
  table.table th:nth-child(6),
  table.table th:nth-child(7),
  table.table th:nth-child(8) {
    display: none;
  }
}

/* ========= 10) Admin React full-bleed ========= */
.container {
  width: 100%;
  max-width: none !important;
  padding-left: 0px !important;
  padding-right: 0px !important;
}
.dashboard-hero {
  margin: 12px 12px 8px;
  border-radius: 12px;
}
#react-dashboard-root {
  display: block;
  margin: 0;
}
#react-dashboard-root .action-card {
  min-height: 112px;
  touch-action: manipulation;
}
/* ===== Quick Actions ===== */
#react-dashboard-root .quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 14px;
}

@media (max-width: 420px) {
  #react-dashboard-root .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#react-dashboard-root .qa-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  background: #ffffff;
  border-radius: 12px;
  padding: 12px 8px;
  box-shadow: 0 3px 8px rgba(16,24,40,.06);
  color: #111827;
  user-select: none;
  transition: transform .08s ease, box-shadow .12s ease, opacity .12s ease, background .12s ease;
  min-height: 86px;
}

#react-dashboard-root .qa-item i {
  font-size: 18px;
  opacity: .95;
}

#react-dashboard-root .qa-item span {
  font-size: 12px;
  font-weight: 600;
}

#react-dashboard-root .qa-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(16,24,40,.10);
}

#react-dashboard-root .qa-item:active {
  transform: translateY(0);
  opacity: .9;
}

/* ألوان رمزية لكل أكشن (اختياري) */
#react-dashboard-root .qa-item:nth-child(1) i { color: #0ea5e9; } /* Add Patient */
#react-dashboard-root .qa-item:nth-child(2) i { color: #22c55e; } /* New Lab */
#react-dashboard-root .qa-item:nth-child(3) i { color: #f59e0b; } /* Payment */
#react-dashboard-root .qa-item:nth-child(4) i { color: #7c3aed; } /* Export */

/* دارك مود */
@media (prefers-color-scheme: dark) {
  #react-dashboard-root .qa-item {
        background: #61616100;
        color: #e5e7eb;
        border: solid darkgoldenrod;
        box-shadow: 0 3px 6px rgba(16, 24, 40, 0.8);
  }
}

/* ========= 11) App/WebView minimal navbar ========= */
.is-app .navbar .navbar-collapse,
.is-app .navbar .nav-item,
.is-app .navbar .ms-auto { display: none !important; }

.is-app .navbar {
  background: transparent;
  box-shadow: none;
  padding-left: 8px;
  padding-right: 8px;
  padding-top: max(env(safe-area-inset-top, 0px), 6px);
  padding-bottom: 6px;
}
.is-app .brand-logo { height: 32px; width: auto; }
.is-app .navbar .navbar-toggler {
  font-size: 1.6rem;
  padding: 6px 10px;
  border: 0;
  outline: none;
  box-shadow: none !important;
}
.is-app .navbar .navbar-toggler i { line-height: 1; }
/* ===== Mobile Slim Header (Admin) ===== */
.mobile-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 30px 12px 10px 12px;
  margin: 0px 0px;
  border-radius: 0px;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(16,24,40,.06);
}

.mhb-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
  overflow: hidden;
}

.mhb-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.mhb-subtle {
  font-size: .85rem;
  color: #6b7280;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.mhb-actions {
  display: inline-flex;
  gap: 8px;
}

.mhb-btn {
  border-radius: 10px;
  padding: 6px 10px;
  box-shadow: 0 1px 2px rgba(16,24,40,.06);
}

@media (prefers-color-scheme: dark) {
  .mobile-header-bar {
    background: #281776;
    /* box-shadow: none; */
    position: sticky;
    top: 0;
    z-index: 1021;
  }
  .mhb-title { color: #e5e7eb; }
  .mhb-subtle { color: #9ca3af; }
  .mhb-btn { background: goldenrod; color: #e5e7eb; }
}

/* لو جسم الصفحة فول-بليد للأدمن، خليه متناسق */
.admin-react .mobile-header-bar { margin: 0px 0px; }

.is-app .offcanvas {
  width: min(86vw, 360px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.is-app .offcanvas .nav-link {
  font-size: 1.05rem;
  padding: 10px 8px;
}
.is-app .offcanvas .btn { padding: 10px 12px; }

body.is-app {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ========= 12) Print ========= */
@media print {
  .d-print-none, .bg-light, .mb-3 { display: none !important; }
  body { margin: 0; }
  .table { width: 100%; }
}


/* ===== Mobile Bottom Nav (App only) ===== */
.mbottom-nav {
  position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #242e6457;
    border-top: 3px solid darkslategrey;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    z-index: 1030;
    gap: 2px;
}
.mbottom-nav .mb-item {
  display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0px;
    height: 56px;
    font-size: 11px;
    color: #d4d4d4;
    text-decoration: none;
    border: ((1px 2px 2px 3px) solid);
    border: 2px solid;
    border-top: 1px solid;
    border-radius: 12px;
    background: #242e6457;
}
.mbottom-nav .mb-item i { font-size: 18px; }
.mbottom-nav .mb-item.active { color: #0ea5e9; } /* sky-500 */
.mbottom-nav .mb-item.more { color: #64748b; } /* slate-500 */

/* Body padding so content not hidden behind nav */
.is-app body, body.is-app {
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
}

/* ===== Floating Action Button ===== */
.fab {
  position: fixed;
  right: 16px;
  bottom: calc(56px + 16px + env(safe-area-inset-bottom, 0px));
  width: 56px; height: 56px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a); /* أخضر لطيف */
  color: #fff;
  box-shadow: 0 8px 20px rgba(22, 163, 74, .35);
  display: inline-flex; align-items: center; justify-content: center;
  z-index: 1031;
}
.fab i { font-size: 22px; }
.fab:active { transform: scale(0.98); }

/* ===== Safe top inset (بدون Navbar على الموبايل) ===== */
.is-app .mobile-header-bar {
  padding-top: max(env(safe-area-inset-top, 0px), 6px);
}


.patients-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.6);
  z-index: 10;
}

.patients-loading .spinner-border {
  width: 3rem;
  height: 3rem;
}


.active-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  font-size: 0.8rem;
}

.filter-chip .chip-label {
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 0.65rem;
  color: #6b7280;
}

.filter-chip .chip-value {
  font-weight: 600;
  color: #111827;
}

.filter-chip .chip-remove {
  border: none;
  background: transparent;
  padding: 0;
  margin-left: 0.1rem;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  color: #9ca3af;
}

.filter-chip .chip-remove:hover {
  color: #ef4444;
}





/* ===== Side panel ===== */
.patients-sidepanel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 1040;
}

.patients-sidepanel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 100%);
  background: #ffffff;
  box-shadow: -24px 0 60px rgba(15, 23, 42, 0.35);
  z-index: 1050;
  display: flex;
  flex-direction: column;
}

.psp-header {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.psp-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.psp-subtitle {
  font-size: 0.75rem;
  color: #9ca3af;
}

.psp-close-btn {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
}

.psp-close-btn:hover {
  color: #ef4444;
}

.psp-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem 1rem;
}

.psp-loading {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Patient panel inside side panel ===== */
.patient-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.patient-panel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.patient-avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1d4ed8, #22c55e);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

.patient-header-meta {
  flex: 1;
}

.patient-name {
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
}

.patient-age-line {
  font-size: 0.8rem;
  color: #6b7280;
}

.patient-tags {
  margin-top: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tag-chip {
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #0f172a;
}

.tag-blood {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.tag-donor {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.tag-chronic {
  border-color: #fecaca;
  background: #fef2f2;
}

/* sections */
.patient-panel-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pp-section {
  padding: 0.55rem 0;
  border-top: 1px solid #e5e7eb;
}

.pp-section:first-of-type {
  border-top: none;
}

.pp-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.pp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
}

.pp-field-label {
  font-size: 0.75rem;
  color: #9ca3af;
}

.pp-field-value {
  font-size: 0.85rem;
  color: #111827;
}

@media (min-width: 600px) {
  .pp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


.data-table thead {
  background: linear-gradient(135deg,#eff6ff,#f9fafb);
  border-bottom: 1px solid #e5e7eb;
}

.data-table thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}

.data-table tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

.data-table tbody tr:hover {
  background-color: #e0f2fe;
}
