:root {
  --primary-navy: #0f172a;
  --accent-blue: #0d6efd;
  --accent-red: #e53935;
  --bg-light: #f3f6f9;
  --sidebar-width: 275px;
  --sidebar-collapsed-width: 72px;
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-light);
  color: #0f172a;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  text-decoration: none;
}

.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 12%, rgba(14, 165, 233, 0.16), transparent 24%),
    linear-gradient(135deg, #eff6ff 0%, #f8fafc 44%, #eef2ff 100%);
}

.auth-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.auth-card,
.register-panel {
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
  max-width: 440px;
  padding: 2rem;
  width: 100%;
}

.auth-card-wide {
  max-width: 860px;
}

.register-panel {
  max-width: 1080px;
  padding: 0;
  overflow: hidden;
}

.register-side {
  background: radial-gradient(circle at top, #0f5ea8 0, #0b1021 60%, #02040a 100%);
  color: white;
  padding: 3rem;
}

.register-side h1,
.public-home h1 {
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 800;
}

.register-side p {
  color: #dbeafe;
}

.register-feature {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.auth-logo {
  height: 68px;
  object-fit: contain;
  width: auto;
}

.public-home {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
  max-width: 1160px;
  padding: 2rem;
  width: 100%;
}

.public-logo {
  height: 56px;
}

.public-stats {
  display: grid;
  gap: 1rem;
}

.public-stats div,
.module-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
}

.public-stats strong,
.module-card strong {
  display: block;
  font-size: 1.1rem;
}

.public-stats span,
.module-card span {
  color: #64748b;
  display: block;
}

.layout-root {
  display: flex;
  min-height: 100vh;
}

.image-background {
  background-image: url("../images/doctor-sign-new1.png");
  background-repeat: no-repeat;
  background-size: 250px;
  background-position: right 2rem bottom 8%;
  background-attachment: fixed;
}

.main-content {
  background: radial-gradient(circle at top left, #e0f2fe 0, #f5f7fb 40%, #eef2ff 100%);
  display: flex;
  flex: 1;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  overflow: hidden;
  padding-top: 56px;
  transition: margin-left 0.25s ease;
}

body.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

.content-inner {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.main-topbar {
  height: 56px;
  left: var(--sidebar-width);
  transition: left 0.25s ease;
  z-index: 1020;
}

body.sidebar-collapsed .main-topbar {
  left: var(--sidebar-collapsed-width);
}

.sidebar {
  background: rgba(2, 6, 23, 0.92);
  bottom: 0;
  color: #e5e7eb;
  left: 0;
  overflow-y: auto;
  padding: 0.5rem 1rem 1.25rem;
  position: fixed;
  top: 0;
  transition: width 0.25s ease, transform 0.25s ease;
  width: var(--sidebar-width);
  z-index: 1030;
}

body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  align-items: center;
  border-bottom: 1px solid #1e293b;
  display: flex;
  height: 56px;
  justify-content: center;
  margin-bottom: 1rem;
}

.sidebar-logo-wide {
  max-height: 46px;
  max-width: 200px;
  object-fit: contain;
}

.sidebar-logo-small {
  display: none;
  height: 42px;
  object-fit: contain;
  width: 42px;
}

body.sidebar-collapsed .sidebar-logo-wide {
  display: none;
}

body.sidebar-collapsed .sidebar-logo-small {
  display: inline-block;
}

.sidebar-link,
.sidebar-sublink {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #cbd5e1;
  display: flex;
  font-size: 0.92rem;
  font-weight: 600;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  padding: 0.65rem 0.9rem;
  text-align: left;
  transition: all 0.18s ease;
  width: 100%;
}

.sidebar-sublink {
  border-radius: 6px;
  color: #94a3b8;
  font-size: 0.88rem;
  padding: 0.55rem 1.6rem;
}

.sidebar-link.active,
.sidebar-link:hover,
.sidebar-sublink.active,
.sidebar-sublink:hover {
  background: #0f172a;
  color: #fff;
}

.sidebar-group-toggle {
  background: #1e293b;
  color: #e2e8f0;
}

.sidebar i {
  flex: 0 0 auto;
  font-size: 1.1rem;
}

body.sidebar-collapsed .sidebar .link-text,
body.sidebar-collapsed .sidebar .group-arrow,
body.sidebar-collapsed .sidebar .collapse {
  display: none !important;
}

body.sidebar-collapsed .sidebar-link,
body.sidebar-collapsed .sidebar-sublink {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.topbar-left,
.topbar-actions {
  align-items: center;
  display: flex;
  min-width: 0;
}

.topbar-left {
  flex: 1 1 auto;
  gap: 0.9rem;
}

.topbar-actions {
  gap: 0.75rem;
}

.topbar-icon-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #050b1d;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  padding: 0;
  width: 36px;
}

.topbar-icon-button:hover {
  background: #f1f5f9;
}

.topbar-brand {
  align-items: center;
  display: inline-flex;
  font-weight: 800;
  gap: 0.65rem;
  min-width: 0;
}

.topbar-hospital-logo {
  height: 34px;
  object-fit: contain;
  width: 34px;
}

.topbar-hospital-name,
.topbar-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-hospital-name {
  color: #0f172a;
  font-size: 1rem;
}

.topbar-action {
  align-items: center;
  background: #f8fbff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  color: #1d4ed8;
  display: inline-flex;
  font-weight: 700;
  gap: 0.5rem;
  justify-content: center;
  min-height: 38px;
  padding: 0.35rem 0.8rem;
}

.topbar-action--icon {
  background: #152b4f;
  border-color: #152b4f;
  color: #fff;
  height: 42px;
  padding: 0;
  width: 42px;
}

.topbar-user-toggle {
  align-items: center !important;
  background: #fff !important;
  border: 1px solid #d9e2ef !important;
  border-radius: 6px !important;
  color: #111827 !important;
  display: inline-flex !important;
  gap: 0.5rem;
  min-height: 42px;
  max-width: 280px;
  padding: 0.45rem 0.7rem !important;
}

.topbar-user-avatar {
  color: #111827;
}

.topbar-user-name {
  color: #111827;
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar-profile-menu {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
  min-width: 216px;
  padding: 0.4rem;
}

.topbar-profile-menu .dropdown-item {
  align-items: center;
  border-radius: 6px;
  display: flex;
  gap: 0.65rem;
  padding: 0.7rem 0.75rem;
}

.trial-warning-banner {
  animation: trial-warning-flash 1s ease-in-out infinite alternate;
  background: #b91c1c;
  color: #fff;
  font-weight: 700;
  padding: 0.65rem 1rem;
  text-align: center;
}

@keyframes trial-warning-flash {
  from { opacity: 1; }
  to { opacity: 0.58; }
}

.page-header {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.page-header h1 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0;
}

.page-header p {
  color: #64748b;
  margin: 0.25rem 0 0;
}

.glass-card,
.dashboard-card,
.card {
  border: 0;
  border-radius: 8px;
  box-shadow:
    rgba(50, 50, 93, 0.2) 0 22px 44px -20px,
    rgba(0, 0, 0, 0.22) 0 20px 38px -30px,
    rgba(10, 37, 64, 0.25) 0 -2px 6px 0 inset;
}

.dashboard-card {
  background: linear-gradient(145deg, #ffffff, #e5edff);
  overflow: hidden;
  position: relative;
}

.dashboard-card::before {
  background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.25), transparent 55%);
  content: "";
  inset: 0;
  opacity: 0.7;
  pointer-events: none;
  position: absolute;
}

.dashboard-card-body,
.dashboard-card .card-body {
  position: relative;
  z-index: 1;
}

.dashboard-card-title {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.dashboard-card-value {
  color: #0f172a;
  font-size: 1.8rem;
  font-weight: 800;
}

.dashboard-card-meta {
  color: #64748b;
  font-size: 0.8rem;
}

.birthday-banner {
  background: linear-gradient(135deg, #fff8e7 0%, #ffe4ec 48%, #fff1bf 100%);
  box-shadow: 0 22px 50px rgba(180, 83, 9, 0.16);
}

.birthday-banner-eyebrow {
  color: #c2410c;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.birthday-banner-title {
  color: #7c2d12;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
}

.birthday-banner-copy {
  color: #7c2d12;
}

.clinic-table-wrapper {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  overflow-x: auto;
}

.clinic-table {
  font-size: 0.88rem;
  margin-bottom: 0;
}

.clinic-table thead {
  background: #f1f5f9;
}

.clinic-table thead th {
  border-bottom: 1px solid #e2e8f0;
  color: #475569;
  font-weight: 700;
}

.clinic-table td,
.clinic-table th {
  vertical-align: middle;
}

.clinic-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

.clinic-table tbody tr:hover {
  background: #e0f2fe;
}

.table-actions {
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  border: 0;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #1d4ed8, #0284c7);
}

.btn-secondary {
  background: #e5e7eb;
  border-color: #d1d5db;
  color: #111827;
}

.today-visits__fee-chip {
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.35rem 0.75rem;
}

.medicine-row {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
}

.module-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.module-card {
  color: #0f172a;
  display: block;
  min-height: 130px;
}

.module-card i {
  color: #2563eb;
  display: block;
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
}

.profile-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(240px, 320px) 1fr;
}

.profile-photo {
  border-radius: 8px;
  height: 160px;
  object-fit: cover;
  width: 160px;
}

.profile-icon {
  color: #64748b;
  font-size: 7rem;
}

.weekday-grid,
.feature-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.permission-table th,
.permission-table td {
  min-width: 110px;
}

.receipt-card {
  max-width: 720px;
}

.print-card {
  background: #fff;
}

.setup-error {
  background: #0f172a;
  border-radius: 8px;
  color: #f8fafc;
  max-height: 220px;
  overflow: auto;
  padding: 1rem;
}

.setup-summary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
}

@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
    width: min(88vw, 320px);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-collapsed .sidebar {
    width: min(88vw, 320px);
  }

  body.sidebar-collapsed .sidebar .link-text,
  body.sidebar-collapsed .sidebar .group-arrow,
  body.sidebar-collapsed .sidebar .collapse {
    display: inline-flex !important;
  }

  body.sidebar-collapsed .sidebar .collapse {
    display: block !important;
  }

  body.sidebar-collapsed .sidebar-link,
  body.sidebar-collapsed .sidebar-sublink {
    justify-content: flex-start;
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .main-content,
  body.sidebar-collapsed .main-content {
    margin-left: 0;
  }

  .main-topbar,
  body.sidebar-collapsed .main-topbar {
    left: 0;
  }

  .topbar-actions {
    display: none;
  }

  .content-inner {
    padding: 1rem;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .sidebar,
  .main-topbar,
  .page-header,
  .no-print,
  .alert {
    display: none !important;
  }

  .main-content {
    background: #fff;
    margin: 0 !important;
    padding: 0 !important;
  }

  .content-inner {
    padding: 0;
  }

  .card {
    box-shadow: none !important;
  }
}
