:root {
  --sidebar-width: 280px;
  --sidebar-mini-width: 84px;
  --admin-bg: #f5f7fb;
  --admin-surface: #ffffff;
  --admin-surface-soft: #f8fafc;
  --admin-border: #dbe4ef;
  --admin-text: #1f2937;
  --admin-muted: #6b7280;
  --admin-primary: #2563eb;
  --admin-primary-dark: #1d4ed8;
  --admin-success: #0f766e;
  --admin-warning: #d97706;
  --admin-danger: #dc2626;
  --admin-pink: #db2777;
  --admin-sidebar: #111827;
  --admin-sidebar-soft: #1f2937;
  --admin-shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.06);
  --admin-shadow: 0 18px 46px rgba(15, 23, 42, 0.09);
  --admin-shadow-lg: 0 26px 70px rgba(15, 23, 42, 0.12);
  --admin-ring: 0 0 0 4px rgba(37, 99, 235, 0.12);
  --admin-card-shadow: 0 7px 20px rgba(15, 23, 42, 0.18);
  --notification-unread-bg: rgba(37, 99, 235, 0.07);
  --notification-unread-bg-strong: rgba(37, 99, 235, 0.17);

  --tl-primary: #5b6ef0;
  --tl-primary-ink: #4553e2;
  --tl-plan: #fbbf24;
  --tl-plan-ink: #a16207;
  --tl-free: #87f409;
  --tl-free-ink: #4f8f05;
  --tl-free-bg: #f4fde9;
  --tl-mint: #14bd9a;
  --tl-mint-ink: #0c9179;
  --tl-rose: #ff0000;
  --tl-rose-ink: #d60000;
  --tl-rose-bg: #fff4f4;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, #f8fbff 0%, var(--admin-bg) 42%, #eef4fa 100%);
  color: var(--admin-text);
  font-family: "Segoe UI", Arial, sans-serif;
}

a {
  text-decoration: none;
}

.admin-shell {
  min-height: 100vh;
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  background: var(--admin-sidebar);
  color: #ffffff;
  box-shadow: 18px 0 42px rgba(15, 23, 42, 0.18);
  transform: translateX(0);
  transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar-header {
  padding: 1.35rem 1.25rem 1.15rem;
  margin-inline: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  color: #ffffff;
}

.brand-mark:hover,
.brand-mark:focus {
  color: #ffffff;
}

.brand-icon,
.profile-avatar,
.metric-icon,
.nav-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  font-weight: 800;
}

.brand-icon {
  width: 42px;
  height: 42px;
  padding: 3px;
  overflow: hidden;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.08);
}

.brand-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-wordmark {
  display: block;
  width: auto;
  height: 24px;
  margin-bottom: 4px;
}

.auth-brand .brand-wordmark {
  height: 30px;
}

.brand-wordmark-dark,
html[data-theme="dark"] .brand-wordmark-light {
  display: none;
}

html[data-theme="dark"] .brand-wordmark-dark {
  display: block;
}

.brand-copy,
.brand-title,
.brand-subtitle,
.nav-text,
.sidebar-footer-text {
  min-width: 0;
  transition: opacity 0.16s ease, width 0.16s ease;
}

.brand-title,
.brand-subtitle {
  display: block;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
}

.brand-subtitle {
  color: #9ca3af;
  font-size: 0.78rem;
}

.sidebar-nav {
  display: grid;
  gap: 0.45rem;
  padding: 1.1rem 1rem;
}

.sidebar-nav .nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.78rem 0.9rem;
  border-radius: 8px;
  color: #d1d5db;
  font-weight: 700;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
  white-space: nowrap;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link:focus,
.sidebar-nav .nav-link.active {
  background: var(--admin-sidebar-soft);
  color: #ffffff;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link:focus {
  transform: translateX(2px);
}

.sidebar-nav .nav-link::after {
  content: "";
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--admin-primary);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

.sidebar-nav .nav-link.active::after {
  animation: navLinkActiveLine 0.45s ease forwards;
}

@keyframes navLinkActiveLine {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

.nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #bfdbfe;
  font-size: 0.76rem;
}

.sidebar-clinic-badge {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: auto 1rem 0;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  background: var(--admin-sidebar-soft);
  border: 1px solid var(--admin-sidebar-border);
}
.sidebar-clinic-badge + .sidebar-footer {
  margin-top: 0.75rem;
}

.sidebar-clinic-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2563eb, #0f766e);
  color: #ffffff;
  font-size: 0.86rem;
}

.sidebar-clinic-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.sidebar-clinic-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--admin-sidebar-muted);
  line-height: 1;
}

.sidebar-clinic-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-width: 0;
  white-space: normal;
  word-break: break-word;
  line-height: 1.2;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--admin-sidebar-text-strong);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: auto;
  margin-inline: 1.25rem;
  padding: 1rem 0;
  color: #d1d5db;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  white-space: nowrap;
}

.sidebar-user {
  margin: auto 1rem 1rem;
  padding: 0.85rem;
  display: grid;
  justify-items: center;
  gap: 0.22rem;
  border: 1px solid var(--admin-sidebar-border);
  border-radius: 8px;
  background: var(--admin-sidebar-soft);
  text-align: center;
}

.sidebar-user-avatar {
  border: 3px solid #53e9b9;
}

.sidebar-user strong {
  color: var(--admin-sidebar-text-strong);
  font-size: 1rem;
  line-height: 1.1;
}

.sidebar-user small {
  color: var(--admin-sidebar-muted);
  font-size: 0.84rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.status-dot {
  flex: 0 0 auto;
  background: #22c55e;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1030;
  display: none;
  background: rgba(15, 23, 42, 0.5);
}

.admin-main {
  width: auto;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.2s ease;
}

.admin-navbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  min-height: 72px;
  border-bottom: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow-sm);
}

.admin-navbar.bg-white {
  background-color: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(14px);
}

.sidebar-toggle {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus {
  border-color: #bfdbfe;
  background: #f8fbff;
  box-shadow: var(--admin-ring);
}

.sidebar-toggle span {
  width: 18px;
  height: 2px;
  display: block;
  background: var(--admin-text);
  border-radius: 999px;
}

.search-input {
  max-width: 520px;
  border-color: var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface-soft);
  min-height: 42px;
  box-shadow: none;
}

.search-input:focus {
  border-color: #93c5fd;
  box-shadow: var(--admin-ring);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-button,
.profile-button {
  border: 1px solid var(--admin-border);
  background: #ffffff;
  color: var(--admin-text);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.icon-button:hover,
.icon-button:focus,
.profile-button:hover,
.profile-button:focus {
  border-color: #bfdbfe;
  box-shadow: var(--admin-ring);
}

.icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  font-weight: 800;
}

.notification-dot {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--admin-danger);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--admin-surface, #ffffff);
}

.notification-menu {
  width: min(320px, calc(100vw - 2rem));
  max-height: min(420px, calc(100vh - 90px));
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  box-shadow: var(--admin-shadow);
}

.notification-menu .dropdown-header {
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 1;
}

.notification-menu .dropdown-item {
  display: grid;
  gap: 0.2rem;
  padding-block: 0.7rem;
  white-space: normal;
  overflow-wrap: break-word;
}

.notification-menu .dropdown-item.notification-unread {
  position: relative;
  animation: notificationUnreadPulse 2.2s ease-in-out infinite;
}

.notification-menu .dropdown-item.notification-unread:hover,
.notification-menu .dropdown-item.notification-unread:focus {
  animation-play-state: paused;
}

@keyframes notificationUnreadPulse {
  0%,
  100% {
    background-color: var(--notification-unread-bg);
  }

  50% {
    background-color: var(--notification-unread-bg-strong);
  }
}

.global-search-menu {
  top: 100%;
  left: 0;
  margin-top: 0.125rem;
  width: min(440px, calc(100vw - 2rem));
  max-height: min(420px, calc(100vh - 90px));
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  box-shadow: var(--admin-shadow);
}

.global-search-menu .dropdown-header {
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 1;
}

.global-search-menu .dropdown-item {
  display: grid;
  gap: 0.15rem;
  padding-block: 0.6rem;
  white-space: normal;
  overflow-wrap: break-word;
}

.global-search-item-title {
  font-weight: 700;
}

.global-search-item.active {
  background-color: var(--admin-surface-soft);
  color: var(--admin-text);
}

.notification-title {
  font-weight: 700;
}

.notification-time {
  color: var(--admin-muted);
  font-size: 0.82rem;
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 42px;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-weight: 700;
}

.profile-name-group {
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  text-align: left;
}

.profile-name {
  font-weight: 700;
}

.profile-subname {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--admin-muted);
}

.profile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #e0ecff;
  color: var(--admin-primary-dark);
  font-size: 0.76rem;
}

.avatar-img {
  display: block;
  flex: 0 0 auto;
  object-fit: cover;
  object-position: center;
}

.avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.avatar-md {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.avatar-xl {
  width: 78px;
  height: 78px;
  border-radius: 50%;
}

.avatar-xxl {
  width: 120px;
  height: 120px;
  border-radius: 50%;
}

.profile-button .avatar-sm {
  border: 2px solid #52e7b8;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] .profile-button .avatar-sm {
  border-color: #54f0be;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.dashboard-content {
  flex: 1 0 auto;
  min-height: calc(100vh - 144px);
}

.dashboard-content > .container-fluid {
  padding-top: 1.75rem !important;
  padding-bottom: 1.75rem !important;
}

.page-heading,
.panel-header,
.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-heading {
  margin-bottom: 1.35rem;
}

.page-heading h1 {
  font-weight: 800;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--admin-primary);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}

.btn {
  border-radius: 8px;
  font-weight: 700;
  box-shadow: var(--admin-card-shadow);
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.btn:hover,
.btn:focus{
  box-shadow: var(--admin-card-shadow);
  transform: translateY(-2px);
}

.btn-primary {
  border-color: var(--admin-primary);
  background: var(--admin-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: var(--admin-primary-dark);
  background: var(--admin-primary-dark);
}

.btn-outline-primary {
  --bs-btn-color: var(--admin-primary);
  --bs-btn-border-color: var(--admin-primary);
  --bs-btn-hover-bg: var(--admin-primary);
  --bs-btn-hover-border-color: var(--admin-primary);
  --bs-btn-active-bg: var(--admin-primary-dark);
  --bs-btn-active-border-color: var(--admin-primary-dark);
  color: var(--admin-primary);
  border-color: var(--admin-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus-visible,
.btn-outline-primary:active,
.btn-outline-primary.active {
  color: #fff;
  background-color: var(--admin-primary);
  border-color: var(--admin-primary);
}

.metric-card,
.panel {
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface);
  box-shadow: var(--admin-shadow);
}

.metric-card {
  position: relative;
  min-height: 164px;
  padding: 1.35rem;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--metric-color, var(--admin-primary));
}

.metric-card:hover {
  border-color: #c6d5e8;
  box-shadow: var(--admin-shadow-lg);
  transform: translateY(-3px);
}

.metric-primary {
  --metric-color: var(--admin-primary);
}

.metric-success {
  --metric-color: var(--admin-success);
}

.metric-warning {
  --metric-color: var(--admin-warning);
}

.metric-danger {
  --metric-color: var(--admin-danger);
}

.metric-label {
  color: var(--admin-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #eaf2ff;
  color: var(--metric-color, var(--admin-primary));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.metric-success .metric-icon {
  background: #e7f6f3;
}

.metric-warning .metric-icon {
  background: #fff4df;
}

.metric-danger .metric-icon {
  background: #ffecec;
}

.metric-value {
  margin-top: 1rem;
  color: var(--admin-text);
  font-size: 2.18rem;
  font-weight: 800;
  line-height: 1;
}

.metric-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.9rem;
  color: var(--admin-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.panel {
  padding: 1.35rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.panel:hover {
  border-color: #c6d5e8;
  box-shadow: var(--admin-shadow-lg);
}

.panel-header {
  margin-bottom: 1.25rem;
}

.panel-header p {
  font-size: 0.92rem;
}

.panel-header .form-select,
.panel-header .input-group,
.panel-toolbar .form-select,
.panel-toolbar .input-group {
  box-shadow: var(--admin-card-shadow);
}

.panel-header .form-select:focus,
.panel-toolbar .form-select:focus {
  box-shadow: var(--admin-ring), var(--admin-card-shadow);
}

.chart-bars {
  height: 292px;
  display: grid;
  grid-template-columns: repeat(6, minmax(38px, 1fr));
  align-items: end;
  gap: 1rem;
  padding: 1.2rem 0.4rem 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.chart-column {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 0.6rem;
  color: var(--admin-muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
}

.chart-column span {
  width: 100%;
  height: var(--bar-size);
  min-height: 28px;
  display: block;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--admin-primary), var(--admin-success));
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.bar-42 {
  --bar-size: 42%;
}

.bar-58 {
  --bar-size: 58%;
}

.bar-51 {
  --bar-size: 51%;
}

.bar-72 {
  --bar-size: 72%;
}

.bar-66 {
  --bar-size: 66%;
}

.bar-83 {
  --bar-size: 83%;
}

.activity-list {
  display: grid;
  gap: 1.1rem;
}

.activity-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--admin-border);
}

.activity-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.activity-dot {
  width: 12px;
  height: 12px;
  margin-top: 0.45rem;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.08);
}

.table {
  --bs-table-bg: transparent;
}

.table thead th {
  color: var(--admin-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.table tbody td {
  min-width: 120px;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.table tbody tr {
  transition: background 0.16s ease;
}

.table tbody tr:hover {
  background: #f8fbff;
}

.badge {
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
}

.text-bg-success {
  background-color: #dcfce7 !important;
  color: #15803d !important;
}

.text-bg-danger {
  background-color: #fee2e2 !important;
  color: #b91c1c !important;
}

.text-bg-warning {
  background-color: #fef3c7 !important;
  color: #b45309 !important;
}

.text-bg-info {
  background-color: #fce7f3 !important;
  color: #be185d !important;
}

.text-bg-secondary {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
}

.table-search {
  width: min(260px, 100%);
  border-color: var(--admin-border);
  border-radius: 8px;
}

.table-media {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.product-thumb {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid var(--admin-border);
}

.profile-avatar-lg {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  font-size: 1.5rem;
}

.profile-hero {
  display: grid;
  justify-items: center;
}

.profile-card {
  overflow: hidden;
}

.profile-cover {
  margin: -1.35rem -1.35rem 0.9rem;
  height: 96px;
  border-bottom: 1px solid var(--admin-border);
}

.profile-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.profile-photo {
  margin-top: -44px;
  border: 4px solid var(--admin-surface);
  box-shadow: var(--admin-shadow-sm);
}

.info-list,
.settings-list,
.legend-list {
  display: grid;
  gap: 0.85rem;
}

.info-list div,
.mini-card,
.settings-row,
.legend-list div {
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface-soft);
}

.info-list div,
.legend-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem;
}

.info-list span,
.mini-card span,
.settings-row small {
  color: var(--admin-muted);
  font-size: 0.84rem;
}

.info-list strong,
.mini-card strong {
  text-align: right;
}

.mini-card {
  display: grid;
  gap: 0.35rem;
  min-height: 104px;
  align-content: center;
  padding: 1rem;
}

.mini-card strong {
  color: var(--admin-text);
  font-size: 1.05rem;
}

.profile-stat-tile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: var(--admin-surface-soft);
}

.profile-stat-tile .card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1rem;
}

.profile-stat-label {
  display: block;
  color: var(--admin-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.profile-stat-value {
  display: block;
  margin-top: 0.15rem;
  color: var(--admin-text);
  font-size: 0.98rem;
  font-weight: 700;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  cursor: pointer;
}

.settings-row span {
  display: grid;
  gap: 0.2rem;
}

.donut-chart {
  width: 190px;
  height: 190px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--admin-primary) 0 42%, var(--admin-success) 42% 68%, var(--admin-warning) 68% 86%, var(--admin-danger) 86% 100%);
  box-shadow: var(--admin-shadow-sm);
}

.donut-chart span {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: var(--admin-text);
  font-size: 1.65rem;
  font-weight: 800;
}

.legend-list div {
  padding: 0.75rem 0.85rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.legend-list strong {
  margin-left: auto;
}

.progress {
  height: 1.15rem;
  border-radius: 8px;
  background: #e8eef6;
}

.progress-bar {
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
}

.progress-42 {
  width: 42%;
}

.progress-58 {
  width: 58%;
}

.progress-72 {
  width: 72%;
}

.blank-panel {
  min-height: 440px;
  display: grid;
  place-items: center;
  text-align: center;
}

.blank-state {
  max-width: 440px;
  display: grid;
  justify-items: center;
}

.blank-visual {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin-bottom: 0.9rem;
}

.auth-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #f8fbff 0%, #eaf2ff 44%, #eef8f6 100%);
}

.auth-page,
.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-card,
.error-card {
  width: min(100%, 460px);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--admin-shadow-lg);
  position: relative;
  overflow: hidden;
}

.auth-card::before,
.error-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #2563eb, #0f766e);
}

.auth-card {
  padding: 2rem;
}

.auth-card-lg {
  width: min(100%, 820px);
}

.auth-title {
  font-weight: 800;
  font-size: 1.6rem;
  margin: 0 0 1.4rem;
  letter-spacing: -0.01em;
}

.auth-title small {
  display: block;
  margin-top: 0.3rem;
  color: var(--admin-muted);
  font-weight: 500;
  font-size: 0.88rem;
}

.auth-section + .auth-section {
  margin-top: 1.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--admin-border);
}

.auth-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: var(--admin-text);
}

.auth-section-title i {
  color: var(--admin-primary);
}

.reg-steps {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.reg-step {
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  overflow: hidden;
}

.reg-step-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.9rem 1.1rem;
  background: rgba(37, 99, 235, 0.05);
  border: none;
  text-align: left;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--admin-text);
  cursor: pointer;
}

.reg-step-header:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.reg-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--admin-primary);
  color: #fff;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.reg-step.is-done .reg-step-badge {
  background: var(--admin-success, #198754);
}

.reg-step-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.reg-step-title i {
  color: var(--admin-primary);
}

.reg-step-chevron {
  transition: transform 0.2s ease;
  color: var(--admin-muted);
}

.reg-step-header[aria-expanded="true"] .reg-step-chevron {
  transform: rotate(180deg);
}

.reg-step-body {
  padding: 1.25rem 1.1rem;
  border-top: 1px solid var(--admin-border);
}

.reg-consent-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}

.reg-consent-card + .reg-consent-card {
  margin-top: 0.75rem;
}

.reg-consent-info {
  flex: 1;
}

.reg-consent-name {
  font-weight: 600;
}

.reg-consent-card.reg-consent-invalid {
  border-color: var(--bs-danger, #dc3545);
  box-shadow: 0 0 0 1px var(--bs-danger, #dc3545);
}

.auth-link {
  color: var(--admin-primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-link:hover,
.auth-link:focus {
  text-decoration: underline;
}

.password-field {
  position: relative;
}

.password-field > .form-control {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  height: calc(1.5em + 0.75rem);
  width: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0 0.375rem 0.375rem 0;
  background: transparent;
  color: var(--admin-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--admin-primary);
  outline: none;
}

.password-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
}

.password-checklist li {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
  background: var(--admin-surface-soft);
  color: var(--admin-muted);
  border: 1px solid var(--admin-border);
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.password-checklist li.text-success {
  background: rgba(15, 118, 110, 0.12);
  border-color: rgba(15, 118, 110, 0.35);
  color: var(--admin-success) !important;
}

.auth-visual {
  margin-bottom: 1rem;
  height: 96px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  overflow: hidden;
}

.auth-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.error-card {
  padding: 2rem;
  text-align: center;
}

.error-illustration {
  width: min(260px, 100%);
  max-height: 132px;
  object-fit: contain;
  margin: 0 auto 0.55rem;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  color: var(--admin-text);
}

.auth-brand:hover,
.auth-brand:focus {
  color: var(--admin-text);
}

.auth-brand > span:last-child {
  display: grid;
  line-height: 1.2;
}

.auth-brand small,
.auth-footer {
  color: var(--admin-muted);
}

.auth-footer {
  margin-top: 1.2rem;
  text-align: center;
  font-size: 0.92rem;
}

.error-code {
  color: var(--admin-primary);
  font-size: clamp(5rem, 18vw, 8rem);
  font-weight: 800;
  line-height: 1;
}

.admin-footer {
  padding:0.9rem;
  color: var(--admin-muted);
  font-size: 0.9rem;
}

.admin-footer .container-fluid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 992px) {
  body.sidebar-mini .admin-sidebar {
    width: var(--sidebar-mini-width);
  }

  body.sidebar-mini .admin-main {
    margin-left: var(--sidebar-mini-width);
  }

  body.sidebar-mini .brand-copy,
  body.sidebar-mini .nav-text,
  body.sidebar-mini .sidebar-footer-text,
  body.sidebar-mini .sidebar-clinic-copy {
    width: 0;
    opacity: 0;
    overflow: hidden;
  }

  body.sidebar-mini .sidebar-header,
  body.sidebar-mini .sidebar-footer {
    margin-inline: 1rem;
    padding-inline: 0;
  }

  body.sidebar-mini .sidebar-clinic-badge {
    justify-content: center;
    margin-inline: 0.75rem;
    padding: 0.35rem 0;
    background: transparent;
    border-color: transparent;
    gap: 0;
  }

  body.sidebar-mini .sidebar-nav .nav-link {
    justify-content: center;
    padding-inline: 0.65rem;
    background: transparent;
  }

  body.sidebar-mini .sidebar-nav .nav-link::after {
    display: none;
  }

  body.sidebar-mini .sidebar-nav .nav-link:hover,
  body.sidebar-mini .sidebar-nav .nav-link:focus {
    transform: none;
  }

  body.sidebar-mini .sidebar-nav .nav-link:hover .nav-icon,
  body.sidebar-mini .sidebar-nav .nav-link:focus .nav-icon {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
  }

  body.sidebar-mini .sidebar-nav .nav-link.active .nav-icon {
    background: var(--admin-primary);
    color: #ffffff;
  }
}

@media (max-width: 991.98px) {
  .admin-sidebar {
    width: min(var(--sidebar-width), calc(100vw - 48px));
    transform: translateX(-100%);
  }

  .admin-main {
    margin-left: 0;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }
}

@media (max-width: 575.98px) {
  .page-heading,
  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .heading-actions {
    width: 100%;
    justify-content: stretch;
  }

  .heading-actions .btn {
    flex: 1 1 0;
  }

  .chart-bars {
    height: 220px;
    gap: 0.6rem;
    padding-inline: 0.25rem;
  }

  .metric-value {
    font-size: 1.85rem;
  }

  .metric-card,
  .panel {
    padding: 1.1rem;
  }

  .admin-footer .container-fluid {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-nav .nav-link,
  .sidebar-toggle,
  .icon-button,
  .profile-button,
  .btn,
  .metric-card,
  .panel,
  .table tbody tr {
    transition: none;
  }

  .sidebar-nav .nav-link:hover,
  .sidebar-nav .nav-link:focus,
  .btn:hover,
  .btn:focus,
  .metric-card:hover {
    transform: none;
  }

  .sidebar-nav .nav-link.active::after {
    animation: none;
    transform: scaleX(1);
  }

  .notification-menu .dropdown-item.notification-unread {
    animation: none;
    background-color: var(--notification-unread-bg-strong);
  }
}

.dashboard-panel {
  --cc-glow-primary: #3d6fe0;
  --cc-glow-success: #16a870;
  --cc-glow-warning: #ef8f1e;
  --cc-glow-a: 0%;
  --cc-glow-b: 0%;
  --cc-glow-c: 0%;
  position: relative;
  overflow: hidden;
  padding: 1rem;
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.16), 0 10px 24px rgba(15, 23, 42, 0.1);
}

.dashboard-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 90% at 45% -10%, color-mix(in srgb, var(--cc-glow-primary) var(--cc-glow-a), transparent), transparent 60%),
    radial-gradient(46% 60% at 92% 8%, color-mix(in srgb, var(--cc-glow-success) var(--cc-glow-b), transparent), transparent 65%),
    radial-gradient(40% 55% at 4% 22%, color-mix(in srgb, var(--cc-glow-warning) var(--cc-glow-c), transparent), transparent 65%);
}

.dashboard-panel > * {
  position: relative;
  z-index: 1;
}

html[data-theme="dark"] .dashboard-panel {
  --cc-glow-primary: #6c9bff;
  --cc-glow-success: #2bd9a3;
  --cc-glow-warning: #fdb750;
  --cc-glow-a: 22%;
  --cc-glow-b: 12%;
  --cc-glow-c: 8%;
}

.dashboard-panel .panel-header {
  margin-bottom: 0.5rem;
}

.dashboard-panel-body-center {
  flex: 1;
  display: flex;
  min-height: 0;
}

.psy-dash {
  --admin-primary: #3d6fe0;
  --admin-primary-dark: #2f5cc8;
  --admin-success: #16a870;
  --admin-warning: #ef8f1e;
  --admin-danger: #f2555a;
  --admin-text: #2f3542;
  --admin-muted: #7b8397;
  --admin-surface: #ffffff;
  --admin-surface-soft: #f5f6fb;
  --admin-border: #e8eaf4;

  --tl-primary: var(--admin-primary);
  --tl-primary-ink: #2f5cc8;
  --tl-plan: #fbbf24;
  --tl-plan-ink: #a16207;
  --tl-free: #87f409;
  --tl-free-ink: #4f8f05;
  --tl-free-bg: #f4fde9;
  --tl-mint: #14bd9a;
  --tl-mint-ink: #0c9179;
  --tl-rose: #ff0000;
  --tl-rose-ink: #d60000;
  --tl-rose-bg: #fff4f4;
}

html[data-theme="dark"] .psy-dash {
  --admin-primary: #6c9bff;
  --admin-primary-dark: #8ab0ff;
  --admin-success: #2bd9a3;
  --admin-warning: #fdb750;
  --admin-danger: #ff7a7a;
  --admin-text: #e5edf7;
  --admin-muted: #9aa8bd;
  --admin-surface: #182235;
  --admin-surface-soft: #111827;
  --admin-border: #2f3b52;

  --tl-primary: #6c9bff;
  --tl-primary-ink: #8ab0ff;
  --tl-plan: #f0cf6b;
  --tl-plan-ink: #e0c063;
  --tl-free: #9ce23e;
  --tl-free-ink: #bce984;
  --tl-free-bg: #1e2620;
  --tl-mint: #26d6ad;
  --tl-mint-ink: #5ce3c7;
  --tl-rose: #ff5c5c;
  --tl-rose-ink: #ff8a8a;
  --tl-rose-bg: #2a1e22;
}

.psy-dash .bg-success {
  background-color: var(--admin-success) !important;
}
.psy-dash .bg-warning {
  background-color: var(--admin-warning) !important;
}
.psy-dash .bg-danger {
  background-color: var(--admin-danger) !important;
}
.psy-dash .text-success {
  color: var(--admin-success) !important;
}
.psy-dash .text-warning {
  color: var(--admin-warning) !important;
}
.psy-dash .text-danger {
  color: var(--admin-danger) !important;
}
.psy-dash .progress {
  background-color: var(--admin-surface-soft);
}

.psy-dash .dashboard-panel {
  border-radius: 16px;
  border-color: var(--admin-border);
  box-shadow: 0 1px 2px rgba(46, 53, 66, 0.04), 0 12px 34px rgba(46, 53, 66, 0.07);
  padding: 1rem 1.05rem;
}

.psy-dash .dashboard-panel:hover {
  border-color: color-mix(in srgb, var(--admin-border) 75%, var(--admin-surface));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 16px 40px rgba(15, 23, 42, 0.09);
}

html[data-theme="dark"] .psy-dash .dashboard-panel {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28), 0 16px 40px rgba(0, 0, 0, 0.38);
}

.psy-dash .section-title i {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--tl-primary-ink);
  background: color-mix(in srgb, var(--tl-primary) 14%, transparent);
}

.agenda-scroll-list {
  min-width: 0;
  height: 632px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

@media (min-width: 1200px) {
  .agenda-dash-row {
    align-items: stretch;
  }
  .agenda-dash-row > div:first-child {
    display: flex;
    flex-direction: column;
  }
  .agenda-dash-left {
    flex: 1 1 auto;
  }
  .agenda-dash-left > .agenda-dash-grow {
    flex: 1 1 auto;
    min-height: 0;
  }
}

@media (max-width: 1199.98px) {
  .agenda-scroll-list {
    height: auto;
    max-height: 72vh;
  }
}

.mini-calendar-compact {
  gap: 1px;
}

.mini-calendar-compact .mini-calendar-day {
  padding: 0.12rem 0;
  font-size: 0.68rem;
}

.mini-calendar-compact .mini-calendar-weekday {
  font-size: 0.62rem;
  padding-bottom: 2px;
}

.agenda-tl-free {
  position: absolute;
  left: 8px;
  right: 4px;
  display: flex;
  align-items: center;
  padding: 0 13px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--tl-free-ink);
  background: var(--tl-free-bg);
  border: 1px dashed color-mix(in srgb, var(--tl-free) 55%, transparent);
  transition: background 0.14s ease, border-color 0.14s ease;
}

.agenda-tl-free span {
  line-height: 1;
}

.agenda-tl-free:hover {
  background: color-mix(in srgb, var(--tl-free) 20%, var(--admin-surface));
  border-color: var(--tl-free);
}

.agenda-tl-free.is-past {
  opacity: 0.5;
  cursor: default;
  border-style: solid;
  color: var(--admin-muted);
  background: var(--admin-surface-soft);
}

.agenda-tl-free.is-past:hover {
  border-color: color-mix(in srgb, var(--tl-free) 30%, transparent);
}

.agenda-tl {
  display: flex;
  position: relative;
  padding: 6px 0 22px;
}

.agenda-tl-gutter {
  position: relative;
  width: 44px;
  flex-shrink: 0;
}

.agenda-tl-hour {
  position: absolute;
  right: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--admin-muted);
}

.agenda-tl-track {
  position: relative;
  flex: 1;
  border-left: 1px solid var(--admin-border);
}

.agenda-tl-grid {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--admin-border);
}

.agenda-tl-block {
  --rail: var(--tl-plan);
  --rail-ink: var(--tl-plan-ink);
  position: absolute;
  left: 8px;
  right: 4px;
  border-radius: 10px;
  padding: 7px 12px 7px 14px;
  overflow: hidden;
  cursor: pointer;
  background: color-mix(in srgb, var(--rail) 20%, var(--admin-surface));
  border: 1px solid color-mix(in srgb, var(--rail) 36%, var(--admin-border));
  box-shadow: 0 2px 5px rgba(40, 48, 66, 0.09), 0 14px 30px rgba(40, 48, 66, 0.14);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  column-gap: 8px;
  row-gap: 1px;
}

.agenda-tl-end {
  order: 2;
  flex: 0 0 auto;
  margin-left: auto;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.agenda-tl-note {
  order: 3;
  flex: 1 1 100%;
  min-width: 0;
  font-size: 0.73rem;
  color: var(--admin-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agenda-tl-status {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--rail-ink);
  white-space: nowrap;
}

.agenda-tl-block.is-compact {
  flex-wrap: nowrap;
  padding-top: 2px;
  padding-bottom: 2px;
  column-gap: 7px;
}

.agenda-tl-block.is-compact .agenda-tl-note {
  order: 2;
  flex: 0 1 auto;
  font-size: 0.68rem;
}

.agenda-tl-block.is-compact .agenda-tl-end {
  order: 3;
}

.agenda-tl-block.is-compact .agenda-tl-name {
  font-size: 0.76rem;
}

.agenda-tl-block::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--rail);
}

.agenda-tl-block:hover {
  transform: translateX(1px) translateY(-1px);
  box-shadow: 0 4px 8px rgba(40, 48, 66, 0.12), 0 20px 40px rgba(40, 48, 66, 0.2);
}

.agenda-tl-block .agenda-tl-time {
  color: var(--rail-ink);
  font-weight: 700;
}

.agenda-tl-block.agenda-tl-attended {
  --rail: var(--tl-mint);
  --rail-ink: var(--tl-mint-ink);
}

.agenda-tl-block.agenda-tl-noshow {
  --rail: var(--tl-rose);
  --rail-ink: var(--tl-rose-ink);
  background: color-mix(in srgb, var(--tl-rose) 15%, var(--admin-surface));
  border-color: color-mix(in srgb, var(--tl-rose) 32%, var(--admin-border));
}

.agenda-tl-block.agenda-tl-noshow .agenda-tl-name {
  color: var(--tl-rose-ink);
}

.agenda-tl-block.agenda-tl-cancelled {
  --rail: var(--admin-muted);
  --rail-ink: var(--admin-muted);
  background: var(--admin-surface-soft);
  box-shadow: none;
  opacity: 0.75;
}

.agenda-tl-block.agenda-tl-cancelled .agenda-tl-name {
  text-decoration: line-through;
  color: var(--admin-muted);
}

.agenda-tl-reuse {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--admin-primary) 42%, var(--admin-border));
  background: var(--admin-surface);
  color: var(--admin-primary);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.agenda-tl-block.agenda-tl-cancelled:hover .agenda-tl-reuse,
.agenda-tl-block.agenda-tl-cancelled:focus-within .agenda-tl-reuse {
  opacity: 1;
}

.agenda-tl-reuse:hover {
  background: color-mix(in srgb, var(--admin-primary) 12%, var(--admin-surface));
}

html[data-theme="dark"] .agenda-tl-block,
html[data-theme="dark"] .agenda-tl-block.agenda-tl-noshow {
  background: var(--admin-surface);
  border-color: var(--admin-border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 16px 34px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .agenda-tl-block.agenda-tl-cancelled {
  background: var(--admin-surface-soft);
}

html[data-theme="dark"] .agenda-tl-block:hover {
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.45), 0 24px 48px rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] .agenda-tl-free {
  background: transparent;
}

.agenda-tl-name {
  order: 1;
  flex: 0 1 auto;
  min-width: 0;
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--admin-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agenda-tl-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.73rem;
  color: var(--rail-ink);
}


.agenda-tl-now {
  position: absolute;
  left: -44px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
  pointer-events: none;
  transform: translateY(-50%);
}

.agenda-tl-now-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tl-rose);
  animation: agendaNowPulse 1.6s ease-out infinite;
}

.agenda-tl-now-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--tl-rose-ink);
}

@keyframes agendaNowPulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--tl-rose) 55%, transparent);
  }
  70% {
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--tl-rose) 0%, transparent);
  }
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--tl-rose) 0%, transparent);
  }
}

.agenda-tl-block.is-now {
  animation: agendaApptPulse 1.7s ease-in-out infinite;
}

@keyframes agendaApptPulse {
  0%,
  100% {
    box-shadow: 0 0 0 2px var(--tl-rose), 0 0 0 0 color-mix(in srgb, var(--tl-rose) 42%, transparent);
  }
  55% {
    box-shadow: 0 0 0 2px var(--tl-rose), 0 0 0 6px color-mix(in srgb, var(--tl-rose) 0%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .agenda-tl-now-dot,
  .agenda-tl-block.is-now {
    animation: none;
  }
  .agenda-tl-block.is-now {
    box-shadow: 0 0 0 2px var(--tl-rose), 0 6px 16px rgba(40, 48, 66, 0.06);
  }
}

.occupancy-stat-chip {
  background: var(--admin-surface-soft);
  border-radius: 10px;
  padding: 0.4rem 0.3rem;
}

.occupancy-stat-chip .osc-n {
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1.15;
  color: var(--admin-text);
}

.occupancy-stat-chip .osc-t {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.mini-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.mini-calendar-weekday {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--admin-muted);
  text-transform: uppercase;
  padding-bottom: 4px;
}

.mini-calendar-day {
  position: relative;
  padding: 0.2rem 0;
  border-radius: 8px;
  font-size: 0.72rem;
  color: var(--admin-text);
}

.mini-calendar-day.is-today {
  background: var(--admin-primary);
  color: #fff;
  font-weight: 800;
}

.mini-calendar-day.is-muted {
  visibility: hidden;
}

.mini-calendar-day.is-disabled {
  opacity: 0.3;
  pointer-events: none;
}

.mini-calendar-day.has-appointment::after {
  content: "";
  position: absolute;
  bottom: 1px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--admin-success);
  transform: translateX(-50%);
}

.mini-calendar-day.has-appointment.tier-warning::after {
  background: var(--admin-warning);
}

.mini-calendar-day.has-appointment.tier-danger::after {
  background: var(--admin-danger);
}

.mini-calendar-day.is-today.has-appointment::after {
  background: #fff;
}

.month-overview {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--admin-border);
  text-align: center;
  font-size: 0.78rem;
  color: var(--admin-muted);
}

.month-overview i {
  margin-right: 0.35rem;
  color: var(--admin-primary);
}

.test-credit-value {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  color: var(--credit-tier-color, var(--admin-primary));
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.28rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  transition: background 0.15s ease;
}

.donut-legend-item:hover {
  background: var(--admin-surface-soft);
}

.donut-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.clinic-date-picker {
  position: fixed;
  z-index: 1060;
  width: 240px;
  padding: 0.75rem;
  border-radius: 10px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow-lg);
}

.clinic-date-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--admin-text);
}

.clinic-date-picker-header button {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--admin-muted);
}

.clinic-date-picker-header button:hover {
  background: var(--admin-surface-soft);
  color: var(--admin-text);
}

.clinic-date-picker-label {
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

.clinic-date-picker-label:hover {
  background: var(--admin-surface-soft);
}

.clinic-date-picker .mini-calendar-day {
  cursor: pointer;
}

.clinic-date-picker .mini-calendar-day:hover:not(.is-muted) {
  background: var(--admin-surface-soft);
}

.clinic-date-picker .mini-calendar-day.is-selected {
  background: var(--admin-primary);
  color: #fff;
  font-weight: 800;
}

.mini-calendar-grid-years {
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.mini-calendar-year {
  padding: 0.5rem 0;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--admin-text);
  cursor: pointer;
}

.mini-calendar-year:hover {
  background: var(--admin-surface-soft);
}

.mini-calendar-year.is-selected {
  background: var(--admin-primary);
  color: #fff;
}

.mini-calendar-year.is-disabled {
  opacity: 0.3;
  pointer-events: none;
}

.metric-card-sm {
  min-height: 0;
  padding: 0.9rem 1.1rem;
}

.metric-card-sm .metric-value {
  margin-top: 0.6rem;
  font-size: 1.5rem;
}

.ring-arc {
  transition: stroke-dasharray 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
  .ring-arc {
    transition: none !important;
  }
}

.clinic-row2-panel {
  height: 360px;
}

.clinic-table-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.clinic-density-table thead th {
  position: sticky;
  top: 0;
  background: var(--admin-surface);
  z-index: 1;
}

.hourly-density-area {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  height: 170px;
  margin-top: auto;
}

.hourly-density-yaxis {
  position: relative;
  width: 52px;
  flex-shrink: 0;
}

.hourly-density-yaxis-label {
  position: absolute;
  left: 0;
  right: 0.5rem;
  transform: translateY(50%);
  font-size: 0.6rem;
  color: var(--admin-muted);
  text-align: right;
  white-space: nowrap;
}

.hourly-density-plot {
  position: relative;
  flex: 1;
  height: 100%;
}

.hourly-density-gridline {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--admin-border);
  opacity: 0.6;
}

.hourly-density-gridline-base {
  opacity: 1;
}

.hourly-density-chart {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 0 6px;
}

.hourly-density-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
}

.hourly-density-bar {
  width: 100%;
  min-height: 6px;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: height 0.3s ease;
}

.hourly-density-bar-label {
  font-size: 0.62rem;
  color: var(--admin-muted);
  white-space: nowrap;
}

.hourly-density-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1rem;
  font-size: 0.72rem;
  color: var(--admin-muted);
}

.hourly-density-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.3rem;
}

.clinic-density-low {
  background: linear-gradient(180deg, #86efac, #22c55e);
}

.clinic-density-medium {
  background: linear-gradient(180deg, #fde68a, #f5b93f);
}

.clinic-density-high {
  background: linear-gradient(180deg, #fdba74, #fb923c);
}

.clinic-density-veryBusy {
  background: linear-gradient(180deg, #fca5a5, #f16565);
}

.clinic-density-table {
  font-size: 0.8rem;
  table-layout: fixed;
  width: 100%;
}

.clinic-col-psikolog {
  width: 28%;
}

.clinic-col-num {
  width: 11%;
}

.clinic-col-doluluk {
  width: 15%;
}

.clinic-col-yogunluk {
  width: 24%;
}

.sa-col-klinik {
  width: 21%;
}

.sa-col-ciro {
  width: 12%;
}

.sa-col-num {
  width: 8%;
}

.sa-col-doluluk {
  width: 13%;
}

.sa-col-yogunluk {
  width: 11%;
}

.sa-col-durum {
  width: 11%;
}

.clinic-psychologist-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.clinic-density-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.clinic-density-row:hover {
  background-color: var(--admin-surface-soft);
}

.clinic-density-table td,
.clinic-density-table th {
  padding: 0.45rem 0.5rem;
  white-space: nowrap;
}

.clinic-density-table th {
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  font-size: 0.66rem;
  color: var(--admin-muted);
  text-transform: uppercase;
  font-weight: 800;
}

.clinic-psychologist-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.clinic-psychologist-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.density-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.density-bar {
  width: 10px;
  border-radius: 3px 3px 0 0;
  background: var(--admin-border);
  transition: background-color 0.4s ease;
}

.density-badge-low {
  background: rgba(15, 118, 110, 0.15);
  color: var(--admin-success);
}

.density-badge-medium {
  background: rgba(217, 119, 6, 0.15);
  color: var(--admin-warning);
}

.density-badge-high {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.density-badge-veryBusy {
  background: rgba(220, 38, 38, 0.15);
  color: var(--admin-danger);
}

html[data-theme="dark"] {
  --admin-bg: #0f172a;
  --admin-surface: #182235;
  --admin-surface-soft: #111827;
  --admin-border: #2f3b52;
  --admin-text: #e5edf7;
  --admin-muted: #9aa8bd;
  --admin-primary: #60a5fa;
  --admin-primary-dark: #3b82f6;
  --admin-success: #2dd4bf;
  --admin-warning: #fbbf24;
  --admin-danger: #f87171;
  --admin-pink: #f472b6;
  --admin-sidebar: #090f1d;
  --admin-sidebar-soft: #172033;
  --admin-shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.24);
  --admin-shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
  --admin-shadow-lg: 0 26px 70px rgba(0, 0, 0, 0.42);
  --admin-ring: 0 0 0 4px rgba(96, 165, 250, 0.18);
  --admin-card-shadow: 0 22px 50px rgba(0, 0, 0, 0.55);
  --notification-unread-bg: rgba(96, 165, 250, 0.14);
  --notification-unread-bg-strong: rgba(96, 165, 250, 0.28);

  --tl-primary: #7d8cff;
  --tl-primary-ink: #9aa6ff;
  --tl-mint: #2ad4b0;
  --tl-mint-ink: #55ddc2;
  --tl-rose: #fb7d92;
  --tl-rose-ink: #fd97a8;
}

html[data-theme="dark"] body {
  background: linear-gradient(180deg, #111827 0%, var(--admin-bg) 48%, #0b1120 100%);
}

.brand-icon {
  font-size: 1.1rem;
}

.nav-icon {
  font-size: 0.95rem;
}

.theme-toggle i {
  font-size: 1rem;
}

.admin-navbar.bg-white,
.sidebar-toggle,
.icon-button,
.profile-button {
  background-color: var(--admin-surface) !important;
  color: var(--admin-text);
}

html[data-theme="dark"] .admin-navbar.bg-white {
  background-color: rgba(24, 34, 53, 0.92) !important;
}

html[data-theme="dark"] .admin-footer.bg-white {
  background-color: rgba(24, 34, 53, 0.92) !important;
}

html[data-theme="dark"] .fill-header.bg-white {
  background-color: rgba(24, 34, 53, 0.92) !important;
  border-color: var(--admin-border) !important;
}

html[data-theme="dark"] .profile-avatar {
  background: #1e3a5f;
  color: #bfdbfe;
}

.page-heading-copy {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  min-width: 0;
}

.page-icon,
.section-title i {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #eaf2ff;
  color: var(--admin-primary-dark);
}

.page-icon {
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.modal-header .modal-title.section-title {
  display: flex;
}

.modal-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  margin-left: auto;
}

.modal-header-actions .btn-close {
  margin: 0;
}

.section-title i {
  width: 34px;
  height: 34px;
  font-size: 0.95rem;
}

html[data-theme="dark"] .page-icon,
html[data-theme="dark"] .section-title i {
  background: #1e3a5f;
  color: #bfdbfe;
}

.card-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 0.8rem;
  background: #eaf2ff;
  color: var(--admin-primary-dark);
}

.card-icon-success {
  background: #e7f6f3;
  color: var(--admin-success);
}

html[data-theme="dark"] .card-icon {
  background: #1e3a5f;
  color: #bfdbfe;
}

html[data-theme="dark"] .card-icon-success {
  background: #113b30;
  color: #5eead4;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.icon-primary {
  color: var(--admin-primary);
}

.icon-warning {
  color: var(--admin-warning);
}

.icon-danger {
  color: var(--admin-danger);
}

.icon-success {
  color: var(--admin-success);
}

.icon-pink {
  color: var(--admin-pink);
}

.btn-light {
  border-color: var(--admin-border);
  background: var(--admin-surface-soft);
  color: var(--admin-text);
}

.btn-outline-secondary {
  border-color: var(--admin-border);
  color: var(--admin-text);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  border-color: var(--admin-primary);
  background: #eaf2ff;
  color: var(--admin-primary-dark);
}

html[data-theme="dark"] .btn-outline-secondary:hover,
html[data-theme="dark"] .btn-outline-secondary:focus {
  background: #1e3a5f;
  color: #bfdbfe;
}

html[data-theme="dark"] .chart-bars {
  background: linear-gradient(180deg, #111827 0%, #182235 100%);
}

html[data-theme="dark"] .table tbody tr:hover {
  background: #111827;
}

html[data-theme="dark"] .progress {
  background: #243149;
}

html[data-theme="dark"] .dashboard-panel {
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.5), 0 10px 24px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .auth-body {
  background: linear-gradient(135deg, #0b1120 0%, #111827 48%, #10201f 100%);
}

.auth-card,
.error-card {
  background: var(--admin-surface);
}

.auth-theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
}

.dropdown-menu,
.modal-content,
.accordion-item,
.accordion-button {
  border-color: var(--admin-border);
  background-color: var(--admin-surface);
  color: var(--admin-text);
}

.card {
  border-color: var(--admin-border);
  background-color: var(--admin-surface);
  color: var(--admin-text);
  box-shadow: var(--admin-card-shadow) !important;
}

html[data-theme="dark"] .card {
  background-color: #1a2439;
}

.dropdown-item,
.accordion-body {
  color: var(--admin-text);
}

.dropdown-item:hover,
.dropdown-item:focus,
.accordion-button:not(.collapsed) {
  background-color: var(--admin-surface-soft);
  color: var(--admin-text);
}

.form-control,
.form-select {
  border-color: var(--admin-border);
  background-color: var(--admin-surface);
  color: var(--admin-text);
}

.form-control:focus,
.form-select:focus {
  border-color: #93c5fd;
  background-color: var(--admin-surface);
  color: var(--admin-text);
  box-shadow: var(--admin-ring);
}

.form-control::placeholder {
  color: var(--admin-muted);
}

.text-muted {
  color: var(--admin-muted) !important;
}

html[data-theme="dark"] .text-body {
  color: var(--admin-text) !important;
}

html[data-theme="dark"] .text-bg-secondary {
  background-color: rgba(148, 163, 184, 0.16) !important;
  color: #cbd5e1 !important;
}

@media (max-width: 767.98px) {
  .navbar-actions {
    gap: 0.5rem;
  }

  .icon-button,
  .sidebar-toggle {
    width: 40px;
    height: 40px;
  }

  .profile-button {
    width: auto;
    min-width: 0;
    height: 40px;
    min-height: 40px;
    padding: 0.3rem 0.5rem;
    flex-shrink: 0;
  }

  .page-heading-copy {
    align-items: flex-start;
  }

  .panel-header p {
    display: none;
  }

  .panel-header .d-flex {
    gap: 0.35rem;
  }

  .panel-header .input-group,
  .panel-header .form-select {
    min-width: 90px;
    flex: 1 1 90px;
  }

  .panel-header .input-group .form-control {
    min-width: 0;
  }
}

@media (max-width: 575.98px) {
  .page-heading-copy {
    width: 100%;
  }

  .page-icon {
    width: 44px;
    height: 44px;
  }

  .panel-header .d-flex,
  .panel-header .form-control,
  .panel-header .form-select {
    width: 100%;
  }
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body,
.admin-navbar,
.admin-sidebar,
.admin-main,
.metric-card,
.panel,
.auth-card,
.error-card,
.dropdown-menu,
.modal-content,
.form-control,
.form-select {
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.table {
  --bs-table-color: var(--admin-text);
  --bs-table-border-color: var(--admin-border);
  color: var(--admin-text);
}

.page-link {
  border-color: var(--admin-border);
  background: var(--admin-surface);
  color: var(--admin-text);
}

.page-link:hover,
.page-link:focus {
  border-color: var(--admin-primary);
  background: var(--admin-surface-soft);
  color: var(--admin-primary);
}

.page-item.active .page-link {
  border-color: var(--admin-primary);
  background: var(--admin-primary);
  color: #ffffff;
}

.page-item.disabled .page-link {
  border-color: var(--admin-border);
  background: var(--admin-surface-soft);
  color: var(--admin-muted);
}

.alert {
  border-radius: 8px;
}

html[data-theme="dark"] .alert-primary {
  border-color: #1d4ed8;
  background: rgba(37, 99, 235, 0.16);
  color: #bfdbfe;
}

html[data-theme="dark"] .alert-success {
  border-color: #14b8a6;
  background: #0d3d38;
  color: #f0fdfa;
}

html[data-theme="dark"] .alert-warning {
  border-color: #d97706;
  background: rgba(217, 119, 6, 0.18);
  color: #fde68a;
}

html[data-theme="dark"] .alert-danger {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.16);
  color: #fecaca;
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .accordion-item {
  border-color: var(--admin-border);
}

html[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(180%);
}

html[data-theme="dark"] .btn-outline-primary .fw-semibold {
  color: var(--admin-text);
}

html[data-theme="dark"] .text-bg-info {
  background-color: rgba(244, 114, 182, 0.16) !important;
  color: #f9a8d4 !important;
}

html[data-theme="dark"] .text-bg-warning {
  background-color: rgba(251, 191, 36, 0.16) !important;
  color: #fcd34d !important;
}

html[data-theme="dark"] .text-bg-success {
  background-color: rgba(45, 212, 191, 0.16) !important;
  color: #5eead4 !important;
}

html[data-theme="dark"] .text-bg-danger {
  background-color: rgba(248, 113, 113, 0.16) !important;
  color: #fca5a5 !important;
}

html[data-theme="dark"] .text-bg-light {
  background-color: var(--admin-surface-soft) !important;
  color: var(--admin-text) !important;
  border-color: var(--admin-border) !important;
}

@media (max-width: 991.98px) {
  .dashboard-content > .container-fluid {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
  }

  .admin-sidebar {
    box-shadow: 18px 0 48px rgba(0, 0, 0, 0.28);
  }
}

@media (max-width: 767.98px) {
  .panel-header {
    align-items: flex-start;
  }

  .panel-header > .d-flex {
    width: 100%;
  }

  .table-search {
    width: 100%;
  }

  .auth-page,
  .error-page {
    padding: 1rem;
  }

  .auth-card,
  .error-card {
    padding: 1.15rem;
  }
}

@media (max-width: 420px) {
  .heading-actions {
    width: 100%;
  }

  .heading-actions .btn {
    width: 100%;
  }

  .metric-card {
    min-height: 146px;
  }

  .profile-avatar-lg {
    width: 76px;
    height: 76px;
  }
}

@media (max-width: 575.98px) {
  .avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .avatar-xl {
    width: 70px;
    height: 70px;
  }

  .avatar-xxl {
    width: 96px;
    height: 96px;
  }

  .profile-cover {
    height: 82px;
    margin-bottom: 0.75rem;
  }

  .profile-photo {
    margin-top: -38px;
  }

  .auth-visual {
    height: 82px;
  }

  .product-thumb {
    width: 36px;
    height: 36px;
  }
}

html:not([data-theme="dark"]) {
  --admin-sidebar: #ffffff;
  --admin-sidebar-soft: #eef4ff;
  --admin-sidebar-border: #dbe4ef;
  --admin-sidebar-text: #475569;
  --admin-sidebar-text-strong: #0f172a;
  --admin-sidebar-muted: #64748b;
  --admin-sidebar-icon-bg: #eaf2ff;
  --admin-sidebar-icon: #2563eb;
  --admin-sidebar-shadow: 18px 0 42px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] {
  --admin-sidebar-border: rgba(255, 255, 255, 0.08);
  --admin-sidebar-text: #d1d5db;
  --admin-sidebar-text-strong: #ffffff;
  --admin-sidebar-muted: #9ca3af;
  --admin-sidebar-icon-bg: rgba(255, 255, 255, 0.08);
  --admin-sidebar-icon: #bfdbfe;
  --admin-sidebar-shadow: 18px 0 42px rgba(0, 0, 0, 0.34);
}

.admin-sidebar {
  border-right: 1px solid var(--admin-sidebar-border);
  background: var(--admin-sidebar);
  color: var(--admin-sidebar-text-strong);
  box-shadow: var(--admin-sidebar-shadow);
}

.sidebar-header {
  border-bottom-color: var(--admin-sidebar-border);
}

.brand-mark,
.brand-mark:hover,
.brand-mark:focus {
  color: var(--admin-sidebar-text-strong);
}

.brand-subtitle {
  color: var(--admin-sidebar-muted);
}

.sidebar-nav .nav-link {
  color: var(--admin-sidebar-text);
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link:focus,
.sidebar-nav .nav-link.active {
  background: var(--admin-sidebar-soft);
  color: var(--admin-sidebar-text-strong);
}

.nav-icon {
  background: var(--admin-sidebar-icon-bg);
  color: var(--admin-sidebar-icon);
}

.sidebar-footer {
  border-top-color: var(--admin-sidebar-border);
  color: var(--admin-sidebar-text);
}



.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 360px;
    z-index: 9999;

    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert-container .alert {
    margin: 0;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    border-radius: 8px;
    animation: slideIn 0.25s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(40px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: #7ea5fa;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #0252ff;
  border-radius: 10px;
  transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
  background: #7ea5fa;
}

.avatar-upload {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto;
  cursor: pointer;
}

.avatar-upload img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bs-border-color, #dee2e6);
}

.avatar-upload .avatar-upload-icon {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bs-primary, #0d6efd);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  border: 2px solid #fff;
}

.avatar-upload .avatar-zoom-icon {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  border: 2px solid var(--bs-primary, #0d6efd);
  cursor: zoom-in;
  z-index: 2;
}

.modal-body-scroll {
  max-height: 70vh;
  overflow-y: auto;
}

.avatar-zoomable {
  cursor: zoom-in;
}

.image-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.78);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.image-lightbox-overlay.show {
  opacity: 1;
  visibility: visible;
}

.image-lightbox-content {
  position: relative;
  max-width: min(90vw, 480px);
  max-height: 90vh;
  text-align: center;
}

.image-lightbox-content img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.image-lightbox-caption {
  margin: 12px 0 0;
  color: #fff;
  font-weight: 600;
}

.image-lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}


.sa-cc {
  --bs-border-color: var(--admin-border);
  --cc-bg-2: var(--admin-surface-soft);
  --cc-primary: #3d6fe0;
  --cc-success: #16a870;
  --cc-warning: #ef8f1e;
  --cc-danger: #f2555a;
  --cc-glow-a: 0%;
  --cc-glow-b: 0%;
  --cc-glow-c: 0%;
  --cc-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  position: relative;
  overflow: hidden;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
}

html[data-theme="dark"] .sa-cc {
  --cc-primary: #6c9bff;
  --cc-success: #2bd9a3;
  --cc-warning: #fdb750;
  --cc-danger: #ff7a7a;
  --cc-glow-a: 22%;
  --cc-glow-b: 12%;
  --cc-glow-c: 8%;
}

.sa-cc::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 90% at 45% -10%, color-mix(in srgb, var(--cc-primary) var(--cc-glow-a), transparent), transparent 60%),
    radial-gradient(46% 60% at 92% 8%, color-mix(in srgb, var(--cc-success) var(--cc-glow-b), transparent), transparent 65%),
    radial-gradient(40% 55% at 4% 22%, color-mix(in srgb, var(--cc-warning) var(--cc-glow-c), transparent), transparent 65%);
}

.sa-cc > * {
  position: relative;
  z-index: 1;
}

.sa-cc-value {
  font-family: var(--cc-mono);
  font-weight: 600;
  line-height: 1;
}

html[data-theme="dark"] .sa-cc-hero-value {
  background: linear-gradient(180deg, #ffffff 0%, #b9c8ea 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px color-mix(in srgb, var(--cc-primary) 35%, transparent);
}

.sa-cc-cell:hover {
  background: var(--admin-border) !important;
}

.sa-cc .progress-bar {
  transition: width 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
  .sa-cc .progress-bar {
    transition: none !important;
  }
}


.mmpi-report,
.mmpi-tabbar {
  --mmpi-accent: var(--admin-primary);
  --mmpi-accent-2: var(--admin-primary-dark);
  --mmpi-accent-soft: color-mix(in srgb, var(--admin-primary) 10%, transparent);
  --mmpi-yes: #22a565;
}

html[data-theme="dark"] .mmpi-report {
  --mmpi-yes: #4ade80;
}

.mmpi-head-panel .panel-header {
  margin-bottom: 1rem;
}

.mmpi-crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--admin-muted);
}

.mmpi-crumb .mmpi-crumb-pin {
  color: var(--admin-primary);
}

.mmpi-crumb .mmpi-crumb-sep {
  font-size: 0.66rem;
  opacity: 0.7;
}

.mmpi-crumb .mmpi-crumb-current {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.66rem;
  border-radius: 999px;
  font-weight: 700;
  color: var(--admin-primary-dark);
  background: color-mix(in srgb, var(--admin-primary) 13%, transparent);
}

.mmpi-tabbar {
  border-top: 1px dashed var(--admin-border);
  padding-top: 1rem;
}

.mmpi-tabbar .nav-pills {
  --bs-nav-pills-border-radius: 999px;
}

.mmpi-tabbar .nav-pills .nav-link {
  border-radius: 999px;
  padding: 0.5rem 1.05rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--admin-text);
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease, color 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}

.mmpi-tabbar .nav-pills .nav-link:not(.active) {
  opacity: 0.66;
}

.mmpi-tabbar .nav-pills .nav-link:hover {
  transform: translateY(-1px);
  opacity: 1;
  border-color: color-mix(in srgb, var(--admin-primary) 45%, var(--admin-border));
}

.mmpi-tabbar .nav-pills .nav-link.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--mmpi-accent), var(--mmpi-accent-2));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--admin-primary) 30%, transparent);
  transform: translateY(-1px) scale(1.04);
  outline: 2px solid color-mix(in srgb, var(--admin-primary) 32%, transparent);
  outline-offset: 3px;
}

.mmpi-report .mmpi-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mmpi-report .mmpi-accordion .accordion-item {
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--admin-shadow-sm);
}

.mmpi-report .accordion-button {
  border-radius: 14px;
  font-weight: 600;
}

.mmpi-report .accordion-button:not(.collapsed) {
  color: var(--admin-primary-dark);
  background: var(--mmpi-accent-soft);
  box-shadow: none;
  border-radius: 14px 14px 0 0;
}

.mmpi-report .accordion-button:focus {
  box-shadow: 0 0 0 3px var(--mmpi-accent-soft);
}

.mmpi-report .tab-content {
  position: relative;
}

.mmpi-report .tab-pane.fade {
  transition: opacity 0.28s ease, transform 0.28s ease;
  transform: translateY(8px);
}

.mmpi-report .tab-pane.fade.show {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .mmpi-report .tab-pane.fade {
    transition: none;
    transform: none;
  }
}

.mmpi-report .panel {
  border-radius: 18px;
  border-color: color-mix(in srgb, var(--admin-border) 65%, transparent);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.09);
}

.mmpi-report .panel:hover {
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.13);
}

.mmpi-report .panel-header {
  margin-bottom: 1.1rem;
}

.mmpi-form .form-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--admin-muted);
  margin-bottom: 0.35rem;
}

.mmpi-form .form-control {
  border-radius: 12px;
  border-color: var(--admin-border);
  background: var(--admin-surface-soft);
  padding: 0.62rem 0.9rem;
  font-size: 0.92rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.mmpi-form .form-control::placeholder {
  color: color-mix(in srgb, var(--admin-muted) 75%, transparent);
}

.mmpi-form .form-control:focus {
  background: var(--admin-surface);
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px var(--mmpi-accent-soft);
}

.mmpi-form textarea.form-control {
  min-height: 116px;
  resize: vertical;
}

.mmpi-form .form-control[readonly] {
  background: color-mix(in srgb, var(--admin-border) 22%, var(--admin-surface-soft));
  color: var(--admin-text);
  cursor: default;
}

.mmpi-table-card {
  border: 1px solid color-mix(in srgb, var(--admin-border) 75%, transparent);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.mmpi-note-box {
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  background: var(--admin-surface-soft);
  padding: 0.7rem 0.95rem;
}

.mmpi-note-box p {
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--admin-muted);
}

.mmpi-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.mmpi-stats-panel {
  display: flex;
  flex-direction: column;
}

.mmpi-stats-panel .mmpi-stat-grid {
  flex: 1 1 auto;
  grid-auto-rows: minmax(58px, 1fr);
}

.mmpi-stat-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  background: var(--admin-surface-soft);
  padding: 0.5rem 0.6rem;
  min-width: 0;
}

.mmpi-stat-tile .label {
  display: block;
  color: var(--admin-muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mmpi-stat-tile .value {
  display: block;
  margin-top: 0.15rem;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--admin-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mmpi-chart-wrap {
  position: relative;
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  background: var(--admin-surface-soft);
  padding: 0.5rem 0.25rem;
}

.mmpi-chart {
  display: block;
  width: 100%;
  min-width: 620px;
  height: auto;
}

.mmpi-chart .mmpi-c-plot {
  fill: var(--admin-surface);
  stroke: var(--admin-border);
}

.mmpi-chart .mmpi-c-grid {
  stroke: var(--admin-border);
  opacity: 0.75;
}

.mmpi-chart .mmpi-c-mean {
  stroke: var(--admin-pink);
}

.mmpi-chart .mmpi-c-warn {
  stroke: var(--admin-warning);
  opacity: 0.85;
}

.mmpi-chart .mmpi-c-cut {
  stroke: var(--admin-danger);
}

.mmpi-chart .mmpi-c-axis {
  fill: var(--admin-muted);
}

.mmpi-chart .mmpi-c-cut-lbl {
  fill: var(--admin-danger);
}

.mmpi-chart .mmpi-c-mean-lbl {
  fill: var(--admin-pink);
}

.mmpi-chart .mmpi-c-line {
  stroke: var(--admin-primary);
}

.mmpi-chart .mmpi-c-div {
  stroke: var(--admin-border);
}

.mmpi-chart .mmpi-c-dot {
  fill: var(--admin-primary);
}

.mmpi-chart .mmpi-c-dot.is-hot {
  fill: var(--admin-danger);
}

.mmpi-chart .mmpi-c-dot.is-q {
  fill: var(--admin-muted);
}

.mmpi-chart .mmpi-c-val {
  fill: var(--admin-text);
}

.mmpi-chart .mmpi-c-val.is-hot {
  fill: var(--admin-danger);
}

.mmpi-chart .mmpi-c-code {
  fill: var(--admin-text);
}

.mmpi-chart .mmpi-c-code.is-q {
  fill: var(--admin-muted);
}

.mmpi-chart .mmpi-c-num {
  fill: var(--admin-muted);
}

.mmpi-chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.5rem 1.6rem;
  width: 100%;
  margin: 1.75rem auto;
  padding: 1.15rem 1rem;
  font-size: 0.8rem;
  color: var(--admin-muted);
  border-top: 1px solid color-mix(in srgb, var(--admin-border) 55%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--admin-border) 55%, transparent);
}

.mmpi-chart-legend > span {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.mmpi-chart .mmpi-pt {
  transition: r 0.1s ease;
  cursor: pointer;
}

.mmpi-chart .mmpi-pt.is-hover {
  r: 6;
  stroke: #fff;
  stroke-width: 2;
}

.mmpi-chart-tip {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  white-space: nowrap;
  min-width: 132px;
  padding: 0.45rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.4;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  box-shadow: var(--admin-shadow);
  transform: translate(-50%, calc(-100% - 14px));
}

.mmpi-chart-tip.tip-below {
  transform: translate(-50%, 14px);
}

.mmpi-chart-tip .tip-title {
  font-weight: 700;
  color: var(--admin-primary-dark);
  margin-bottom: 0.15rem;
}

.mmpi-score-table {
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.mmpi-score-table th,
.mmpi-score-table td {
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--admin-border) 55%, transparent);
  padding: 0.72rem 0.6rem;
  white-space: nowrap;
  vertical-align: middle;
  font-size: 0.88rem;
}

.mmpi-score-table tbody tr:last-child td {
  border-bottom: 0;
}

.mmpi-score-table thead th {
  background: linear-gradient(180deg, var(--admin-surface-soft), color-mix(in srgb, var(--admin-primary) 5%, var(--admin-surface-soft)));
  font-weight: 700;
  color: var(--admin-text);
  border-bottom: 2px solid color-mix(in srgb, var(--admin-primary) 22%, var(--admin-border));
}

.mmpi-score-table tbody tr {
  transition: background 0.12s ease;
}

.mmpi-score-table tbody tr:hover td {
  background: color-mix(in srgb, var(--admin-primary) 4%, transparent);
}

.mmpi-score-table th:first-child,
.mmpi-score-table td:first-child {
  text-align: left;
  padding-left: 1rem;
  font-weight: 600;
}

.mmpi-score-table td:first-child {
  color: var(--admin-muted);
  font-weight: 500;
}

/* Temel Geçerlik Ölçekleri: sabit sütunlar, Ham/T dümdüz hizalı */
#mmpiValidityTable {
  table-layout: fixed;
  width: 100%;
}

#mmpiValidityTable th:nth-child(1),
#mmpiValidityTable td:nth-child(1) { width: 42%; white-space: normal; }
#mmpiValidityTable th:nth-child(2),
#mmpiValidityTable td:nth-child(2) { width: 15%; text-align: center; }
#mmpiValidityTable th:nth-child(3),
#mmpiValidityTable td:nth-child(3) { width: 18%; text-align: center; }
#mmpiValidityTable th:nth-child(4),
#mmpiValidityTable td:nth-child(4) { width: 25%; white-space: normal; }

#mmpiValidityTable td:nth-child(2) {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--admin-text);
}

.mmpi-t-pill {
  display: inline-block;
  min-width: 2.9rem;
  padding: 0.16rem 0.5rem;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  line-height: 1.25;
}

.mmpi-mini-stat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.4rem;
  padding: 0.12rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--admin-border);
  background: var(--admin-surface-soft);
  color: var(--admin-text);
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.15;
}

.mmpi-mini-stat.is-t {
  min-width: 3.1rem;
  font-weight: 800;
  border-color: transparent;
}

.mmpi-mini-stat.mmpi-tone-low {
  background: var(--admin-surface-soft);
  color: var(--admin-muted);
  border-color: var(--admin-border);
}

.mmpi-tone-danger {
  background: color-mix(in srgb, var(--admin-danger) 15%, transparent);
  color: var(--admin-danger);
}

.mmpi-tone-warning {
  background: color-mix(in srgb, var(--admin-warning) 18%, transparent);
  color: var(--admin-warning);
}

.mmpi-tone-normal {
  background: color-mix(in srgb, var(--mmpi-yes) 15%, transparent);
  color: var(--mmpi-yes);
}

.mmpi-num-ok {
  color: var(--mmpi-yes);
}

.mmpi-tone-low {
  background: var(--admin-surface-soft);
  color: var(--admin-muted);
  border: 1px solid var(--admin-border);
}

.mmpi-scale-card {
  border: 1px solid var(--admin-border);
  border-left: 4px solid var(--mmpi-accent, #2563eb);
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  background: var(--admin-surface);
  box-shadow: var(--admin-shadow-sm);
}

.mmpi-scale-card.is-validity {
  border-left-color: var(--admin-warning);
}

.mmpi-scale-card.tone-danger {
  border-left-color: var(--admin-danger);
}

.mmpi-scale-card.tone-warning {
  border-left-color: var(--admin-warning);
}

.mmpi-scale-card.tone-normal {
  border-left-color: var(--admin-success);
}

.mmpi-index-card {
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  background: var(--admin-surface);
  box-shadow: var(--admin-shadow-sm);
  height: 100%;
}

.mmpi-index-card .label {
  color: var(--admin-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.mmpi-index-card .value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 0.25rem 0;
  font-variant-numeric: tabular-nums;
}

.mmpi-index-card.tone-danger .value {
  color: var(--admin-danger);
}

.mmpi-index-card.tone-normal .value {
  color: var(--admin-success);
}

/* Geçerlik Endeksleri: 3 kart yan yana (mobilde alt alta), paneli tam doldurur */
.mmpi-idx-panel {
  display: flex;
  flex-direction: column;
}

.mmpi-idx-panel > #mmpiValidityIndices {
  flex: 1 1 auto;
}

#mmpiValidityIndices .mmpi-index-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.1rem 1.05rem;
  border-top: 3px solid var(--admin-border);
}

#mmpiValidityIndices .mmpi-index-card.tone-danger { border-top-color: var(--admin-danger); }
#mmpiValidityIndices .mmpi-index-card.tone-warning { border-top-color: var(--admin-warning); }
#mmpiValidityIndices .mmpi-index-card.tone-normal { border-top-color: var(--admin-success); }

.mmpi-idx-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

#mmpiValidityIndices .mmpi-index-card .label {
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--admin-text);
}

#mmpiValidityIndices .mmpi-index-card .value {
  font-size: 2.2rem;
  line-height: 1;
  margin: 0.1rem 0;
}

#mmpiValidityIndices .mmpi-index-card .small {
  font-size: 0.84rem;
  line-height: 1.5;
}

#mmpiValidityIndices .mmpi-mini-badge {
  font-size: 0.66rem;
  padding: 0.16rem 0.5rem;
}

@media (max-width: 991.98px) {
  .mmpi-idx-panel { display: block; }
}

.mmpi-banner {
  border-radius: 14px;
  padding: 1rem 1.25rem;
  border: 1px solid transparent;
  margin-bottom: 1rem;
}

.mmpi-banner h4 {
  font-weight: 800;
}

.mmpi-banner.tone-danger {
  background: color-mix(in srgb, var(--admin-danger) 10%, transparent);
  border-color: color-mix(in srgb, var(--admin-danger) 30%, transparent);
  color: var(--admin-danger);
}

.mmpi-banner.tone-warning {
  background: color-mix(in srgb, var(--admin-warning) 12%, transparent);
  border-color: color-mix(in srgb, var(--admin-warning) 32%, transparent);
  color: var(--admin-warning);
}

.mmpi-banner.tone-normal {
  background: color-mix(in srgb, var(--admin-success) 12%, transparent);
  border-color: color-mix(in srgb, var(--admin-success) 30%, transparent);
  color: var(--admin-success);
}

.mmpi-banner p {
  color: var(--admin-text);
}

.mmpi-item-list {
  columns: 2;
  column-gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mmpi-item-list li {
  break-inside: avoid;
  margin-bottom: 0.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px dashed color-mix(in srgb, var(--admin-border) 55%, transparent);
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--admin-text);
}

.mmpi-item-list li:last-child {
  border-bottom: 0;
}

.mmpi-ans {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.08rem 0.45rem 0.08rem 0.35rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  vertical-align: 1px;
}

.mmpi-ans .bi {
  font-size: 0.72rem;
}

.mmpi-ans.is-yes {
  background: color-mix(in srgb, var(--mmpi-yes) 18%, transparent);
  color: var(--mmpi-yes);
}

.mmpi-ans.is-no {
  background: color-mix(in srgb, var(--admin-danger) 15%, transparent);
  color: var(--admin-danger);
}

.mmpi-item-no {
  color: var(--admin-muted);
  font-weight: 700;
  margin: 0 0.15rem 0 0.3rem;
}

.mmpi-answer-card {
  border: 1px solid color-mix(in srgb, var(--admin-border) 70%, transparent);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--admin-shadow-sm);
  background: var(--admin-surface);
}

.mmpi-answer-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.1rem;
  background: var(--admin-surface-soft);
  border-bottom: 1px solid color-mix(in srgb, var(--admin-border) 50%, transparent);
}

.mmpi-answer-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--admin-muted);
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

.mmpi-answer-body {
  padding: 1.1rem;
}

.mmpi-ai-empty {
  padding: 3.5rem 1rem;
}

.mmpi-ai-empty .bi {
  font-size: 2.4rem;
  color: var(--admin-primary);
}

.mmpi-ai-card {
  border: 1px solid color-mix(in srgb, var(--admin-border) 70%, transparent);
  border-radius: 16px;
  box-shadow: var(--admin-shadow-sm);
  background: var(--admin-surface);
  padding: 1rem 1.1rem;
}

.mmpi-ai-text p {
  margin: 0 0 0.75rem;
  line-height: 1.55;
}

.mmpi-ai-text p:last-child {
  margin-bottom: 0;
}

.mmpi-ai-text ul,
.mmpi-ai-text ol {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
  line-height: 1.55;
}

.mmpi-ai-text ul:last-child,
.mmpi-ai-text ol:last-child {
  margin-bottom: 0;
}

.mmpi-ai-table-wrap {
  margin: 0 0 0.75rem;
}

.mmpi-ai-table-wrap:last-child {
  margin-bottom: 0;
}

.mmpi-ai-table {
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.mmpi-ai-table th,
.mmpi-ai-table td {
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--admin-border) 55%, transparent);
  padding: 0.55rem 0.7rem;
  white-space: normal;
  vertical-align: top;
  font-size: 0.86rem;
}

.mmpi-ai-table thead th {
  background: var(--admin-surface-soft);
  font-weight: 700;
  color: var(--admin-text);
  border-bottom: 2px solid color-mix(in srgb, var(--admin-primary) 22%, var(--admin-border));
  white-space: nowrap;
}

.mmpi-ai-table tbody tr:last-child td {
  border-bottom: 0;
}

.mmpi-ai-heading {
  font-weight: 700;
  font-size: 0.92rem;
  margin: 1rem 0 0.4rem;
  color: var(--admin-text);
}

.mmpi-ai-heading:first-child {
  margin-top: 0;
}

.mmpi-ai-review {
  margin-top: 1.1rem;
  padding: 1rem 1.1rem 1.05rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--admin-primary) 4%, var(--admin-surface-soft));
  border: 1px solid color-mix(in srgb, var(--admin-primary) 14%, var(--admin-border));
}

.mmpi-ai-review-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.mmpi-ai-review-icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--admin-primary) 12%, var(--admin-surface));
  color: var(--admin-primary);
  font-size: 1.1rem;
}

.mmpi-ai-review-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--admin-text);
}

.mmpi-ai-review-sub {
  font-size: 0.82rem;
  color: var(--admin-muted);
  line-height: 1.4;
}

.mmpi-ai-review-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--admin-muted);
  margin-bottom: 0.45rem;
}

.mmpi-ai-score-scale {
  display: flex;
  gap: 0.35rem;
}

.mmpi-ai-score-pill {
  --pill-tone: var(--admin-danger);
  flex: 1 1 0;
  min-width: 0;
  display: inline-grid;
  place-items: center;
  height: 2.4rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--pill-tone) 28%, var(--admin-border));
  background: var(--admin-surface);
  color: color-mix(in srgb, var(--pill-tone) 80%, var(--admin-text));
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.mmpi-ai-score-pill.is-mid {
  --pill-tone: #f5b000;
}

.mmpi-ai-score-pill.is-high {
  --pill-tone: #16b55b;
}

.btn-check:checked + .mmpi-ai-score-pill.is-mid {
  color: #3d2a00;
}

html[data-theme="dark"] .mmpi-ai-score-pill.is-mid {
  --pill-tone: var(--admin-warning);
}

html[data-theme="dark"] .mmpi-ai-score-pill.is-high {
  --pill-tone: var(--admin-success);
}

html[data-theme="dark"] .btn-check:checked + .mmpi-ai-score-pill.is-mid {
  color: #fff;
}

.mmpi-ai-score-pill:hover {
  background: color-mix(in srgb, var(--pill-tone) 10%, var(--admin-surface));
  transform: translateY(-1px);
}

.btn-check:checked + .mmpi-ai-score-pill {
  background: var(--pill-tone);
  border-color: var(--pill-tone);
  color: #fff;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--pill-tone) 30%, transparent);
}

.btn-check:focus-visible + .mmpi-ai-score-pill {
  box-shadow: var(--admin-ring);
}

.mmpi-ai-score-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--admin-muted);
  margin: 0.35rem 0.1rem 1rem;
}

.mmpi-ai-review textarea {
  resize: vertical;
  min-height: 5.5rem;
  border-radius: 10px;
  font-size: 0.9rem;
  background: var(--admin-surface);
}

.mmpi-ai-review-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.mmpi-ai-reviewed-at {
  font-size: 0.8rem;
  color: var(--admin-muted);
}

.mmpi-ai-review-foot .btn {
  margin-left: auto;
}

@media (max-width: 575.98px) {
  .mmpi-ai-score-scale {
    gap: 0.2rem;
  }

  .mmpi-ai-score-pill {
    height: 2.1rem;
    font-size: 0.82rem;
    border-radius: 8px;
  }

  .mmpi-ai-review-foot .btn {
    width: 100%;
  }
}

/* status banner + warnings */
.mmpi-status-banner {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid transparent;
}

.mmpi-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  font-size: 1.15rem;
}

.mmpi-status-title {
  display: block;
  font-weight: 700;
  font-size: 0.98rem;
}

.mmpi-status-fine {
  color: var(--admin-muted);
  margin-top: 0.15rem;
}

.mmpi-status-banner.tone-danger {
  background: color-mix(in srgb, var(--admin-danger) 12%, transparent);
  border-color: color-mix(in srgb, var(--admin-danger) 32%, transparent);
}
.mmpi-status-banner.tone-danger .mmpi-status-icon { background: color-mix(in srgb, var(--admin-danger) 20%, transparent); color: var(--admin-danger); }
.mmpi-status-banner.tone-danger .mmpi-status-title { color: var(--admin-danger); }

.mmpi-status-banner.tone-warning {
  background: color-mix(in srgb, var(--admin-warning) 13%, transparent);
  border-color: color-mix(in srgb, var(--admin-warning) 34%, transparent);
}
.mmpi-status-banner.tone-warning .mmpi-status-icon { background: color-mix(in srgb, var(--admin-warning) 22%, transparent); color: var(--admin-warning); }
.mmpi-status-banner.tone-warning .mmpi-status-title { color: var(--admin-warning); }

.mmpi-status-banner.tone-normal {
  background: color-mix(in srgb, var(--mmpi-yes) 13%, transparent);
  border-color: color-mix(in srgb, var(--mmpi-yes) 32%, transparent);
}
.mmpi-status-banner.tone-normal .mmpi-status-icon { background: color-mix(in srgb, var(--mmpi-yes) 20%, transparent); color: var(--mmpi-yes); }
.mmpi-status-banner.tone-normal .mmpi-status-title { color: var(--mmpi-yes); }

.mmpi-warn-box {
  border: 1px solid color-mix(in srgb, var(--admin-warning) 34%, transparent);
  background: color-mix(in srgb, var(--admin-warning) 10%, transparent);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
}

.mmpi-warn-head {
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--admin-warning);
  margin-bottom: 0.4rem;
}

.mmpi-warn-box ul {
  padding-left: 1.1rem;
  margin: 0;
}

.mmpi-warn-box li {
  font-size: 0.86rem;
  margin-bottom: 0.35rem;
  color: var(--admin-text);
}

.mmpi-mini-badge {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}
.mmpi-mini-badge.tone-danger { background: color-mix(in srgb, var(--admin-danger) 16%, transparent); color: var(--admin-danger); }
.mmpi-mini-badge.tone-warning { background: color-mix(in srgb, var(--admin-warning) 18%, transparent); color: var(--admin-warning); }
.mmpi-mini-badge.tone-normal { background: color-mix(in srgb, var(--mmpi-yes) 16%, transparent); color: var(--mmpi-yes); }

.mmpi-index-card.tone-danger { border-color: color-mix(in srgb, var(--admin-danger) 40%, var(--admin-border)); }
.mmpi-index-card.tone-warning { border-color: color-mix(in srgb, var(--admin-warning) 40%, var(--admin-border)); }

/* detail cards (validity + clinical) */
.mmpi-detail-card {
  border: 1px solid color-mix(in srgb, var(--admin-border) 72%, transparent);
  border-radius: 14px;
  overflow: hidden;
  background: var(--admin-surface);
  box-shadow: var(--admin-shadow-sm);
}

.mmpi-detail-card.is-hot {
  border-color: color-mix(in srgb, var(--admin-danger) 42%, var(--admin-border));
}

.mmpi-detail-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 0;
  background: var(--admin-surface-soft);
  text-align: left;
  cursor: pointer;
}

.mmpi-detail-head[aria-expanded="true"] {
  border-bottom: 1px solid color-mix(in srgb, var(--admin-border) 55%, transparent);
}

.mmpi-scale-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.82rem;
}

.mmpi-detail-name {
  margin-right: auto;
  min-width: 0;
}

.mmpi-detail-name strong {
  font-size: 0.94rem;
}

.mmpi-hot-tag {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--admin-danger) 16%, transparent);
  color: var(--admin-danger);
  white-space: nowrap;
  vertical-align: 1px;
}

.mmpi-detail-stats {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.mmpi-detail-raw {
  display: inline-block;
  min-width: 3.4rem;
  padding: 0.16rem 0.5rem;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: var(--admin-surface-soft);
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--admin-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.mmpi-detail-chev {
  color: var(--admin-muted);
  transition: transform 0.18s ease;
}

.mmpi-detail-head[aria-expanded="true"] .mmpi-detail-chev {
  transform: rotate(180deg);
}

.mmpi-detail-body {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mmpi-detail-section {
  border-left: 3px solid color-mix(in srgb, var(--admin-primary) 45%, var(--admin-border));
  padding-left: 0.85rem;
}

.mmpi-detail-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--admin-muted);
  margin-bottom: 0.35rem;
}

.mmpi-detail-section p {
  font-size: 0.88rem;
  line-height: 1.6;
}

.mmpi-detail-note {
  font-size: 0.8rem;
  color: var(--admin-muted);
  background: var(--admin-surface-soft);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  margin: 0;
}

.mmpi-tech {
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: var(--admin-surface-soft);
  padding: 0.5rem 0.85rem;
}

.mmpi-tech > summary {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--admin-primary-dark);
  cursor: pointer;
}

.mmpi-tech-body {
  padding-top: 0.75rem;
}

.mmpi-tech-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.mmpi-tech-grid div {
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-surface);
  padding: 0.4rem 0.6rem;
}

.mmpi-tech-grid span {
  display: block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--admin-muted);
  font-weight: 700;
}

.mmpi-tech-grid strong {
  font-size: 0.82rem;
}

.mmpi-tech-items {
  font-family: var(--cc-mono, ui-monospace, monospace);
  font-size: 0.74rem;
  line-height: 1.6;
  color: var(--admin-text);
  word-break: break-word;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.75rem;
}

.mmpi-code-callout {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.9rem 0 0;
  padding: 0.6rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--mmpi-accent) 30%, transparent);
  border-left: 4px solid var(--mmpi-accent);
  background: var(--mmpi-accent-soft);
  border-radius: 12px;
  font-size: 0.9rem;
}

.mmpi-code-callout > .bi {
  font-size: 1.15rem;
  color: var(--mmpi-accent);
  flex-shrink: 0;
}

.mmpi-code-callout-label {
  font-weight: 700;
}

.mmpi-code-callout-value {
  display: inline-block;
  margin: 0 0.45rem;
  padding: 0.12rem 0.6rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  background: linear-gradient(135deg, var(--mmpi-accent), var(--mmpi-accent-2));
  border-radius: 8px;
}

.mmpi-code-callout-note {
  color: var(--admin-muted);
  font-size: 0.82rem;
}

.mmpi-code-callout.is-empty {
  border-color: var(--admin-border);
  border-left-color: var(--admin-border);
  background: var(--admin-surface);
}

.mmpi-code-callout.is-empty > .bi {
  color: var(--admin-muted);
}

@media (max-width: 575.98px) {
  .mmpi-tech-grid {
    grid-template-columns: 1fr;
  }

  /* accordion header: chip + name üstte (chevron sağ üstte sabit),
     T / Ham chip'leri sağ ALT köşede sabit */
  .mmpi-detail-head {
    position: relative;
    flex-wrap: wrap;
    row-gap: 0.4rem;
    padding: 0.85rem 2.4rem 2.6rem 1rem;
  }

  .mmpi-detail-head .mmpi-detail-name {
    flex-basis: 100%;
  }

  .mmpi-detail-head .mmpi-detail-chev {
    position: absolute;
    top: 0.95rem;
    right: 1rem;
  }

  .mmpi-detail-stats {
    position: absolute;
    right: 1rem;
    bottom: 0.7rem;
    justify-content: flex-end;
  }

  /* Soru Yanıtları: başlık tam satır, rozetler birlikte 2. satırda ortalı */
  .mmpi-answer-head {
    justify-content: center;
    row-gap: 0.45rem;
  }

  .mmpi-answer-head > strong.me-auto {
    flex-basis: 100%;
    margin-right: 0 !important;
    text-align: center;
  }

  /* Temel Geçerlik Ölçekleri: mobilde tam sığsın */
  #mmpiValidityTable th,
  #mmpiValidityTable td {
    padding: 0.5rem 0.3rem;
    font-size: 0.78rem;
  }

  #mmpiValidityTable th:nth-child(1),
  #mmpiValidityTable td:nth-child(1) { width: 36%; }
  #mmpiValidityTable th:nth-child(2),
  #mmpiValidityTable td:nth-child(2) { width: 14%; }
  #mmpiValidityTable th:nth-child(3),
  #mmpiValidityTable td:nth-child(3) { width: 22%; }
  #mmpiValidityTable th:nth-child(4),
  #mmpiValidityTable td:nth-child(4) { width: 28%; white-space: normal; }

  #mmpiValidityTable .mmpi-t-pill {
    min-width: 2.4rem;
    padding: 0.14rem 0.35rem;
  }

  /* MMPI sonuç ekranı üst araç şeridi: mobilde tek sütun, tam genişlik */
  .mmpi-head-panel .panel-header > .d-flex {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .mmpi-head-panel .panel-header > .d-flex > .btn,
  .mmpi-head-panel .panel-header > .d-flex > .btn-group {
    width: 100%;
  }

  .mmpi-code-callout {
    align-items: flex-start;
    margin-left: 0;
  }
}

@media (max-width: 575.98px) {
  .mmpi-item-list {
    columns: 1;
  }

  /* grafiği ekrana sığdır (yatay kaydırma yok) */
  .mmpi-chart-wrap {
    overflow-x: visible;
    padding: 0.4rem 0.15rem;
  }

  .mmpi-chart {
    min-width: 0;
  }

  .mmpi-stat-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Mobil düzen ve yatay taşma düzeltmeleri
   ============================================================ */

html,
body {
  overflow-x: hidden;
}

.min-w-0 {
  min-width: 0 !important;
}

.text-truncate {
  min-width: 0;
}

.panel.row {
  margin: 0;
  row-gap: 1rem;
}

.panel.row > * {
  margin-top: 0;
}

.panel.row > .row {
  margin-left: 0;
  margin-right: 0;
}

.input-group:not(.has-validation) {
  flex-wrap: nowrap;
}

.input-group:not(.has-validation) > .form-control {
  min-width: 0;
}

.card .d-flex.justify-content-end.gap-2.border-top {
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

.modal-body {
  overflow-wrap: break-word;
  overflow-x: hidden;
}

#confirmModalBody,
#infoModalBody {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.clinic-table-scroll {
  -webkit-overflow-scrolling: touch;
}

.clinic-density-table--psy {
  min-width: 560px;
}

.clinic-density-table--sa {
  min-width: 780px;
}

.clinic-density-table--sa th {
  white-space: normal;
  line-height: 1.15;
  vertical-align: bottom;
}

@media (max-width: 575.98px) {
  .panel-header {
    gap: 0.75rem;
  }

  .panel-header .d-flex {
    width: 100%;
    flex-wrap: wrap;
  }

  .panel-header .input-group,
  .panel-header .form-select,
  .panel-header .date-field {
    max-width: none !important;
    width: 100%;
  }

  .panel-header .d-flex > .btn {
    flex: 1 1 auto;
  }

  .panel-header .btn-group {
    width: 100%;
  }

  .panel-header .btn-group > .btn {
    flex: 1 1 0;
  }

  .panel-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-toolbar > .d-flex {
    width: 100%;
    flex-wrap: wrap;
  }

  .panel-toolbar .form-select {
    max-width: none !important;
    flex: 1 1 120px;
  }

  .panel-toolbar .date-field {
    max-width: none !important;
    flex: 1 1 140px;
  }

  .modal-footer {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .modal-footer > * {
    margin: 0 !important;
  }

  .modal-footer > .btn {
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  .card-body.d-flex.align-items-center.gap-3 {
    flex-wrap: wrap;
  }

  .card-body.d-flex.align-items-center.gap-3 > .btn {
    margin-left: auto;
  }

  #notificationDropdown .dropdown-menu.show,
  #notificationDropdown .dropdown-menu.notification-menu {
    position: fixed !important;
    inset: auto !important;
    top: 3.75rem !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: min(360px, calc(100vw - 1.5rem)) !important;
    max-width: calc(100vw - 1.5rem) !important;
    z-index: 1050 !important;
  }

  .clinic-row2-panel {
    height: auto;
    min-height: 300px;
  }

  .hourly-density-area {
    height: 150px;
  }

  .hourly-density-chart {
    gap: 4px;
    padding: 0 2px;
  }

  .hourly-density-bar-label {
    font-size: 0.55rem;
  }

  .hourly-density-yaxis {
    width: 44px;
  }

  .mmpi-tabbar {
    padding-top: 0.75rem;
  }

  .mmpi-tabbar .nav-pills {
    gap: 0.4rem;
  }

  .mmpi-tabbar .nav-pills .nav-link {
    padding: 0.35rem 0.7rem;
    font-size: 0.74rem;
  }

  .mmpi-tabbar .nav-pills .nav-link > i {
    display: none;
  }

  .mmpi-tabbar .nav-pills .nav-link.active {
    transform: none;
    scale: 1;
    box-shadow: none;
    outline-offset: 1px;
  }
}

@media (max-width: 767.98px) {
  .clinic-table-scroll,
  .table-responsive,
  .mmpi-chart-wrap,
  .hide-scrollbar-x {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .clinic-table-scroll::-webkit-scrollbar,
  .table-responsive::-webkit-scrollbar,
  .mmpi-chart-wrap::-webkit-scrollbar,
  .hide-scrollbar-x::-webkit-scrollbar {
    display: none;
  }
}

@media print {
  .admin-sidebar,
  .sidebar-backdrop,
  .admin-navbar,
  .admin-footer,
  .no-print {
    display: none !important;
  }

  .admin-main {
    margin: 0 !important;
  }

  .dashboard-content,
  body {
    background: #ffffff !important;
  }

  .panel,
  .mmpi-scale-card,
  .mmpi-chart-wrap {
    box-shadow: none !important;
    break-inside: avoid;
  }
}

/* Hata / eksik bildirimleri */
.feedback-dropzone {
  border: 2px dashed var(--admin-border);
  border-radius: 12px;
  background: var(--admin-surface-soft);
  color: var(--admin-muted);
  padding: 18px;
  text-align: center;
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.feedback-dropzone:hover,
.feedback-dropzone:focus-visible,
.feedback-dropzone.is-dragover {
  border-color: var(--admin-primary);
  color: var(--admin-primary);
  outline: none;
}

.feedback-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-thumbs img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--admin-border);
  background: var(--admin-surface-soft);
}

.feedback-thumb-item {
  position: relative;
}

.feedback-thumb-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--admin-danger);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1;
}

.feedback-description {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.feedback-description-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Arama ve "Yeni Bildirim" her ekran genişliğinde yan yana kalsın */
.panel-header .d-flex.feedback-toolbar {
  flex-wrap: nowrap;
}

.panel-header .feedback-toolbar .input-group {
  flex: 1 1 auto;
  width: 240px;
  min-width: 0;
}

.panel-header .feedback-toolbar > .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .panel-header .feedback-toolbar .input-group {
    width: auto;
  }
}

.feedback-section-label {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.feedback-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  background: var(--admin-surface-soft);
}

.feedback-message {
  display: flex;
  justify-content: flex-start;
}

.feedback-message.is-mine {
  justify-content: flex-end;
}

.feedback-message-bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 12px 12px 12px 4px;
  border: 1px solid var(--admin-border);
  background: var(--admin-surface);
  color: var(--admin-text);
  font-size: 0.875rem;
}

.feedback-message.is-mine .feedback-message-bubble {
  border-radius: 12px 12px 4px 12px;
  border-color: transparent;
  background: var(--admin-primary-dark);
  color: #fff;
}

.feedback-message-meta {
  font-size: 0.72rem;
  opacity: 0.75;
  margin-bottom: 2px;
}
