body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f9fafb;
  color: #101828;
}

.admin-layout {
  min-height: 100vh;
}

.admin-sidebar {
  width: 256px;
  min-height: 100vh;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  padding: 0;
}

.sidebar-brand {
  height: 65px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  padding: 0 16px;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #101828;
  font-weight: 600;
}

.logo-box {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #155dfc;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  overflow-y: auto;
  align-items: stretch;
}

.sidebar-nav .nav-link {
  height: 36px;
  border-radius: 10px;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  color: #364153;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  padding: 0 12px !important;
  text-decoration: none;
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  overflow: visible !important;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  direction: ltr;
  position: relative !important;
  transform: none !important;
  letter-spacing: 0 !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}

.sidebar-nav .nav-link .bi {
  font-size: 17px;
  width: 20px;
  min-width: 20px;
  text-align: center;
  flex: 0 0 20px;
  position: static !important;
  transform: none !important;
  line-height: 1 !important;
  font-family: 'bootstrap-icons' !important;
}

.sidebar-nav .nav-link span {
  display: inline-block !important;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  vertical-align: middle;
  position: static !important;
  transform: none !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 20px !important;
  color: inherit !important;
}

.sidebar-nav .nav-link.active {
  background: #eff6ff;
  color: #1447e6;
}

.sidebar-user {
  border-top: 1px solid #e5e7eb;
  margin-top: auto;
  min-height: 73px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.sidebar-user .avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1447e6;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-user .name {
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.sidebar-user .email {
  font-size: 12px;
  color: #6a7282;
  line-height: 16px;
}

.admin-main {
  background: #f9fafb;
  flex: 1;
}

.topbar {
  height: 45px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 0 16px;
}

.date-text {
  font-size: 14px;
  color: #6a7282;
}

.dashboard-wrap {
  padding: 24px;
}

.dashboard-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
  margin: 0;
}

.dashboard-subtitle {
  font-size: 14px;
  color: #6a7282;
}

.kpi-card {
  height: 86px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px;
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kpi-label {
  font-size: 14px;
  color: #6a7282;
  line-height: 20px;
}

.kpi-value {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
}

.bg-blue-soft { background: #dbeafe; color: #155dfc; }
.bg-orange-soft { background: #ffedd4; color: #f97316; }
.bg-purple-soft { background: #f3e8ff; color: #9333ea; }
.bg-green-soft { background: #dcfce7; color: #16a34a; }
.bg-red-soft { background: #ffe2e2; color: #ef4444; }
.bg-indigo-soft { background: #e0e7ff; color: #4f46e5; }

.dashboard-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 18px 0;
}

.chart-cases,
.chart-status {
  height: 300px;
}

.status-chart-wrap {
  position: relative;
}

.status-label {
  position: absolute;
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}

.status-label-new {
  right: 8px;
  top: 38%;
  color: #3b82f6;
}

.status-label-review {
  right: 38px;
  top: 8%;
  color: #f59e0b;
}

.status-label-progress {
  left: 26px;
  top: 22%;
  color: #8b5cf6;
}

.status-label-completed {
  left: 54%;
  bottom: 2%;
  color: #10b981;
}

.recent-table th {
  color: #6a7282;
  font-weight: 500;
  font-size: 14px;
  border-bottom-color: #e5e7eb;
  white-space: nowrap;
}

.recent-table td {
  border-bottom-color: #f3f4f6;
  color: #4a5565;
  font-size: 14px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

.chip-blue { background: #dbeafe; color: #193cb8; }
.chip-gray { background: #f3f4f6; color: #1e2939; }
.chip-red { background: #ffe2e2; color: #9f0712; }
.chip-orange { background: #ffedd4; color: #9f2d00; }
.chip-purple { background: #f3e8ff; color: #6e11b0; }
.chip-green { background: #dcfce7; color: #016630; }

.admin-offcanvas-sidebar .offcanvas-title {
  font-size: 16px;
  font-weight: 600;
}

@media (max-width: 991.98px) {
  .dashboard-wrap {
    padding: 18px;
  }

  .dashboard-title {
    font-size: 24px;
  }

  .section-title {
    font-size: 18px;
  }

  .kpi-value {
    font-size: 24px;
  }

  .status-label-progress,
  .status-label-review,
  .status-label-new,
  .status-label-completed {
    display: none;
  }
}

/* Rebuilt Sidebar */
.so-sidebar {
  width: 256px;
  min-width: 256px;
  height: 100vh;
  position: sticky;
  top: 0;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  overflow: hidden;
}

.so-sidebar__brand {
  height: 65px;
  border-bottom: 1px solid #e5e7eb;
  padding: 0 16px;
  display: flex;
  align-items: center;
}

.so-sidebar__brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #101828;
}

.so-sidebar__logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #155dfc;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.so-sidebar__title {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

.so-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.so-sidebar__item {
  min-height: 36px;
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #364153;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.so-sidebar__item i {
  width: 20px;
  min-width: 20px;
  text-align: center;
  font-size: 16px;
  line-height: 1;
}

.so-sidebar__item span {
  white-space: nowrap;
}

.so-sidebar__item:hover {
  background: #f3f4f6;
  color: #101828;
}

.so-sidebar__item.is-active {
  background: #eff6ff;
  color: #1447e6;
}

.so-sidebar__user {
  border-top: 1px solid #e5e7eb;
  min-height: 73px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.so-sidebar__avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dbeafe;
  color: #1447e6;
  font-size: 14px;
  font-weight: 500;
}

.so-sidebar__name {
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: #101828;
}

.so-sidebar__email {
  font-size: 12px;
  line-height: 16px;
  color: #6a7282;
}

@media (max-width: 991.98px) {
  .so-sidebar {
    position: static;
    height: auto;
  }
}

/* Case Inbox */
.case-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.case-search-wrap {
  position: relative;
  width: min(460px, 100%);
}

.case-search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6a7282;
  font-size: 14px;
}

.case-search {
  height: 42px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding-left: 36px;
  font-size: 14px;
}

.case-search:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
}

.case-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.case-filter {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #364153;
  border-radius: 999px;
  min-height: 32px;
  padding: 6px 12px;
  font-size: 13px;
  line-height: 18px;
}

.case-filter.is-active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1447e6;
}

.case-inbox-table th,
.case-inbox-table td {
  white-space: nowrap;
}

.case-inbox-table td.case-condition-cell {
  white-space: normal;
  max-width: 280px;
  vertical-align: middle;
}

.case-inbox-meta-bar {
  border-color: #e5e7eb !important;
}

.case-action-btn {
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #344054;
  background: #fff;
  min-width: 58px;
}

.case-action-btn:hover {
  background: #f9fafb;
  color: #101828;
}

.case-inbox-case-link {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.case-inbox-case-link:hover {
  color: #155dfc;
  text-decoration: underline;
}

.case-doctor-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.case-doctor-pick {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.case-doctor-pick.is-selected {
  border-color: #93c5fd;
  background: #eff6ff;
}

.case-doctor-pick:hover {
  border-color: #bfdbfe;
}

.case-doctor-pick input {
  margin-top: 4px;
  flex-shrink: 0;
  accent-color: #155dfc;
}

.case-doctor-pick-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.case-doctor-pick-name {
  font-weight: 600;
  font-size: 14px;
  color: #101828;
}

.case-doctor-pick-email {
  font-size: 13px;
  color: #6a7282;
}

.case-doctor-pick-status {
  font-size: 12px;
  color: #6a7282;
}

/* Case Tracking */
.tracking-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tracking-search-wrap {
  position: relative;
  width: min(460px, 100%);
}

.tracking-search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6a7282;
  font-size: 14px;
}

.tracking-search {
  height: 42px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding-left: 36px;
  font-size: 14px;
}

.tracking-search:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
}

.tracking-filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tracking-filter {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #364153;
  border-radius: 999px;
  min-height: 32px;
  padding: 6px 12px;
  font-size: 13px;
  line-height: 18px;
}

.tracking-filter.is-active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1447e6;
}

.tracking-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.tracking-summary-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.tracking-summary-card .label {
  font-size: 13px;
  color: #6a7282;
  line-height: 18px;
}

.tracking-summary-card .value {
  font-size: 24px;
  font-weight: 600;
  color: #101828;
  line-height: 32px;
}

.tracking-list {
  display: flex;
  flex-direction: column;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.tracking-row {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f3f5;
  background: #fff;
}

.tracking-row:last-child {
  border-bottom: 0;
}

.tracking-meta .case-id {
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  color: #101828;
}

.tracking-meta .case-subtext {
  font-size: 12px;
  line-height: 16px;
  color: #6a7282;
}

.tracking-wizard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.tracking-step {
  position: relative;
  text-align: center;
  font-size: 11px;
  color: #98a2b3;
  padding-top: 22px;
  white-space: nowrap;
}

.tracking-step::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #d0d5dd;
  background: #fff;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.tracking-step::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  width: calc(100% + 10px);
  height: 2px;
  background: #e4e7ec;
  z-index: 1;
}

.tracking-step:last-child::after {
  display: none;
}

.tracking-step.is-done {
  color: #016630;
}

.tracking-step.is-done::before {
  background: #10b981;
  border-color: #10b981;
}

.tracking-step.is-done::after {
  background: #10b981;
}

.tracking-step.is-current {
  color: #1447e6;
  font-weight: 600;
}

.tracking-step.is-current::before {
  background: #3b82f6;
  border-color: #3b82f6;
}

.tracking-time {
  font-size: 12px;
  color: #6a7282;
  white-space: nowrap;
}

.tracking-case-link {
  color: inherit;
  text-decoration: none;
}

.tracking-case-link:hover {
  color: #155dfc;
  text-decoration: underline;
}

@media (max-width: 991.98px) {
  .tracking-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tracking-row {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

/* My Worklist */
.worklist-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.worklist-search-wrap {
  position: relative;
  width: min(460px, 100%);
}

.worklist-search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6a7282;
  font-size: 14px;
}

.worklist-search {
  height: 42px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding-left: 36px;
  font-size: 14px;
}

.worklist-search:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
}

.worklist-filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.worklist-filter {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #364153;
  border-radius: 999px;
  min-height: 32px;
  padding: 6px 12px;
  font-size: 13px;
  line-height: 18px;
}

.worklist-filter.is-active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1447e6;
}

.worklist-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.worklist-summary-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.worklist-summary-card .label {
  font-size: 13px;
  color: #6a7282;
  line-height: 18px;
}

.worklist-summary-card .value {
  font-size: 24px;
  font-weight: 600;
  color: #101828;
  line-height: 32px;
}

.worklist-table th,
.worklist-table td {
  white-space: nowrap;
}

.worklist-deadline {
  font-size: 13px;
  line-height: 18px;
  color: #475467;
}

.worklist-deadline.deadline-soon {
  color: #9f0712;
  font-weight: 600;
}

.worklist-action-btn {
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #344054;
  background: #fff;
  min-width: 82px;
}

.worklist-action-btn:hover {
  background: #f9fafb;
  color: #101828;
}

@media (max-width: 991.98px) {
  .worklist-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Quality Check */
.qc-back-btn {
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #344054;
  border-radius: 8px;
  font-size: 12px;
  min-height: 32px;
}

.qc-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.qc-meta-label {
  display: block;
  font-size: 12px;
  color: #6a7282;
  line-height: 16px;
  margin-bottom: 2px;
}

.qc-meta-value {
  font-size: 12px;
  font-weight: 600;
  color: #101828;
  line-height: 16px;
}

.qc-opinion p {
  font-size: 12px;
  color: #4a5565;
  line-height: 18px;
  margin-bottom: 10px;
}

.qc-opinion p strong {
  color: #101828;
  font-weight: 600;
}

.qc-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qc-checkitem {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  min-height: 36px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  font-size: 12px;
  color: #101828;
  cursor: pointer;
}

.qc-checkitem .form-check-input {
  width: 1em;
  height: 1em;
  margin-top: 0.15em;
  cursor: pointer;
}

.qc-checkitem .form-check-label {
  cursor: pointer;
  line-height: 1.35;
}

.qc-feedback {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 12px;
  color: #475467;
}

.qc-feedback:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
}

.qc-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.qc-btn-secondary {
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #344054;
  border-radius: 8px;
  font-size: 12px;
  min-height: 32px;
}

.qc-btn-primary {
  border: 1px solid #1f2937;
  background: #1f2937;
  color: #fff;
  border-radius: 8px;
  font-size: 12px;
  min-height: 32px;
}

.qc-note {
  margin-top: 8px;
  text-align: right;
  font-size: 11px;
  color: #f97316;
}

@media (max-width: 991.98px) {
  .qc-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qc-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .qc-note {
    text-align: left;
  }
}

/* Communication Center */
.comm-search-wrap {
  position: relative;
  width: min(460px, 100%);
}

.comm-search-wrap.full {
  width: 100%;
}

.comm-search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6a7282;
  font-size: 14px;
}

.comm-search {
  height: 42px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding-left: 36px;
  font-size: 14px;
}

.comm-search:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
}

.comm-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.comm-stat-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.comm-stat-card .label {
  font-size: 11px;
  line-height: 16px;
  color: #6a7282;
  margin-bottom: 6px;
}

.comm-stat-card .value {
  font-size: 26px;
  line-height: 32px;
  font-weight: 600;
  color: #101828;
}

.comm-table th,
.comm-table td {
  white-space: nowrap;
}

.comm-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  line-height: 14px;
}

.comm-status-pill.pending {
  background: #111827;
  color: #fff;
}

.comm-status-pill.read {
  background: #f3f4f6;
  color: #111827;
}

.comm-view-btn {
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #111827;
  border-radius: 8px;
  font-size: 12px;
  line-height: 16px;
  min-width: 68px;
}

@media (max-width: 1199.98px) {
  .comm-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Template Management */
.template-management-page .dashboard-title {
  font-size: 1.125rem;
  line-height: 1.35;
}

.template-management-page .dashboard-subtitle {
  font-size: 12px;
}

.template-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.template-new-btn {
  background: #111827;
  color: #fff;
  border: 1px solid #111827;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  min-height: 30px;
  padding: 5px 10px;
}

.template-new-btn:hover {
  background: #0b1220;
  color: #fff;
}

.template-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.template-stat-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.template-stat-card .label {
  font-size: 11px;
  line-height: 1.35;
  color: #6a7282;
  margin-bottom: 8px;
}

.template-stat-card .value {
  font-size: 1.25rem;
  line-height: 1.2;
  font-weight: 600;
  color: #111827;
}

.template-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.template-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.template-item-main {
  min-width: 0;
}

.template-item-title {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.template-type-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  padding: 2px 7px;
  font-size: 9px;
  line-height: 1.2;
  font-weight: 600;
}

.template-item-sub {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
  color: #6a7282;
}

.template-item-actions {
  display: flex;
  gap: 8px;
}

.template-action-btn {
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #111827;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.3;
  min-height: 30px;
  min-width: 54px;
}

@media (max-width: 991.98px) {
  .template-stats-grid {
    grid-template-columns: 1fr;
  }

  .template-item-title {
    font-size: 14px;
    line-height: 1.35;
  }

  .template-item-sub {
    font-size: 11px;
    line-height: 1.35;
  }
}

/* Turnaround Time Monitor */
.ttm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ttm-kpi-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  min-height: 82px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ttm-kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.ttm-kpi-icon.icon-blue { background: #dbeafe; color: #2563eb; }
.ttm-kpi-icon.icon-red { background: #ffe2e2; color: #ef4444; }
.ttm-kpi-icon.icon-green { background: #dcfce7; color: #16a34a; }

.ttm-kpi-label {
  font-size: 13px;
  color: #6a7282;
  line-height: 18px;
}

.ttm-kpi-value {
  font-size: 31px;
  line-height: 32px;
  font-weight: 600;
  color: #111827;
}

.ttm-kpi-footnote {
  margin-top: 6px;
  line-height: 1.35;
  max-width: 220px;
}

.ttm-chart-wrap {
  height: 280px;
}

.ttm-table th,
.ttm-table td {
  white-space: nowrap;
}

.ttm-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 10px;
  line-height: 14px;
  font-weight: 600;
  background: #e11d48;
  color: #fff;
}

@media (max-width: 991.98px) {
  .ttm-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* Billing */
.billing-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.billing-kpi-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  min-height: 82px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.billing-kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.billing-kpi-icon.icon-green { background: #dcfce7; color: #16a34a; }
.billing-kpi-icon.icon-blue { background: #dbeafe; color: #2563eb; }
.billing-kpi-icon.icon-orange { background: #ffedd4; color: #f97316; }
.billing-kpi-icon.icon-purple { background: #f3e8ff; color: #9333ea; }

.billing-kpi-label {
  font-size: 13px;
  line-height: 18px;
  color: #6a7282;
}

.billing-kpi-value {
  font-size: 32px;
  line-height: 34px;
  font-weight: 600;
  color: #111827;
}

.billing-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.billing-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.billing-search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6a7282;
  font-size: 14px;
}

.billing-search {
  height: 40px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding-left: 36px;
  font-size: 13px;
}

.billing-search:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
}

.billing-export-btn {
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #111827;
  border-radius: 10px;
  font-size: 12px;
  min-height: 40px;
  padding: 8px 14px;
}

.billing-table th,
.billing-table td {
  white-space: nowrap;
}

.billing-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  line-height: 14px;
  font-weight: 600;
}

.billing-status-pill.paid {
  background: #111827;
  color: #fff;
}

.billing-status-pill.pending {
  background: #f3f4f6;
  color: #111827;
}

.billing-status-pill.failed {
  background: #fee2e2;
  color: #b91c1c;
}

@media (max-width: 991.98px) {
  .billing-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Audit Logs */
.audit-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.audit-kpi-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  min-height: 82px;
  padding: 12px;
}

.audit-kpi-label {
  font-size: 13px;
  line-height: 18px;
  color: #6a7282;
  margin-bottom: 10px;
}

.audit-kpi-value {
  font-size: 32px;
  line-height: 34px;
  font-weight: 600;
  color: #111827;
}

.audit-search-wrap {
  position: relative;
}

.audit-search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6a7282;
  font-size: 14px;
}

.audit-search {
  height: 40px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding-left: 36px;
  font-size: 13px;
}

.audit-search:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
}

.audit-table th,
.audit-table td {
  white-space: nowrap;
}

.audit-action-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  padding: 2px 8px;
  font-size: 10px;
  line-height: 14px;
  font-weight: 600;
}

@media (max-width: 991.98px) {
  .audit-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Login --- */
.admin-login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #f0f4ff 0%, #f9fafb 45%, #eef2ff 100%);
}

.admin-login-wrap {
  width: 100%;
  max-width: 400px;
  padding: 24px;
}

.admin-login-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
  padding: 32px 28px;
}

.admin-login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-login-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #155dfc;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.admin-login-title {
  font-size: 18px;
  font-weight: 700;
  color: #101828;
  line-height: 1.2;
}

.admin-login-sub {
  font-size: 13px;
  color: #6a7282;
  margin-top: 2px;
}

.admin-login-input {
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 10px 12px;
  font-size: 14px;
}

.admin-login-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
}

.admin-login-btn {
  border-radius: 10px;
  font-weight: 600;
  padding: 10px 16px;
}

.so-sidebar__logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #6a7282;
  text-decoration: none;
}

.so-sidebar__logout:hover {
  color: #155dfc;
}

/* Case details */
.topbar-notify {
  text-decoration: none;
  border: none;
  line-height: 1;
}

.topbar-notify:hover {
  color: #155dfc !important;
}

.topbar-notify-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #fff;
}

.case-details-breadcrumb {
  font-size: 14px;
}

.case-details-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6a7282;
  text-decoration: none;
  font-weight: 500;
}

.case-details-back:hover {
  color: #155dfc;
}

.case-details-summary {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  padding: 20px 24px;
}

.case-details-dl dt {
  font-size: 12px;
  font-weight: 600;
  color: #6a7282;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.case-details-dl dd {
  margin: 0 0 16px 0;
  font-size: 14px;
  color: #364153;
  line-height: 1.5;
}

.case-details-dl-row:last-child dd {
  margin-bottom: 0;
}

.case-details-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}

.case-details-meta-grid .label {
  font-size: 12px;
  color: #6a7282;
  margin-bottom: 4px;
}

.case-details-meta-grid .value {
  font-size: 14px;
  font-weight: 500;
  color: #101828;
}

.case-doc-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-doc-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
}

.case-doc-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #155dfc;
  font-size: 20px;
  flex-shrink: 0;
}

.case-doc-body {
  flex: 1;
  min-width: 0;
}

.case-doc-name {
  font-size: 14px;
  font-weight: 600;
  color: #101828;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.case-doc-meta {
  font-size: 12px;
  color: #6a7282;
  margin-top: 2px;
}

.case-doc-action {
  border-radius: 8px;
  flex-shrink: 0;
}

.case-timeline {
  position: relative;
  padding-left: 8px;
}

.case-timeline-item {
  position: relative;
  padding-left: 28px;
  padding-bottom: 24px;
}

.case-timeline-item:last-child {
  padding-bottom: 0;
}

.case-timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: #e5e7eb;
}

.case-timeline-item.is-done:not(:last-child)::before,
.case-timeline-item.is-current:not(:last-child)::before {
  background: linear-gradient(#155dfc 0, #e5e7eb 100%);
}

.case-timeline-marker {
  position: absolute;
  left: 0;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e5e7eb;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #e5e7eb;
}

.case-timeline-item.is-done .case-timeline-marker {
  background: #155dfc;
  box-shadow: 0 0 0 1px #155dfc;
}

.case-timeline-item.is-current .case-timeline-marker {
  background: #fff;
  border-color: #155dfc;
  box-shadow: 0 0 0 2px rgba(21, 93, 252, 0.25);
}

.case-timeline-title {
  font-size: 14px;
  font-weight: 600;
  color: #101828;
}

.case-timeline-meta {
  font-size: 12px;
  color: #6a7282;
  margin-top: 2px;
}

.case-timeline-note {
  font-size: 13px;
  color: #4a5565;
  margin-top: 6px;
  line-height: 1.45;
}

.case-details-actions {
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.case-details-actions .btn-primary {
  background: #155dfc;
  border-color: #155dfc;
  font-weight: 600;
}

.case-details-actions .btn-primary:hover {
  background: #1247e6;
  border-color: #1247e6;
}

/* Admin case review — Figma Case Review (node 2527:1639) */
.case-review-figma-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  padding: 24px 24px 28px;
  margin-bottom: 1.5rem;
}

.case-review-figma-card__header {
  margin-bottom: 20px;
}

.case-review-figma-ref {
  font-size: 18px;
  font-weight: 600;
  color: #101828;
  line-height: 28px;
}

.case-review-figma-submitted {
  font-size: 14px;
  color: #6a7282;
  margin-top: 8px;
}

.case-review-figma-summary {
  margin-bottom: 24px;
}

.case-review-figma-col-title {
  font-size: 18px;
  font-weight: 500;
  color: #101828;
  line-height: 27px;
  margin-bottom: 16px;
}

.case-review-panel {
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px 18px 20px;
  margin-bottom: 20px;
}

.case-review-panel__title {
  font-size: 16px;
  font-weight: 600;
  color: #101828;
  line-height: 24px;
  margin-bottom: 16px;
}

.case-review-panel__body {
  font-size: 14px;
  line-height: 20px;
  color: #4a5565;
}

.case-review-med-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 44px;
  font-size: 14px;
  line-height: 20px;
  margin-bottom: 10px;
}

.case-review-med-row:last-child {
  margin-bottom: 0;
}

.case-review-doc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.case-review-doc-tile {
  flex: 1 1 260px;
  max-width: 100%;
  min-height: 74px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px 17px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.case-review-doc-tile__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.case-review-doc-tile__icon--blue {
  background: #dbeafe;
  color: #155dfc;
}

.case-review-doc-tile__icon--green {
  background: #dcfce7;
  color: #16a34a;
}

.case-review-doc-tile__icon--violet {
  background: #f3e8ff;
  color: #7c3aed;
}

.case-review-doc-tile__icon--muted {
  background: #f3f4f6;
  color: #6b7280;
}

.case-review-doc-tile__name {
  font-size: 14px;
  font-weight: 500;
  color: #101828;
  line-height: 20px;
}

.case-review-doc-tile__meta {
  font-size: 12px;
  color: #6a7282;
  line-height: 16px;
}

.case-review-actions-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  padding: 24px 24px 28px;
}

.case-review-actions-card__title {
  font-size: 18px;
  font-weight: 500;
  color: #101828;
  margin-bottom: 20px;
}

.case-review-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.case-review-action-outline.btn {
  border-color: rgba(0, 0, 0, 0.1);
  color: #0a0a0a;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
}

.case-review-action-primary {
  background: #030213;
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.case-review-action-primary:hover {
  background: #1a1a2e;
  color: #fff;
}

/* Admin case review redesign */
.admin-case-review-page .dashboard-title {
  font-size: 24px;
  line-height: 1.25;
}

.admin-case-review-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0 10px;
  text-decoration: none;
  color: #101828;
  font-size: 12px;
  font-weight: 500;
}

.admin-case-review-back:hover {
  color: #155dfc;
}

.admin-case-review-ref {
  font-size: 20px;
  font-weight: 700;
  color: #101828;
}

.admin-review-kv {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-review-kv div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.admin-review-kv span {
  color: #6a7282;
}

.admin-review-kv strong {
  color: #101828;
  font-weight: 600;
}

.admin-case-section {
  margin-bottom: 10px;
}

.admin-case-section .label {
  font-size: 12px;
  color: #6a7282;
  font-weight: 600;
  margin-bottom: 4px;
}

.admin-case-section p {
  font-size: 13px;
  color: #344054;
  line-height: 1.45;
}

.admin-review-doc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-review-doc-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-review-doc-item i {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #155dfc;
  background: #eff6ff;
  font-size: 14px;
}

.admin-review-doc-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
}

.admin-review-doc-item small {
  display: block;
  font-size: 11px;
  color: #6a7282;
  text-transform: uppercase;
}

.admin-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-review-actions .btn {
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
}

/* Case assignment UI: assets/css/assign-case.css (loaded by assign_case.php) */

.admin-assign-page .dashboard-title {
  font-size: 24px;
  line-height: 1.2;
}

.admin-assign-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}

.admin-assign-summary-grid div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.admin-assign-summary-grid span {
  color: #6a7282;
}

.admin-assign-summary-grid strong {
  color: #101828;
  font-weight: 600;
}

.admin-assign-select {
  height: 40px;
  border-radius: 8px;
  border-color: #e5e7eb;
  font-size: 13px;
}

@media (max-width: 767.98px) {
  .admin-assign-page .dashboard-title {
    font-size: 26px;
  }

  .admin-assign-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Request missing documents page */
.admin-request-docs-page .dashboard-title {
  font-size: 24px;
  line-height: 1.2;
}

.admin-missing-docs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
}

.admin-missing-docs-grid label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #344054;
}

.admin-missing-docs-grid input[type="checkbox"] {
  accent-color: #155dfc;
}

.admin-request-template {
  border-radius: 10px;
  border-color: #e5e7eb;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 767.98px) {
  .admin-missing-docs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
