@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Manrope:wght@500;600;700;800&display=swap');

:root {
  --sidebar: 260px;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-tint: #f1f5f9;
  --text: #0f172a;
  --muted-text: #64748b;
  --line: #e2e8f0;
  --primary: #5b5bd6;
  --primary-soft: #eef2ff;
  --primary-hover: #4a4ab8;
  --mint: #0f9f8f;
  --mint-soft: #dff8f2;
  --amber: #d97706;
  --amber-soft: #fff4d6;
  --rose: #e0526f;
  --rose-soft: #fff0f3;
  --chart-grid: #e8edf3;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.055);
  --shadow-hover: 0 16px 36px rgba(15, 23, 42, 0.09);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

.dark {
  --surface: #0f172a;
  --surface-soft: #070d1b;
  --surface-tint: #172033;
  --text: #f8fafc;
  --muted-text: #94a3b8;
  --line: #233047;
  --primary: #9298ff;
  --primary-soft: #24264e;
  --primary-hover: #7b82ff;
  --mint: #43d8c2;
  --mint-soft: #113c38;
  --amber: #f5b942;
  --amber-soft: #463617;
  --rose: #fa8095;
  --rose-soft: #49222b;
  --chart-grid: #1f2b40;
  --shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  --shadow-hover: 0 22px 42px rgba(0, 0, 0, 0.38);
}

/* RESET & BASE */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--surface-soft);
  color: var(--text);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  font-weight: 700;
  margin-top: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: none;
}

/* APP SHELL */
.app-shell {
  min-height: 100vh;
  display: flex;
  background: var(--surface-soft);
  color: var(--text);
  position: relative;
}

.is-collapsed {
  --sidebar: 78px;
}

.content-shell {
  flex: 1;
  min-width: 0;
  padding-left: var(--sidebar);
  transition: padding-left 0.25s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  height: 100vh;
  z-index: 50;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  transition: width 0.25s ease, transform 0.25s ease;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow);
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

.brand {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 14px 6px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
  color: #ffffff;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.04em;
  box-shadow: 0 8px 18px rgba(99, 102, 241, 0.28);
}

.brand-text {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.brand strong {
  font-family: 'Manrope', sans-serif;
  font-size: 13.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand strong span.dex-pipe {
  color: var(--muted-text);
  font-weight: 300;
  opacity: 0.6;
}

.brand span.dex-sub {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted-text);
  white-space: nowrap;
  display: block;
}

/* TYPOGRAPHY LOGO COMPONENT */
.dex-typography-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.dex-typo-mark-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #5b5bd6 0%, #312e81 100%);
  color: #ffffff;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.05em;
  box-shadow: 0 10px 24px rgba(91, 91, 214, 0.35);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.dex-typo-mark-badge::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, transparent 100%);
  pointer-events: none;
}

.dex-typo-content {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: 'Manrope', sans-serif;
  white-space: nowrap;
}

.dex-typo-main {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.05em;
  background: linear-gradient(135deg, #4338ca 0%, #5b5bd6 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  line-height: 1;
}

.dex-typo-pipe {
  font-size: 18px;
  font-weight: 300;
  color: #94a3b8;
  opacity: 0.8;
  user-select: none;
  line-height: 1;
}

.dex-typo-desc {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

/* ON DARK VARIANT */
.dex-typography-logo.is-dark .dex-typo-main {
  background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 60%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dex-typography-logo.is-dark .dex-typo-pipe {
  color: rgba(255, 255, 255, 0.4);
}

.dex-typography-logo.is-dark .dex-typo-desc {
  color: #ffffff;
}

/* SIDEBAR NAVIGATION */
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
  flex: 1;
}

.nav-overline, .eyebrow {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-text);
  padding: 10px 12px 4px;
  white-space: nowrap;
  display: block;
}

.nav-item {
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
}

.nav-item svg, .nav-item i {
  flex-shrink: 0;
  font-size: 16px;
  width: 18px;
  text-align: center;
}

.nav-item:hover {
  background: var(--surface-tint);
  color: var(--text);
  transform: translateX(2px);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.nav-item .badge-tag {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--mint-soft);
  color: var(--mint);
}

/* SIDEBAR DROPDOWN / TREEVIEW */
.nav-group {
  display: flex;
  flex-direction: column;
}

.nav-group-header {
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-text);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: background-color 0.2s, color 0.2s;
  user-select: none;
}

.nav-group-header:hover {
  background: var(--surface-tint);
  color: var(--text);
}

.nav-group-header .group-title {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.nav-group-header .chevron {
  font-size: 11px;
  transition: transform 0.2s ease;
}

.nav-group.open .nav-group-header .chevron {
  transform: rotate(90deg);
}

.nav-group-children {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-left: 28px;
  margin-top: 2px;
  margin-bottom: 4px;
}

.nav-group.open .nav-group-children {
  display: flex;
}

.nav-subitem {
  height: 34px;
  padding: 0 10px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-text);
  font-size: 12px;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.nav-subitem:hover {
  background: var(--surface-tint);
  color: var(--text);
}

.nav-subitem.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

/* SIDEBAR COLLAPSED */
.sidebar-collapsed .brand > .brand-text,
.sidebar-collapsed .nav-overline,
.sidebar-collapsed .nav-item span:not(.badge-tag),
.sidebar-collapsed .nav-group-header .group-title span,
.sidebar-collapsed .nav-group-header .chevron,
.sidebar-collapsed .nav-group-children,
.sidebar-collapsed .sidebar-status span {
  display: none !important;
}

.sidebar-collapsed .nav-item,
.sidebar-collapsed .nav-group-header {
  justify-content: center;
  padding: 0;
}

.sidebar-collapsed .brand {
  justify-content: center;
  padding: 0 0 14px 0;
}

.collapse-btn {
  position: absolute;
  right: -12px;
  top: 72px;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted-text);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.25s ease, background-color 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  z-index: 60;
}

.collapse-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.is-collapsed .collapse-btn {
  transform: rotate(180deg);
}

.sidebar-status {
  margin-top: auto;
  background: var(--mint-soft);
  color: var(--mint);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  flex-shrink: 0;
}

.sidebar-status strong {
  display: block;
  white-space: nowrap;
}

.sidebar-status span {
  display: block;
  opacity: 0.8;
  font-size: 10px;
  white-space: nowrap;
}

/* TOPBAR */
.topbar {
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar-start, .topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  width: min(32vw, 360px);
  height: 40px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 500 13px "IBM Plex Sans", sans-serif;
}

.search-box input::placeholder {
  color: var(--muted-text);
  opacity: 0.7;
}

.icon-btn, .ghost-icon {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted-text);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
}

.icon-btn:hover, .ghost-icon:hover {
  background: var(--primary-soft);
  color: var(--primary);
  transform: translateY(-1px);
}

.ghost-icon {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 5px;
  background: transparent;
}

.period-select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  color: var(--muted-text);
}

.period-select select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 600 12px "IBM Plex Sans", sans-serif;
  cursor: pointer;
}

.notification-btn {
  position: relative;
}

.notification-btn .dot-alert {
  position: absolute;
  right: 8px;
  top: 7px;
  width: 7px;
  height: 7px;
  background: var(--rose);
  border-radius: 50%;
  border: 1.5px solid var(--surface);
}

/* USER PROFILE PILL */
.profile-pill {
  position: relative;
}

.profile-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.profile-btn:hover {
  border-color: var(--primary);
  background: var(--surface-tint);
}

.avatar-initials {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 13px;
}

.profile-btn strong {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 700;
  display: block;
  white-space: nowrap;
}

.profile-btn span {
  font-size: 10.5px;
  color: var(--muted-text);
  display: block;
  margin-top: 1px;
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 6px;
  display: none;
  z-index: 100;
}

.profile-dropdown.show {
  display: block;
  animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-item-btn {
  width: 100%;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dropdown-item-btn:hover {
  background: var(--surface-tint);
  color: var(--primary);
}

.dropdown-item-btn.text-danger:hover {
  background: var(--rose-soft);
  color: var(--rose);
}

.menu-btn, .mobile-close, .mobile-overlay {
  display: none;
}

/* CONTENT CONTAINER */
.route-content {
  flex: 1;
  padding: 28px 32px 40px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* PAGE INTRO */
.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-intro h1 {
  font: 800 clamp(24px, 2.5vw, 36px) 'Manrope', sans-serif;
  letter-spacing: -0.04em;
  margin: 4px 0 2px;
  color: var(--text);
}

.page-intro p {
  margin: 0;
  color: var(--muted-text);
  font-size: 13.5px;
}

.intro-actions {
  display: flex;
  gap: 10px;
}

.outline-action, .primary-action, .text-button {
  height: 38px;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.outline-action {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.outline-action:hover {
  background: var(--surface-tint);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.primary-action {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.primary-action:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(91, 91, 214, 0.32);
}

/* PANELS & CARDS */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.panel:hover {
  box-shadow: var(--shadow-hover);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2, .panel-heading h3 {
  font: 750 16px 'Manrope', sans-serif;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

.panel-body {
  padding: 22px;
}

/* KPI GRID */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.kpi-card {
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-soft);
}

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-icon, .mini-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.kpi-icon.indigo, .mini-icon.indigo {
  background: var(--primary-soft);
  color: var(--primary);
}

.kpi-icon.mint, .mini-icon.mint {
  background: var(--mint-soft);
  color: var(--mint);
}

.kpi-icon.amber, .mini-icon.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.kpi-icon.rose, .mini-icon.rose {
  background: var(--rose-soft);
  color: var(--rose);
}

.kpi-label {
  color: var(--muted-text);
  font-size: 12px;
  font-weight: 600;
  margin: 14px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.kpi-main strong {
  font: 800 clamp(24px, 2.2vw, 32px) 'Manrope', sans-serif;
  letter-spacing: -0.04em;
  color: var(--text);
}

.trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--mint-soft);
  color: var(--mint);
  font-size: 10.5px;
  font-weight: 700;
}

.trend.down {
  background: var(--rose-soft);
  color: var(--rose);
}

.kpi-detail {
  font-size: 11.5px;
  color: var(--muted-text);
  margin: 6px 0 0;
}

/* DASHBOARD GRIDS */
.dashboard-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 22px;
}

.primary-grid {
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
}

.triple-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chart-wrap {
  min-height: 280px;
  width: 100%;
}

/* FILTER BAR / SEARCH BAR IN MODULES */
.filter-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.filter-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 14px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.filter-field label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-text);
  margin: 0;
}

.form-control-custom,
.form-control {
  height: 38px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.form-control-custom:focus,
.form-control:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ==========================================================================
   TABLES & DATATABLES PRECISION STYLES (Clean, Modern & High Contrast)
   ========================================================================== */
.table-responsive-custom {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  margin-bottom: 4px;
}

table.dataTable,
.table-custom {
  width: 100% !important;
  border-collapse: collapse !important;
  color: var(--text) !important;
  font-size: 12.5px !important;
  font-family: 'IBM Plex Sans', sans-serif !important;
  margin: 0 !important;
}

table.dataTable thead th,
.table-custom thead th {
  background: var(--surface-tint) !important;
  color: var(--muted-text) !important;
  font-family: 'Manrope', sans-serif !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  padding: 13px 15px !important;
  border-bottom: 1.5px solid var(--line) !important;
  border-top: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}

table.dataTable tbody td,
.table-custom tbody td {
  padding: 12px 15px !important;
  border-bottom: 1px solid var(--line) !important;
  border-top: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  color: var(--text) !important;
  background: transparent !important;
  vertical-align: middle !important;
  font-variant-numeric: tabular-nums;
}

table.dataTable tbody tr:nth-child(even),
.table-custom tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.015) !important;
}

:root.dark table.dataTable tbody tr:nth-child(even),
:root.dark .table-custom tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015) !important;
}

table.dataTable tbody tr:hover,
.table-custom tbody tr:hover {
  background: var(--surface-tint) !important;
  transition: background-color 0.12s ease;
}

table.dataTable tfoot th,
table.dataTable tfoot td,
.table-custom tfoot th,
.table-custom tfoot td {
  background: var(--surface-tint) !important;
  color: var(--text) !important;
  font-family: 'Manrope', sans-serif !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  padding: 13px 15px !important;
  border-top: 2px solid var(--line) !important;
  border-bottom: 0 !important;
  vertical-align: middle !important;
}

/* TABLE ACTION BUTTONS (Micro Buttons) */
.btn-detail-lab,
.detail-btn,
.rekap-btn,
.sendmessage,
.btn-action-primary,
.table-custom .btn-primary,
table.dataTable .btn-primary {
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
  border: 1px solid rgba(91, 91, 214, 0.25) !important;
  border-radius: 7px !important;
  padding: 5px 11px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  font-family: 'IBM Plex Sans', sans-serif !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  text-decoration: none !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
  line-height: 1.4 !important;
}

.btn-detail-lab:hover,
.detail-btn:hover,
.table-custom .btn-primary:hover,
table.dataTable .btn-primary:hover {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 10px rgba(91, 91, 214, 0.25) !important;
}

.rekap-btn,
.table-custom .btn-warning,
table.dataTable .btn-warning {
  background: var(--amber-soft) !important;
  color: var(--amber) !important;
  border: 1px solid rgba(217, 119, 6, 0.25) !important;
}

.rekap-btn:hover,
.table-custom .btn-warning:hover,
table.dataTable .btn-warning:hover {
  background: var(--amber) !important;
  color: #ffffff !important;
  border-color: var(--amber) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.25) !important;
}

.sendmessage,
.table-custom .btn-success,
table.dataTable .btn-success {
  background: var(--mint-soft) !important;
  color: var(--mint) !important;
  border: 1px solid rgba(15, 159, 143, 0.25) !important;
}

.sendmessage:hover,
.table-custom .btn-success:hover,
table.dataTable .btn-success:hover {
  background: var(--mint) !important;
  color: #ffffff !important;
  border-color: var(--mint) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 10px rgba(15, 159, 143, 0.25) !important;
}

/* DATATABLES CONTROLS (Toolbar, Search, Length & Pagination) */
.dataTables_wrapper {
  color: var(--muted-text) !important;
  font-size: 12.5px !important;
  padding: 14px 0 6px !important;
}

.dataTables_wrapper .dt-buttons {
  display: inline-flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin-bottom: 14px !important;
}

.dataTables_wrapper .dt-buttons .dt-button {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  color: var(--text) !important;
  font-family: 'IBM Plex Sans', sans-serif !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  padding: 6px 12px !important;
  margin: 0 !important;
  background-image: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
  transition: all 0.18s ease !important;
}

.dataTables_wrapper .dt-buttons .dt-button:hover {
  background: var(--surface-tint) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(91, 91, 214, 0.16) !important;
}

.dataTables_wrapper .dataTables_length {
  margin-bottom: 14px !important;
}

.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--line) !important;
  background: var(--surface-soft) !important;
  color: var(--text) !important;
  border-radius: 8px !important;
  padding: 5px 12px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  outline: none !important;
  cursor: pointer !important;
  margin: 0 6px !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}

.dataTables_wrapper .dataTables_length select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-soft) !important;
}

.dataTables_wrapper .dataTables_filter {
  margin-bottom: 14px !important;
}

.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--line) !important;
  background: var(--surface-soft) !important;
  color: var(--text) !important;
  border-radius: 20px !important;
  padding: 6px 14px 6px 32px !important;
  font-size: 12px !important;
  outline: none !important;
  margin-left: 8px !important;
  width: 180px !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 10px center !important;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--primary) !important;
  background-color: var(--surface) !important;
  box-shadow: 0 0 0 3px var(--primary-soft) !important;
  width: 230px !important;
}

.dataTables_wrapper .dataTables_info {
  padding-top: 14px !important;
  color: var(--muted-text) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
}

.dataTables_wrapper .dataTables_paginate {
  padding-top: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 3px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 8px !important;
  border: 1px solid var(--line) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  padding: 5px 12px !important;
  margin: 0 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--surface-tint) !important;
  color: var(--primary) !important;
  border-color: var(--line) !important;
  transform: translateY(-1px) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  font-weight: 700 !important;
  box-shadow: 0 3px 10px rgba(91, 91, 214, 0.3) !important;
  transform: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

/* ==========================================================================
   MODAL DIALOG PRECISION STYLES (Modern Glass, Centered, High Contrast)
   ========================================================================== */
.modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1050;
  display: none;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  outline: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 24px 16px;
}

.modal.in, .modal.show {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.modal-open {
  overflow: hidden;
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 650px;
  margin: auto;
  pointer-events: auto;
  z-index: 1051;
}

.modal-dialog.modal-lg {
  max-width: 900px;
}

.modal-dialog.modal-md {
  max-width: 680px;
}

.modal-dialog.modal-sm {
  max-width: 440px;
}

.modal.fade .modal-dialog {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease-out;
  transform: translateY(-20px) scale(0.96);
  opacity: 0;
}

.modal.in .modal-dialog, .modal.show .modal-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-backdrop {
  display: none !important;
}

.modal-content-custom {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: var(--text);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
}

.modal-header-custom {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-soft);
  flex-shrink: 0;
}

.modal-header-custom h4,
.modal-header-custom h5,
.modal-header-custom .modal-title {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 16.5px;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header-custom .icon-btn.ghost-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted-text);
  cursor: pointer;
  transition: all 0.18s ease;
}

.modal-header-custom .icon-btn.ghost-icon:hover {
  background: var(--rose-soft);
  color: var(--rose);
  border-color: var(--rose-soft);
  transform: rotate(90deg) scale(1.05);
}

.modal-body-custom {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer-custom {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: var(--surface-soft);
  flex-shrink: 0;
  white-space: nowrap;
  overflow: visible;
}

.modal-footer-custom .btn-text-short {
  display: none;
}

.modal-footer-custom .btn-text-full {
  display: inline;
  white-space: nowrap;
}

/* ==========================================================================
   MATERIALIZED MODERN BUTTON SYSTEM (Material Design 3 Elevated & Tonal)
   ========================================================================== */
.btn-dex-primary,
.btn-dex-secondary,
.btn-dex-success,
.btn-dex-danger,
.btn-dex-warning {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border-radius: 10px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  outline: none;
  border: 1px solid transparent;
  user-select: none;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  box-sizing: border-box;
}

/* Material Outlined / Tonal ("Tutup" Button) */
.btn-dex-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-dex-secondary:hover {
  background: var(--surface-tint);
  border-color: rgba(91, 91, 214, 0.3);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-dex-secondary:active {
  transform: translateY(0) scale(0.98);
  background: var(--surface-soft);
}

/* Material Filled Elevated Teal/Emerald ("Verifikasi" Button) */
.btn-dex-success {
  background: linear-gradient(135deg, #0f9f8f 0%, #0c8275 100%);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 3px 12px rgba(15, 159, 143, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-dex-success:hover {
  background: linear-gradient(135deg, #13b5a3 0%, #0f9f8f 100%);
  color: #ffffff !important;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(15, 159, 143, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-dex-success:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 6px rgba(15, 159, 143, 0.3);
}

/* Material Filled Elevated Indigo/Primary */
.btn-dex-primary {
  background: linear-gradient(135deg, #5b5bd6 0%, #4338ca 100%);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 3px 12px rgba(91, 91, 214, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-dex-primary:hover {
  background: linear-gradient(135deg, #6c6ce0 0%, #5b5bd6 100%);
  color: #ffffff !important;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(91, 91, 214, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-dex-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 6px rgba(91, 91, 214, 0.3);
}

/* PATIENT BANNER CARD IN MODAL */
.patient-banner-card {
  background: var(--surface-tint);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.patient-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.patient-banner-text {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

/* BADGES & PILLS */
.status-pill {
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--mint-soft);
  color: var(--mint);
  border: 1px solid rgba(15, 159, 143, 0.2);
  font-size: 10.5px;
  font-weight: 750;
  font-family: 'IBM Plex Sans', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.status-pill.perhatian, .status-pill.warning {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: rgba(217, 119, 6, 0.2);
}

.status-pill.danger {
  background: var(--rose-soft);
  color: var(--rose);
  border-color: rgba(224, 82, 111, 0.2);
}

.status-pill.stabil, .status-pill.primary {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(91, 91, 214, 0.2);
}

/* RESPONSIVE: MOBILE & TABLET (CROP / COMPACT ONLY ON SMALL SCREENS) */
@media (max-width: 767px) {
  .modal {
    padding: 12px 8px;
  }
  
  .modal-dialog {
    max-width: 100%;
    margin: 10px auto;
  }
  
  .modal-content-custom {
    border-radius: 14px;
    max-height: calc(100vh - 20px);
  }
  
  .modal-header-custom {
    padding: 14px 16px;
  }
  
  .modal-body-custom {
    padding: 16px;
  }
  
  .modal-footer-custom {
    padding: 12px 16px;
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .modal-footer-custom .btn-dex-primary,
  .modal-footer-custom .btn-dex-secondary,
  .modal-footer-custom .btn-dex-success {
    flex: 1 1 auto;
    padding: 0 12px;
    height: 38px;
    font-size: 12.5px;
  }
  
  .modal-footer-custom .btn-text-full {
    display: none !important;
  }
  
  .modal-footer-custom .btn-text-short {
    display: inline !important;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
}

/* ANIMATIONS */
.animate-in {
  animation: fadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1180px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .triple-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .profile-btn span, .profile-btn strong {
    display: none;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar: 0px;
  }
  .sidebar {
    width: 260px;
    transform: translateX(-105%);
    box-shadow: 20px 0 50px rgba(15, 23, 42, 0.22);
  }
  .sidebar-mobile-open {
    transform: translateX(0) !important;
  }
  .mobile-close {
    display: grid !important;
    margin-left: auto;
  }
  .collapse-btn {
    display: none;
  }
  .mobile-overlay {
    display: block;
    position: fixed;
    z-index: 45;
    inset: 0;
    border: 0;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(2px);
  }
  .menu-btn {
    display: grid;
  }
  .primary-grid {
    grid-template-columns: 1fr;
  }
  .search-box {
    width: 200px;
  }
  .period-select {
    display: none;
  }
}

@media (max-width: 680px) {
  .topbar {
    height: 64px;
    padding: 0 16px;
  }
  .route-content {
    padding: 20px 14px;
  }
  .search-box {
    display: none;
  }
  .page-intro {
    align-items: flex-start;
    flex-direction: column;
  }
  .intro-actions {
    width: 100%;
  }
  .intro-actions button, .intro-actions a {
    flex: 1;
    justify-content: center;
  }
  .kpi-grid, .triple-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-footer {
    flex-direction: column;
    gap: 6px;
  }
}

/* LEGACY BOX & WIDGET COMPATIBILITY MAPPINGS */
.box, .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.box:hover, .card:hover {
  box-shadow: var(--shadow-hover);
}

.box-header, .card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
}

.box-header .box-title, .card-header h3, .card-header h4 {
  font-family: 'Manrope', sans-serif;
  font-weight: 750;
  font-size: 15px;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.box-body, .card-body {
  padding: 20px;
  color: var(--text);
}

.box-footer, .card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-tint);
}

/* NAV PILLS & TABS */
.nav-pills {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 18px 0;
}

.nav-pills .nav-item {
  margin: 0;
}

.nav-pills .nav-link,
.nav-tabs .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted-text);
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-pills .nav-link:hover,
.nav-tabs .nav-link:hover {
  background: var(--surface-tint);
  color: var(--text);
}

.nav-pills .nav-link.active,
.nav-tabs .nav-link.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(91, 91, 214, 0.25);
}

/* SKELETON LOADERS */
.skeleton-line {
  height: 14px;
  background: var(--surface-tint);
  border-radius: 4px;
  margin-bottom: 8px;
  animation: pulse 1.5s infinite;
}

.skeleton-box {
  height: 180px;
  background: var(--surface-tint);
  border-radius: var(--radius-md);
  animation: pulse 1.5s infinite;
}

.w-25 { width: 25%; }
.w-15 { width: 15%; }

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

@media print {
  .sidebar, .topbar, .intro-actions, .dashboard-footer, .collapse-btn {
    display: none !important;
  }
  .content-shell {
    padding-left: 0 !important;
  }
  .route-content {
    padding: 10px;
    max-width: none;
  }
  .panel {
    box-shadow: none !important;
    break-inside: avoid;
  }
}

/* =======================================================
   3D MATERIALIZED GLOWING PILL BUTTONS & TABS
   ======================================================= */
.dex-material-tablist {
  display: inline-flex;
  align-items: center;
  background: var(--surface-soft, #f8fafc);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-color, #e2e8f0);
  gap: 5px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  flex-wrap: wrap;
}

.btn-dex-tab {
  position: relative;
  background: #ffffff;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 6.5px 14px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.22s ease,
              color 0.2s ease,
              border-color 0.22s ease;
  user-select: none;
  outline: none;
  line-height: 1.2;
  will-change: transform, box-shadow;
}

.dark .btn-dex-tab {
  background: #172033;
  color: #94a3b8;
  border-color: #233047;
}

.btn-dex-tab .tab-btn-icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-dex-tab:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
  box-shadow: 0 3px 8px -1px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.dark .btn-dex-tab:hover {
  background: #1f2b40;
  color: #f8fafc;
  border-color: #334155;
}

.btn-dex-tab:hover .tab-btn-icon {
  transform: scale(1.08);
}

/* ACTIVE TAB 1: Rincian Klaim Pasien (Royal Indigo Glow) */
.btn-dex-tab.active#tab-btn-rincian {
  color: #ffffff !important;
  background: linear-gradient(180deg, #5352d4 0%, #4341be 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 4px 14px -1px rgba(83, 82, 212, 0.45),
              0 2px 4px -1px rgba(83, 82, 212, 0.25),
              inset 0 1px 0.8px 0 rgba(255, 255, 255, 0.45) !important;
  font-weight: 700;
  transform: translateY(-0.5px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ACTIVE TAB 2: Analisis Per DPJP (Medical Ocean Blue / Teal) */
.btn-dex-tab.active#tab-btn-dokter {
  color: #ffffff !important;
  background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 4px 14px -1px rgba(14, 165, 233, 0.45),
              0 2px 4px -1px rgba(14, 165, 233, 0.25),
              inset 0 1px 0.8px 0 rgba(255, 255, 255, 0.45) !important;
  font-weight: 700;
  transform: translateY(-0.5px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ACTIVE TAB 3: Per Unit & Bangsal (Warm Amber / Honey Gold) */
.btn-dex-tab.active#tab-btn-layanan {
  color: #ffffff !important;
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 4px 14px -1px rgba(245, 158, 11, 0.45),
              0 2px 4px -1px rgba(245, 158, 11, 0.25),
              inset 0 1px 0.8px 0 rgba(255, 255, 255, 0.45) !important;
  font-weight: 700;
  transform: translateY(-0.5px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ACTIVE TAB 4: Top Diagnosa & CBG (Modern Violet / Purple) */
.btn-dex-tab.active#tab-btn-diagnosa {
  color: #ffffff !important;
  background: linear-gradient(180deg, #8b5cf6 0%, #7c3aed 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 4px 14px -1px rgba(139, 92, 246, 0.45),
              0 2px 4px -1px rgba(139, 92, 246, 0.25),
              inset 0 1px 0.8px 0 rgba(255, 255, 255, 0.45) !important;
  font-weight: 700;
  transform: translateY(-0.5px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-dex-tab:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 0.1s;
}
