/* ============================================================
   RITHA DIGITAL - MODERN DASHBOARD UI
   Phase 1: Sidebar open + cards + cleaner layout
============================================================ */

:root {
  --ritha-navy: #07145f;
  --ritha-navy-2: #111f7a;
  --ritha-blue: #2563eb;
  --ritha-orange: #ff5a1f;
  --ritha-green: #16a34a;
  --ritha-bg: #f3f6fb;
  --ritha-card: #ffffff;
  --ritha-border: #e6edf7;
  --ritha-text: #07145f;
  --ritha-muted: #64748b;
  --ritha-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
}

body {
  background: var(--ritha-bg) !important;
  color: var(--ritha-text) !important;
  font-family: Inter, "Segoe UI", Arial, sans-serif !important;
}

/* Sidebar */
.sidebar,
.side-bar,
#sidebar,
.app-sidebar,
.left-sidebar {
  background: linear-gradient(180deg, #07145f 0%, #0d1b68 55%, #14245f 100%) !important;
  color: #fff !important;
  box-shadow: 12px 0 30px rgba(7, 20, 95, 0.18) !important;
}

.sidebar a,
.side-bar a,
#sidebar a,
.app-sidebar a,
.left-sidebar a {
  color: rgba(255,255,255,0.92) !important;
  text-decoration: none !important;
}

/* Make sidebar dropdowns always open */
.sidebar .submenu,
.sidebar .sub-menu,
.sidebar .dropdown-menu,
.sidebar .collapse,
.side-bar .submenu,
.side-bar .sub-menu,
.side-bar .dropdown-menu,
.side-bar .collapse,
#sidebar .submenu,
#sidebar .sub-menu,
#sidebar .dropdown-menu,
#sidebar .collapse,
.app-sidebar .submenu,
.app-sidebar .sub-menu,
.app-sidebar .dropdown-menu,
.app-sidebar .collapse,
.left-sidebar .submenu,
.left-sidebar .sub-menu,
.left-sidebar .dropdown-menu,
.left-sidebar .collapse {
  display: block !important;
  height: auto !important;
  max-height: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: static !important;
  transform: none !important;
}

/* Sidebar section headings */
.sidebar .nav-title,
.sidebar .menu-title,
.sidebar .section-title,
.side-bar .nav-title,
.side-bar .menu-title,
.side-bar .section-title,
#sidebar .nav-title,
#sidebar .menu-title,
#sidebar .section-title {
  font-size: 12px !important;
  text-transform: uppercase !important;
  letter-spacing: .7px !important;
  color: rgba(255,255,255,.72) !important;
  margin-top: 18px !important;
}

/* Sidebar menu cards */
.sidebar li,
.side-bar li,
#sidebar li,
.app-sidebar li,
.left-sidebar li {
  border-radius: 12px !important;
}

.sidebar li a,
.side-bar li a,
#sidebar li a,
.app-sidebar li a,
.left-sidebar li a {
  border-radius: 12px !important;
  margin: 4px 10px !important;
  padding: 10px 13px !important;
}

.sidebar li a:hover,
.side-bar li a:hover,
#sidebar li a:hover,
.app-sidebar li a:hover,
.left-sidebar li a:hover,
.sidebar .active,
.side-bar .active,
#sidebar .active {
  background: rgba(255,255,255,0.13) !important;
}

/* Main content */
.main-content,
.content,
.page-content,
.dashboard-content,
.wrapper-content {
  background: var(--ritha-bg) !important;
}

/* Remove too much duplicate top blank white space if present */
.main-content > .card:empty,
.content > .card:empty,
.page-content > .card:empty,
.main-content > .top-card:empty,
.content > .top-card:empty {
  display: none !important;
}

/* Header */
.page-header,
.dashboard-header,
.header-card,
.role-header {
  background: #fff !important;
  border: 1px solid var(--ritha-border) !important;
  border-radius: 18px !important;
  box-shadow: var(--ritha-shadow) !important;
  padding: 24px !important;
  margin-bottom: 22px !important;
}

.page-header h1,
.dashboard-header h1,
.header-card h1,
.role-header h1,
h1, h2 {
  color: var(--ritha-navy) !important;
  font-weight: 800 !important;
}

/* KPI Cards */
.card,
.stat-card,
.metric-card,
.dashboard-card,
.summary-card,
.kpi-card {
  background: var(--ritha-card) !important;
  border: 1px solid var(--ritha-border) !important;
  border-radius: 18px !important;
  box-shadow: var(--ritha-shadow) !important;
}

.stat-card,
.metric-card,
.dashboard-card,
.summary-card,
.kpi-card {
  padding: 22px !important;
  position: relative !important;
  overflow: hidden !important;
}

.stat-card::after,
.metric-card::after,
.dashboard-card::after,
.summary-card::after,
.kpi-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -45px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.06);
}

.stat-card h3,
.metric-card h3,
.dashboard-card h3,
.summary-card h3,
.kpi-card h3,
.card-title {
  color: var(--ritha-navy) !important;
  font-weight: 800 !important;
}

.stat-card .value,
.metric-card .value,
.dashboard-card .value,
.summary-card .value,
.kpi-card .value,
.card h2,
.card .number,
.card .amount {
  color: var(--ritha-navy) !important;
  font-weight: 900 !important;
  font-size: clamp(24px, 2.2vw, 36px) !important;
}

/* KPI row spacing */
.row,
.dashboard-row,
.metrics-row {
  gap: 18px !important;
}

/* Tables */
table {
  background: #fff !important;
  border-radius: 16px !important;
  overflow: hidden !important;
}

thead {
  background: #f7f9ff !important;
}

th {
  color: var(--ritha-navy) !important;
  font-weight: 800 !important;
}

td {
  color: #334155 !important;
}

/* Buttons */
.btn,
button,
.button {
  border-radius: 12px !important;
  font-weight: 700 !important;
}

.btn-primary,
button[type="submit"],
.primary-btn {
  background: var(--ritha-navy-2) !important;
  border-color: var(--ritha-navy-2) !important;
}

.btn-primary:hover,
button[type="submit"]:hover,
.primary-btn:hover {
  background: var(--ritha-navy) !important;
}

/* User card clean-up */
.user-card,
.profile-card,
.user-profile,
.top-user,
.account-box {
  border-radius: 16px !important;
}

/* If duplicated user card appears twice close together, keep sidebar/top-right clean */
.page-top .user-card + .user-card,
.topbar .user-card + .user-card,
.header .user-card + .user-card {
  display: none !important;
}

/* Charts */
canvas {
  max-height: 290px !important;
}

/* Mobile/responsive */
@media (max-width: 992px) {
  .stat-card,
  .metric-card,
  .dashboard-card,
  .summary-card,
  .kpi-card {
    margin-bottom: 14px !important;
  }
}

/* ============================================================
   PHASE 2 - Remove duplicate user/profile card in content area
============================================================ */

/* Hide big empty/top user strip if it appears before dashboard title */
.main-content > .user-card:first-child,
.main-content > .profile-card:first-child,
.main-content > .account-box:first-child,
.content > .user-card:first-child,
.content > .profile-card:first-child,
.content > .account-box:first-child,
.page-content > .user-card:first-child,
.page-content > .profile-card:first-child,
.page-content > .account-box:first-child {
  display: none !important;
}

/* Hide white top blank card that has only user info and no dashboard data */
.main-content > div:first-child:has(.user-card),
.content > div:first-child:has(.user-card),
.page-content > div:first-child:has(.user-card) {
  display: none !important;
}

/* Keep only top-right profile compact */
.topbar .user-card,
.navbar .user-card,
.header .user-card,
.topbar .profile-card,
.navbar .profile-card,
.header .profile-card {
  display: flex !important;
  align-items: center !important;
  padding: 10px 14px !important;
  border-radius: 16px !important;
  background: #fff !important;
  border: 1px solid #e6edf7 !important;
  box-shadow: 0 10px 28px rgba(15,23,42,.08) !important;
}

/* Better dashboard spacing */
.main-content,
.content,
.page-content {
  padding-top: 22px !important;
}

/* Dashboard KPI cards modern grid */
.dashboard-card,
.metric-card,
.stat-card,
.summary-card,
.kpi-card {
  transition: transform .2s ease, box-shadow .2s ease !important;
}

.dashboard-card:hover,
.metric-card:hover,
.stat-card:hover,
.summary-card:hover,
.kpi-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12) !important;
}

/* Make sidebar look always expanded/open */
.sidebar [aria-expanded="false"] + ul,
.side-bar [aria-expanded="false"] + ul,
#sidebar [aria-expanded="false"] + ul {
  display: block !important;
}

.sidebar .dropdown-toggle::after,
.side-bar .dropdown-toggle::after,
#sidebar .dropdown-toggle::after {
  transform: rotate(180deg) !important;
}

/* ============================================================
   PHASE 2 FINAL - Remove duplicate user card + compact topbar
============================================================ */

/* The first white top strip should be compact, not huge */
.main-content > div:first-child,
.content > div:first-child,
.page-content > div:first-child {
  min-height: auto !important;
}

/* Compact top profile bar */
.topbar,
.navbar,
.header-bar,
.page-top {
  min-height: 74px !important;
  padding: 14px 24px !important;
  border-radius: 18px !important;
}

/* Hide duplicate user card inside role dashboard header/content */
.role-dashboard-wrapper .user-card,
.role-dashboard-wrapper .profile-card,
.role-dashboard-wrapper .user-profile,
.role-dashboard-wrapper .account-box,
.role-dashboard-wrapper .top-user {
  display: none !important;
}

/* Keep the top-right user card only */
.topbar .user-card,
.topbar .profile-card,
.navbar .user-card,
.navbar .profile-card,
.header-bar .user-card,
.header-bar .profile-card {
  display: flex !important;
}

/* Better role dashboard header without duplicate user */
.role-dashboard-wrapper .dashboard-header,
.role-dashboard-wrapper .page-header,
.role-dashboard-wrapper .header-card,
.role-dashboard-wrapper > .card:first-child {
  padding: 28px 30px !important;
  min-height: auto !important;
}

/* Sidebar should show many items comfortably */
.sidebar,
.side-bar,
#sidebar,
.app-sidebar,
.left-sidebar {
  overflow-y: auto !important;
}

.sidebar::-webkit-scrollbar,
.side-bar::-webkit-scrollbar,
#sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb,
.side-bar::-webkit-scrollbar-thumb,
#sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.25);
  border-radius: 20px;
}

/* Sub menu children */
.sidebar .submenu a,
.sidebar .sub-menu a,
#sidebar .submenu a,
#sidebar .sub-menu a,
.side-bar .submenu a,
.side-bar .sub-menu a {
  font-size: 13px !important;
  padding: 9px 14px 9px 22px !important;
  margin-left: 12px !important;
  border-left: 1px solid rgba(255,255,255,.18) !important;
}

/* Cleaner chart cards */
.role-dashboard-wrapper .card {
  border-radius: 20px !important;
  border: 1px solid #e6edf7 !important;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08) !important;
}

/* ============================================================
   FIX DUPLICATE USER CARD - Keep only top-right account box
============================================================ */

/* Hide user/profile card inside content/dashboard header */
.role-dashboard-wrapper .user-chip,
.role-dashboard-wrapper .user-info,
.role-dashboard-wrapper .user-card,
.role-dashboard-wrapper .profile-card,
.role-dashboard-wrapper .account-card,
.role-dashboard-wrapper .account-box,
.role-dashboard-wrapper .top-user,
.role-dashboard-wrapper .user-dropdown,
.role-dashboard-wrapper .profile-dropdown {
  display: none !important;
}

/* Hide second user/profile card if content area has it */
.main-content .user-chip:not(.topbar .user-chip),
.main-content .profile-card:not(.topbar .profile-card),
.main-content .account-box:not(.topbar .account-box),
.content .user-chip:not(.topbar .user-chip),
.content .profile-card:not(.topbar .profile-card),
.content .account-box:not(.topbar .account-box),
.page-content .user-chip:not(.topbar .user-chip),
.page-content .profile-card:not(.topbar .profile-card),
.page-content .account-box:not(.topbar .account-box) {
  display: none !important;
}

/* Keep top-right compact user card visible */
.topbar .user-chip,
.topbar .user-info,
.topbar .user-card,
.topbar .profile-card,
.topbar .account-box,
.navbar .user-chip,
.navbar .user-info,
.navbar .user-card,
.navbar .profile-card,
.navbar .account-box {
  display: flex !important;
}

/* Reduce the big blank white strip on top */
.main-content > .topbar,
.content > .topbar,
.page-content > .topbar,
.topbar,
.navbar {
  min-height: 72px !important;
  height: auto !important;
}

/* If blank white card appears before dashboard, reduce it */
.main-content > div:first-child,
.content > div:first-child,
.page-content > div:first-child {
  margin-bottom: 18px !important;
}


/* ============================================================
   SIDEBAR PREMIUM LOOK
============================================================ */

.sidebar,
.side-bar,
#sidebar,
.app-sidebar,
.left-sidebar {
  width: 265px !important;
  min-width: 265px !important;
  padding: 16px 12px !important;
}

.sidebar-logo,
.logo-box,
.brand-box,
.sidebar .logo,
#sidebar .logo {
  background: #fff !important;
  border-radius: 14px !important;
  padding: 14px !important;
  margin: 4px 0 18px 0 !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.12) !important;
}

.sidebar-main-link,
.sidebar-link,
.sidebar a {
  font-weight: 700 !important;
}

.sidebar-section,
.menu-section,
.nav-section {
  margin-top: 14px !important;
}

.sidebar .submenu,
.sidebar .sub-menu,
#sidebar .submenu,
#sidebar .sub-menu {
  margin-bottom: 10px !important;
}

.sidebar .submenu a,
.sidebar .sub-menu a,
#sidebar .submenu a,
#sidebar .sub-menu a {
  display: block !important;
  background: transparent !important;
  color: rgba(255,255,255,.90) !important;
  border-radius: 10px !important;
}

.sidebar .submenu a:hover,
.sidebar .sub-menu a:hover,
#sidebar .submenu a:hover,
#sidebar .sub-menu a:hover {
  background: rgba(255,255,255,.12) !important;
}

.main-content,
.content,
.page-content {
  margin-left: 265px !important;
}

@media (max-width: 900px) {
  .main-content,
  .content,
  .page-content {
    margin-left: 0 !important;
  }
}


/* ============================================================
   FINAL FIX - dashboard shifted too far right
============================================================ */

/* Do not add extra left margin because template already handles sidebar */
.main-content,
.content,
.page-content,
.wrapper-content,
.dashboard-content {
  margin-left: unset !important;
  width: auto !important;
  max-width: none !important;
}

/* Keep content aligned nicely */
.main-content,
.content,
.page-content {
  padding-left: 28px !important;
  padding-right: 28px !important;
}

/* Fix role dashboard not to be pushed sideways */
.role-dashboard-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Hide old duplicate user card class even if regex missed it */
.rd-user-card {
  display: none !important;
}

/* But do not hide topbar user dropdown */
.topbar .user-dropdown {
  display: block !important;
}


/* ============================================================
   FINAL LAYOUT FIX - content must start after sidebar
============================================================ */

:root {
  --ritha-sidebar-width: 240px;
}

/* Sidebar fixed on the left */
.sidebar,
.side-bar,
#sidebar,
.app-sidebar,
.left-sidebar {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: var(--ritha-sidebar-width) !important;
  min-width: var(--ritha-sidebar-width) !important;
  z-index: 1000 !important;
}

/* Main content starts after sidebar */
.main-content,
.content,
.page-content,
.wrapper-content,
.dashboard-content {
  margin-left: var(--ritha-sidebar-width) !important;
  width: calc(100% - var(--ritha-sidebar-width)) !important;
  max-width: calc(100% - var(--ritha-sidebar-width)) !important;
  padding-left: 28px !important;
  padding-right: 28px !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

/* Role dashboard must not overflow left/right */
.role-dashboard-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

/* Dashboard grids must fit inside content */
.role-dashboard-wrapper .row,
.role-dashboard-wrapper .rd-grid,
.role-dashboard-wrapper .dashboard-row,
.role-dashboard-wrapper .metrics-row {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Topbar should also start after sidebar */
.topbar,
.navbar,
.header-bar,
.page-top {
  margin-left: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Mobile responsive */
@media (max-width: 900px) {
  .sidebar,
  .side-bar,
  #sidebar,
  .app-sidebar,
  .left-sidebar {
    position: relative !important;
    width: 100% !important;
    min-width: 100% !important;
  }

  .main-content,
  .content,
  .page-content,
  .wrapper-content,
  .dashboard-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}


/* ============================================================
   FINAL DASHBOARD ALIGNMENT FIX
   Remove inner left offset and top blank strip
============================================================ */

/* Remove large inner offset inside role dashboard */
.role-dashboard-wrapper,
.role-dashboard-wrapper * {
  box-sizing: border-box !important;
}

.role-dashboard-wrapper {
  margin-left: 0 !important;
  padding-left: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Force dashboard sections to start from left */
.rd-header,
.rd-stats,
.rd-stat-grid,
.rd-stats-grid,
.rd-grid,
.rd-chart-grid,
.rd-charts-grid,
.rd-section,
.rd-section-header,
.role-dashboard-wrapper > div {
  margin-left: 0 !important;
  max-width: 100% !important;
}

/* Make cards fill available width cleanly */
.rd-stats-grid,
.rd-grid,
.rd-charts-grid {
  display: grid !important;
  width: 100% !important;
  gap: 18px !important;
}

/* KPI cards: 4 columns on desktop */
.rd-stats-grid,
.rd-grid:first-of-type {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

/* Chart cards: 3 columns */
.rd-charts-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

/* Remove blank top white bar if it has no title/content */
.main-content > .card:first-child:empty,
.main-content > div:first-child:empty,
.content > .card:first-child:empty,
.content > div:first-child:empty,
.page-content > .card:first-child:empty,
.page-content > div:first-child:empty {
  display: none !important;
}

/* Reduce top white strip height */
.topbar {
  min-height: 64px !important;
  padding: 10px 22px !important;
  margin-bottom: 18px !important;
}

/* Content should start immediately after sidebar, no extra inner gap */
.main-content,
.content,
.page-content,
.wrapper-content,
.dashboard-content {
  padding-left: 24px !important;
  padding-right: 24px !important;
}

/* Hide role dashboard duplicate user card completely */
.rd-user-card {
  display: none !important;
}

/* Responsive */
@media (max-width: 1200px) {
  .rd-stats-grid,
  .rd-grid:first-of-type {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .rd-charts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  .rd-stats-grid,
  .rd-grid:first-of-type,
  .rd-charts-grid {
    grid-template-columns: 1fr !important;
  }
}


/* ============================================================
   FINAL ROLE DASHBOARD WIDTH FIX
============================================================ */

/* Remove inner container centering */
.main-content .container,
.content .container,
.page-content .container,
.main-content .container-fluid,
.content .container-fluid,
.page-content .container-fluid {
  max-width: none !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Force role dashboard to start from left edge of content */
.role-dashboard-wrapper {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Header and cards must use full content width */
.rd-page-header,
.rd-stats-grid,
.rd-charts-grid,
.rd-bars-grid,
.rd-table-card,
.rd-section-title {
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100% !important;
}

/* Better top dashboard card */
.rd-page-header {
  min-height: 100px !important;
  padding: 26px 28px !important;
  display: flex !important;
  align-items: center !important;
}

/* Keep KPI cards clean */
.rd-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.rd-charts-grid,
.rd-bars-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

/* Hide duplicate role-dashboard user styles/card */
.rd-user-card {
  display: none !important;
}

/* Reduce blank topbar strip */
.topbar {
  min-height: 62px !important;
  padding: 10px 22px !important;
  margin-bottom: 20px !important;
}

/* Sidebar fixed width, content starts exactly after it */
:root {
  --ritha-sidebar-width: 240px;
}

.sidebar,
.side-bar,
#sidebar,
.app-sidebar,
.left-sidebar {
  width: var(--ritha-sidebar-width) !important;
  min-width: var(--ritha-sidebar-width) !important;
}

.main-content,
.content,
.page-content,
.wrapper-content,
.dashboard-content {
  margin-left: var(--ritha-sidebar-width) !important;
  width: calc(100% - var(--ritha-sidebar-width)) !important;
  max-width: calc(100% - var(--ritha-sidebar-width)) !important;
  padding: 24px !important;
  box-sizing: border-box !important;
}

@media(max-width:1200px){
  .rd-stats-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
  .rd-charts-grid,.rd-bars-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
}

@media(max-width:800px){
  .main-content,.content,.page-content,.wrapper-content,.dashboard-content{
    margin-left:0 !important;
    width:100% !important;
    max-width:100% !important;
  }
  .rd-stats-grid,.rd-charts-grid,.rd-bars-grid{grid-template-columns:1fr !important;}
}


/* ============================================================
   EMERGENCY FINAL ALIGNMENT - pull dashboard left
============================================================ */

/* The content is still centered too far right; force it left */
.role-dashboard-wrapper {
  position: relative !important;
  left: 0 !important;
  transform: translateX(-330px) !important;
  width: calc(100% + 330px) !important;
  max-width: calc(100% + 330px) !important;
}

/* Keep topbar normal */
.topbar {
  transform: none !important;
}

/* Make dashboard cards fit after pulling left */
.rd-page-header,
.rd-stats-grid,
.rd-charts-grid,
.rd-bars-grid,
.rd-table-card {
  width: 100% !important;
  max-width: 100% !important;
}

/* Reduce excessive top blank space */
.rd-page-header {
  margin-top: 0 !important;
}

/* If browser smaller, reduce pull */
@media (max-width: 1200px) {
  .role-dashboard-wrapper {
    transform: translateX(-200px) !important;
    width: calc(100% + 200px) !important;
    max-width: calc(100% + 200px) !important;
  }
}

@media (max-width: 900px) {
  .role-dashboard-wrapper {
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}


/* ============================================================
   ABSOLUTE FINAL FIX - no translate, no clipping
============================================================ */

/* Cancel previous emergency translate */
.role-dashboard-wrapper {
  transform: none !important;
  left: auto !important;
  position: static !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

/* Base template uses <section class="content"> */
main.main-content {
  margin-left: 240px !important;
  width: calc(100% - 240px) !important;
  max-width: calc(100% - 240px) !important;
  padding: 24px !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

main.main-content > section.content,
section.content {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

/* Dashboard header/cards start from left inside content */
.rd-page-header,
.rd-stats-grid,
.rd-charts-grid,
.rd-bars-grid,
.rd-table-card,
.rd-section-title {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Keep 4 cards fitting nicely */
.rd-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 18px !important;
}

.rd-charts-grid,
.rd-bars-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 18px !important;
}

/* Sidebar fixed */
.sidebar {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 240px !important;
  min-width: 240px !important;
  z-index: 1000 !important;
}

/* Topbar should not clip dashboard */
.topbar {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  box-sizing: border-box !important;
}

/* Responsive */
@media (max-width: 1200px) {
  .rd-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .rd-charts-grid,
  .rd-bars-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 900px) {
  main.main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .sidebar {
    position: relative !important;
    width: 100% !important;
  }

  .rd-stats-grid,
  .rd-charts-grid,
  .rd-bars-grid {
    grid-template-columns: 1fr !important;
  }
}

