.user-portal {
  background:
    radial-gradient(circle at 95% 5%, #dff2e9, transparent 28%), #f3f8f5;
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 275px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  max-height: 100vh;
  background: linear-gradient(180deg, #064e3b, #043b30);
  padding: 28px 18px;
  color: #fff;
  z-index: 1040;
  overflow-y: auto;
}
.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  padding: 4px 10px 28px;
  font:
    700 1.15rem "Playfair Display",
    serif;
}
.portal-brand:hover {
  color: #fff;
}
.portal-brand img {
  width: 45px;
  height: 45px;
  background: #fff;
  border-radius: 14px;
  padding: 4px;
}
.portal-brand span {
  display: grid;
}
.portal-brand small {
  font:
    500 0.72rem "DM Sans",
    sans-serif;
  color: #a7d5c5;
  margin-top: 4px;
}
.sidebar-nav {
  display: grid;
  gap: 5px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #cce5db;
  border-radius: 13px;
  padding: 12px 14px;
  font-weight: 600;
}
.sidebar-link i {
  font-size: 1.05rem;
}
.sidebar-link:hover,
.sidebar-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
.sidebar-link.active {
  box-shadow: inset 3px 0 #69dcad;
}
.sidebar-label {
  padding: 24px 14px 8px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.65rem;
  font-weight: 800;
  color: #87b6a7;
}
.app-main {
  min-width: 0;
}
.topbar {
  height: 94px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid #dce9e3;
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.menu-button {
  display: none;
}
.topbar-title {
  display: grid;
}
.topbar-title small,
.topbar-user small {
  color: #71857d;
}
.topbar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 13px;
}
.topbar-user > div {
  display: grid;
  text-align: right;
}
.topbar-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0aa876, #7ddbaf);
  color: #fff;
  font-weight: 800;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #d8e6e0;
  border-radius: 12px;
  color: #285448;
  background: #fff;
}
.page-content {
  padding: 36px;
  max-width: 1600px;
  margin: 0 auto;
}
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  padding: 28px 30px;
  border-left: 4px solid #079669;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 22px;
  box-shadow: 0 15px 42px rgba(7, 91, 71, 0.07);
}
.page-heading h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0;
}
.page-heading p {
  color: #71857d;
  margin: 6px 0 0;
}
.content-card {
  padding: 30px;
}
.support-card {
  height: 100%;
  padding: 35px;
  background: linear-gradient(145deg, #075b47, #08785b);
  color: #e4f3ed;
}
.support-card h2 {
  color: #fff;
}
.support-card > i {
  color: #83e0ba;
}
.portal-header {
  padding: 35px 0 20px;
  background: transparent;
}
.portal-header > .container {
  max-width: none;
  padding: 0;
}
.portal-header h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
}
.portal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.portal-links a {
  background: #fff;
  border: 1px solid #d9e8e1;
  border-radius: 12px;
  color: #075b47;
  font-weight: 700;
  padding: 10px 15px;
}
.schedule-item,
.appointment-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 17px 0;
  border-bottom: 1px solid #d9e8e1;
}
.schedule-item > div,
.appointment-card > div {
  display: grid;
  flex: 1;
}
.schedule-item small,
.appointment-card small {
  color: #71857d;
}
.list-avatar,
.avatar-placeholder {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 50%;
  background: #e1f3eb;
  color: #079669;
  font-weight: 800;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 7px 11px;
  border-radius: 999px;
  background: #e5f5ee;
  color: #087559;
  font-size: 0.78rem;
  font-weight: 800;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.filter-bar a {
  padding: 10px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #d9e8e1;
  color: #42655b;
  font-weight: 700;
}
.filter-bar a.active,
.filter-bar a:hover {
  background: #079669;
  border-color: #079669;
  color: #fff;
}
.patient-summary {
  display: flex;
  gap: 20px;
  align-items: center;
  background: linear-gradient(135deg, #075b47, #0c795d);
  color: #fff;
  border-radius: 24px;
  padding: 24px;
}
.patient-summary h2 {
  color: #fff;
}
.patient-summary img {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  object-fit: cover;
}
.history-item {
  border-bottom: 1px solid #d9e8e1;
  padding: 12px 0;
}
.history-item summary {
  font-weight: 700;
  cursor: pointer;
}
.profile-preview {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #e9f7f1;
}
.empty-state {
  text-align: center;
  padding: 55px 20px;
  color: #71857d;
}
.empty-state i {
  font-size: 2.6rem;
  color: #079669;
}
.empty-state h2 {
  font-size: 1.4rem;
  margin-top: 14px;
}
.preserve-lines {
  white-space: pre-wrap;
}
.document-page {
  padding-top: 20px;
}
.medical-document {
  max-width: 850px;
  margin: auto;
  background: #fff;
  padding: 60px;
  border: 1px solid #ddd;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
  color: #222;
}
.medical-document header {
  display: flex;
  align-items: center;
  gap: 20px;
}
.medical-document header img {
  width: 74px;
}
.prescription-item {
  padding: 18px 0;
  border-bottom: 1px solid #ddd;
}
.signature-line {
  margin: 100px auto 0;
  border-top: 1px solid #333;
  max-width: 330px;
  text-align: center;
  padding-top: 8px;
}
.sidebar-backdrop {
  display: none;
}
@media (max-width: 991px) {
  body.user-portal {
    overflow-x: hidden;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: -290px;
    width: 275px;
    transition: 0.25s;
  }
  .sidebar.open {
    left: 0;
  }
  .menu-button {
    display: inline-grid;
    place-items: center;
  }
  .sidebar-backdrop.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(3, 37, 29, 0.45);
    z-index: 1030;
  }
  .page-content {
    padding: 24px;
  }
  .topbar {
    padding: 0 20px;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 650px) {
  .page-content {
    padding: 16px;
  }
  .topbar-user > div {
    display: none;
  }
  .schedule-item,
  .appointment-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .medical-document {
    padding: 28px;
  }
  .patient-summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .page-heading {
    padding: 22px;
  }
  .portal-alert {
    margin: 12px 16px 0;
  }
}
@media print {
  .sidebar,
  .topbar,
  .d-print-none {
    display: none !important;
  }
  .app-shell {
    display: block;
  }
  .page-content {
    padding: 0;
  }
  .medical-document {
    box-shadow: none;
    border: 0;
    padding: 0;
  }
}
