/* ======================================================================
   PowerBIDash - modern "theme-safe" CSS (Bootstrap 5 + AdminLTE 4)
   Respects the active theme colors (light/dark) and avoids unnecessary !important rules.
   ====================================================================== */

/* =========================
   BASE (font and sizing)
   ========================= */
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 0.95rem;
}

/* Navbar height (adjust if you change header paddings) */
:root{ --app-navbar-h: 56px; }

/* ===========================================================
   THEME VARIABLES (use data-bs-theme="light" | "dark")
   If your AdminLTE build still toggles .dark-mode, see the fallback block below.
   =========================================================== */

/* -----------------
   LIGHT theme
   ----------------- */
:root[data-bs-theme="light"] {
  /* Leave these commented if the theme should define primary colors.
     Uncomment ONLY if you want to force a custom palette in LIGHT mode.
  */
  /* --bs-primary: #4f46e5;
     --bs-secondary: #64748b;
     --bs-success: #22c55e;
     --bs-danger: #ef4444;
     --bs-warning: #f59e0b;
     --bs-info: #0ea5e9; */

  /* Custom gradients/colors used only on light mode */
  --pbd-navbar-grad-start: #1e293b; /* slate-800 */
  --pbd-navbar-grad-end:   #0f172a; /* slate-950 */
  --pbd-sidebar-bg:        #0b1220; /* very dark blue */

  /* Navbar (leverage official Bootstrap variables to respect the theme) */
  --bs-navbar-bg: linear-gradient(135deg, var(--pbd-navbar-grad-start), var(--pbd-navbar-grad-end));
  --bs-navbar-color: #e2e8f0;
  --bs-navbar-hover-color: #ffffff;

  /* Cards and tables (neutral palette for light mode) */
  --pbd-card-border: rgba(148, 163, 184, .15);
  --pbd-card-shadow: 0 4px 24px rgba(2, 6, 23, .08);
  --pbd-th-color: #475569;      /* slate-600 */
  --pbd-th-border: rgba(148, 163, 184, .3);
  --pbd-td-border: rgba(148, 163, 184, .15);

  /* Soft badges (light only) */
  --pbd-badge-success-bg: #dcfce7;
  --pbd-badge-success-fg: #166534;
  --pbd-badge-warning-bg: #fef9c3;
  --pbd-badge-warning-fg: #854d0e;
  --pbd-badge-danger-bg:  #fee2e2;
  --pbd-badge-danger-fg:  #991b1b;
  --pbd-badge-secondary-bg:#e2e8f0;
  --pbd-badge-secondary-fg:#334155;

  /* Footer */
  --pbd-footer-bg: linear-gradient(90deg, var(--pbd-navbar-grad-start), var(--pbd-navbar-grad-end));
  --pbd-footer-fg: #e2e8f0;
  --pbd-footer-muted: #cbd5e1;
}

/* ----------------
   DARK theme
   ----------------
   We do not force strong colors here so the theme keeps control.
   Only define values that preserve consistency when tweaks are required. */
:root[data-bs-theme="dark"] {
  --pbd-card-border: rgba(148, 163, 184, .24);
  --pbd-card-shadow: 0 16px 32px rgba(15, 23, 42, .35);
  --pbd-th-color: rgba(226, 232, 240, .85);
  --pbd-th-border: rgba(71, 85, 105, .55);
  --pbd-td-border: rgba(51, 65, 85, .45);
  --pbd-footer-bg: linear-gradient(90deg, rgba(15, 23, 42, .95), rgba(30, 41, 59, .92));
  --pbd-footer-fg: rgba(226, 232, 240, .9);
  --pbd-footer-muted: rgba(148, 163, 184, .82);
}

/* ==============================================================
   FALLBACK for AdminLTE 3/4 using .dark-mode (if applicable)
   ============================================================== */
.dark-mode {
  /* Avoid forcing colors in dark mode; let the theme do the work. */
  /* If you need something VERY specific, declare it here (sparingly). */
}

/* ======================
   NAVBAR (respect the theme)
   ====================== */
.main-header {
  /* Let it inherit the theme color (light mode defined above). */
  background: var(--bs-navbar-bg);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1030; /* sobre contenido y sidebar */
  min-height: var(--app-navbar-h);
  border-radius: 0 0 1rem 0;
  margin-right: 5px;
}

/* Adjust the content offset according to the real navbar height */
body.layout-navbar-fixed .wrapper .content-wrapper,
body.layout-navbar-fixed .wrapper .main-header ~ .content-wrapper,
body.layout-navbar-fixed .wrapper .main-header.text-sm ~ .content-wrapper,
body.layout-navbar-fixed.text-sm .wrapper .content-wrapper,
body.layout-navbar-fixed.text-sm .wrapper .main-header ~ .content-wrapper,
body.layout-navbar-fixed.text-sm .wrapper .main-header.text-sm ~ .content-wrapper {
  margin-top: calc(var(--app-navbar-h, 3.5rem) + 1px);
}

/* Link colors driven by theme variables (no !important) */
.main-header .nav-link {
  color: var(--bs-navbar-color);
}
.main-header .nav-link:hover,
.main-header .nav-link:focus {
  color: var(--bs-navbar-hover-color);
}

/* Navbar search input group (subtle effect in light mode).
   In dark mode it inherits from the theme and remains readable. */
.main-header .input-group {
  background: rgba(255, 255, 255, .08);
  border-radius: 12px;
}
.main-header .form-control {
  color: inherit;
}

/* Theme toggle button: icon only, no large pill */
.navbar .nav-link.bg-transparent {
  background: transparent;
  padding: 0 .5rem;
  line-height: 1;
}

/* Remove bottom border/shadow from the navbar */
.main-header.navbar {
  border-bottom: 0 !important;
  box-shadow: none !important;
}

/* Navbar: adjustments for small screens (phones and similar) */
@media (max-width: 576px){
  /* Compact link paddings to gain space */
  .main-header .navbar-nav > .nav-item > .nav-link{ padding: .25rem .45rem; }
  /* Hide non-essential utilities on mobile: search and fullscreen */
  .main-header [data-widget="navbar-search"],
  .main-header [data-widget="fullscreen"]{ display: none !important; }
  /* Prevent long items from pushing the user menu */
  .main-header .navbar-nav{ flex-wrap: nowrap; }
  .main-header .navbar-nav.ms-auto,
  .main-header .navbar-nav.ml-auto{ margin-left: auto !important; }
}

/* ======================================
   CONTENT WRAPPER & HEADERS
   ====================================== */
.content-wrapper {
  background: var(--bs-body-bg);
  border-radius: 1.25rem 0 0 0;
  box-shadow: inset 0 1px 0 rgba(148, 163, 184, .15);
  padding-bottom: 2.5rem;
}
.content-wrapper .content {
  padding-top: 0;
}
.content-header {
  border-bottom: 1px solid var(--pbd-card-border, var(--bs-border-color));
  margin-bottom: 1.25rem;
  padding-top: 0;
  padding-bottom: 0;
}
.content-header > .container-fluid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.content > .container-fluid > * + * {
  margin-top: 1.5rem;
}
.content-header h1,
.content-header .page-title {
  font-size: clamp(1.65rem, 1.2rem + .6vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0;
  color: var(--bs-emphasis-color);
}
.content-header .page-subtitle,
.content-header p,
.content-header .lead {
  margin: 0;
  color: var(--bs-secondary-color);
}
.content-header .actions,
.content-header .header-actions,
.content-header .page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-left: auto;
}
.page-header {
  width: 100%;
}
.page-header__icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, .2);
}
.page-title {
  font-size: clamp(1.65rem, 1.2rem + .6vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--bs-emphasis-color);
}
.page-subtitle {
  font-size: .95rem;
  color: var(--bs-secondary-color);
}

/* =============================
   Dropdowns & menus
   ============================= */
.dropdown-menu {
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .15);
  padding: .75rem;
  min-width: 220px;
}
.dropdown-menu .dropdown-item {
  border-radius: .65rem;
  padding: .55rem .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.dropdown-menu .dropdown-item i,
.dropdown-menu .dropdown-item .nav-icon {
  font-size: 1.05rem;
}
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
  background-color: rgba(79, 70, 229, .1);
  color: var(--bs-primary);
}
.dropdown-divider {
  margin: .5rem 0;
  opacity: .2;
}
@media (max-width: 768px){
  .content-header > .container-fluid{
    flex-direction: column;
    align-items: center;
  }
  .content-header .actions,
  .content-header .header-actions,
  .content-header .page-actions{
    width: 100%;
    justify-content: center;
  }
  .content-header .actions .btn,
  .content-header .header-actions .btn,
  .content-header .page-actions .btn{
    flex: 1 1 auto;
  }
}

/* Table and timeline tweaks for very small screens */
@media (max-width: 480px){
  /* Avoid overflow caused by rigid columns in local timelines */
  .timeline .when{ min-width: 120px; }
}

/* =======================
   SIDEBAR (theme coherence)
   ======================= */
/* For LIGHT mode we use our styled dark background */
:root[data-bs-theme="light"] .main-sidebar {
  background: var(--pbd-sidebar-bg);
}

/* In DARK mode let the theme drive it; if you need to reinforce the tone:
.dark-mode .main-sidebar { background: var(--bs-body-bg); } */

/* Make the brand area (logo) inherit the container background */
.main-sidebar .brand-link { background: transparent !important; color: inherit; border-bottom: 0 !important; box-shadow: none !important; }
.navbar .navbar-brand { background: transparent !important; color: inherit; }

/* Fixed sidebar: it must not scroll with long pages.
   Only the inner menu content should scroll when needed. */
.main-sidebar {
  position: fixed;
  top: var(--app-navbar-h);
  height: calc(100vh - var(--app-navbar-h));
  display: flex;
  flex-direction: column;
  overflow: hidden; /* prevents page scrolling from affecting the sidebar */
  
}
.main-sidebar .sidebar {
  flex: 1 1 auto;
  min-height: 0; /* required so overflow works with flex */
  overflow-y: auto; /* menu scrolls only if taller than the viewport */
  overflow-x: hidden;
}

/* Clearer indentation for submenus so they are not confused with the parent */
.nav-sidebar .nav-treeview > .nav-item > .nav-link {
  padding-left: 2.25rem; /* slightly more to the right than default */
}
.nav-sidebar .nav-treeview .nav-treeview > .nav-item > .nav-link {
  padding-left: 2.75rem; /* deeper levels get extra indentation */
}

/* Centered and cleaner branding */
.brand-link,
.navbar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--app-navbar-h, 3.5rem);
  margin-top: 0;
  padding: 0 .75rem;
}
.brand-link {
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.brand-link.logo-switch,
.navbar-brand.logo-switch {
  justify-content: center !important;
  width: 100%;
}
.brand-link .brand-image,
.brand-link .brand-image-xl,
.navbar-brand .brand-image,
.navbar-brand .brand-image-xl {
  margin: 0 !important;
  float: none !important;
  display: inline-block;
  max-height: calc(var(--app-navbar-h, 3.5rem) - 12px);
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  min-width: 0;
}
.brand-link img,
.navbar-brand img {
  max-height: calc(var(--app-navbar-h, 3.5rem) - 12px);
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  min-width: 0;
}
/* Logo switch: center both variants */
.logo-switch .logo-xs,
.logo-switch .logo-xl {
  display: block !important;
  margin: 0 auto !important;
  max-height: calc(var(--app-navbar-h, 3.5rem) - 12px);
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
/* Hide brand text next to the logo (if your design requires it) */
.brand-text { display: none !important; }

/* Sidebar links (light): subtle palette without breaking dark mode */
:root[data-bs-theme="light"] .nav-sidebar .nav-link {
  color: #94a3b8; /* slate-400 */
  border-radius: 10px;
  transition: background .2s ease, color .2s ease;
}
:root[data-bs-theme="light"] .nav-sidebar .nav-link.active {
  background: var(--bs-primary);
  color: #fff;
}
:root[data-bs-theme="light"] .nav-sidebar .nav-link:hover {
  background: rgba(79, 70, 229, 0.3);
  color: #fff;
}

/* Collapsed sidebar: keep standalone icons aligned away from the edge */
body.sidebar-mini.sidebar-collapse .main-sidebar .nav-sidebar > .nav-item > .nav-link {
  justify-content: center;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  text-align: left;
}

body.sidebar-mini.sidebar-collapse .main-sidebar .nav-sidebar > .nav-item > .nav-link .nav-icon {
  margin: 0;
  width: 1.65rem;
}

/* Sidebar search: button smaller than the input */
.sidebar .btn-sidebar {
  padding: .25rem .5rem !important;
  line-height: 1 !important;
}
.sidebar .form-control-sidebar {
  padding: .35rem .5rem !important;
}

/* =================
   Modern cards
   ================= */
.card {
  border-radius: 16px;
  border: 1px solid var(--pbd-card-border, var(--bs-border-color));
  box-shadow: var(--pbd-card-shadow, 0 2px 12px rgba(0,0,0,.06));
  background-color: var(--bs-body-bg);
  overflow: hidden;
}
.card-header,
.card-footer {
  background-color: var(--bs-body-bg);
  border-color: var(--pbd-card-border, var(--bs-border-color)) !important;
}
.card-header {
  padding: 1.1rem 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  text-align: center;
}
.card-header .card-title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0;
  color: var(--bs-emphasis-color);
}
.card-header .card-subtitle {
  font-size: .95rem;
  color: var(--bs-secondary-color);
  margin-left: 0;
}
.card-header .card-tools,
.card-header .header-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
}
.card-body {
  padding: 1.4rem;
}
.card-footer {
  padding: 1.05rem 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
}
.card .card-title {
  font-weight: 600;
  color: var(--bs-emphasis-color);
}
.card .card-text {
  color: var(--bs-body-color);
}
.card .action-bar,
.card .btn-row,
.card .form-actions {
  width: 100%;
  justify-content: center;
}

/* ==========================
   SMALL-BOX (KPIs)
   ========================== */
.small-box {
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.small-box .icon {
  opacity: 0.4;
  font-size: 3rem;
  top: 10px;
  right: 10px;
}

/* =================
   Modern tables
   ================= */
.table-responsive {
  border-radius: 1rem;
  background-color: var(--bs-body-bg);
  box-shadow: var(--pbd-card-shadow, 0 2px 12px rgba(0,0,0,.06));
  padding: 0;
}
.table {
  margin-bottom: 0;
  vertical-align: middle;
}
.table thead th {
  color: var(--pbd-th-color, var(--bs-secondary-color));
  font-weight: 600;
  border-bottom: 2px solid var(--pbd-th-border, var(--bs-border-color));
  text-transform: none;
  letter-spacing: .02em;
}
.table tbody td {
  border-color: var(--pbd-td-border, var(--bs-border-color)) !important;
}
.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(148, 163, 184, .08);
}
:root[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(71, 85, 105, .25);
}
.table-hover > tbody > tr:hover > * {
  background-color: rgba(79, 70, 229, .08);
}
:root[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
  background-color: rgba(99, 102, 241, .25);
}
.table-col-icon {
  width: 44px;
  min-width: 44px;
}
.table-col-sm {
  min-width: 160px;
}
.table-col-md {
  min-width: 220px;
}
.table-col-lg {
  min-width: 260px;
}

/* =======================
   Utility helpers
   ======================= */
.avatar-initial {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(148, 163, 184, .25);
  color: var(--bs-emphasis-color);
  font-weight: 700;
  font-size: .95rem;
  flex: 0 0 40px;
}
:root[data-bs-theme="dark"] .avatar-initial {
  background-color: rgba(148, 163, 184, .35);
  color: var(--bs-body-color);
}
.cell-ellipsis {
  display: inline-block;
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.u-badge-fixed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  padding-inline: .5rem;
  white-space: nowrap;
}
.badge-role {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid rgba(67, 56, 202, .15);
  font-weight: 600;
}
.badge-admin {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid rgba(185, 28, 28, .25);
  font-weight: 700;
}
.badge-editor {
  background: #fef9c3;
  color: #a16207;
  border: 1px solid rgba(161, 98, 7, .25);
  font-weight: 700;
}
.badge-viewer {
  background: #dcfce7;
  color: #166534;
  border: 1px solid rgba(22, 101, 52, .25);
  font-weight: 700;
}

/* =========================
   Soft BADGES (LIGHT)
   ========================= */
:root[data-bs-theme="light"] .badge.bg-success {
  background-color: var(--pbd-badge-success-bg);
  color: var(--pbd-badge-success-fg);
}
:root[data-bs-theme="light"] .badge.bg-warning {
  background-color: var(--pbd-badge-warning-bg);
  color: var(--pbd-badge-warning-fg);
}
:root[data-bs-theme="light"] .badge.bg-danger {
  background-color: var(--pbd-badge-danger-bg);
  color: var(--pbd-badge-danger-fg);
}
:root[data-bs-theme="light"] .badge.bg-secondary {
  background-color: var(--pbd-badge-secondary-bg);
  color: var(--pbd-badge-secondary-fg);
}

/* =================
   Uniform forms
   ================= */
.content form .form-group,
.content form .row > [class*="col"] {
  margin-bottom: 1rem;
}
.form-label,
.content form .form-group > label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  margin-bottom: .4rem;
}
.form-control,
.form-select {
  border-radius: .75rem;
  padding: .6rem .75rem;
  border-color: var(--bs-border-color);
  background-color: var(--bs-body-bg);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 .15rem rgba(79, 70, 229, .18);
}
.form-check-label {
  color: var(--bs-body-color);
  font-weight: 500;
}
.form-text {
  color: var(--bs-secondary-color);
  font-size: .8rem;
}
.input-group-text {
  border-radius: .65rem;
  border-color: var(--bs-border-color);
  background-color: rgba(148, 163, 184, .1);
}
.form-actions,
.form-footer {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: center;
}

/* ========
   Alerts
   ======== */
.alert {
  border-radius: .85rem;
  border: 0;
  padding: .85rem 1.15rem;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  box-shadow: 0 12px 24px rgba(15, 23, 42, .12);
}
.alert > i,
.alert .alert-icon {
  font-size: 1.25rem;
  line-height: 1;
  margin-top: .2rem;
}
.alert .btn-close {
  box-shadow: none !important;
}

/* ========
   Modals
   ======== */
.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  flex-wrap: wrap;
  border-color: var(--pbd-card-border, var(--bs-border-color)) !important;
}
.modal-header {
  text-align: center;
}
.modal-title {
  flex: 1 1 100%;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--bs-emphasis-color);
}
.modal-footer .btn {
  min-width: 150px;
}

/* ===========
   TIMELINE
   =========== */
.timeline > div > .timeline-item {
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(2, 6, 23, .06);
}

/* =========
   FOOTER
   ========= */
.main-footer {
  background: var(--pbd-footer-bg, var(--bs-body-bg));
  color: var(--pbd-footer-fg, var(--bs-body-color));
  border-top: 0 !important;
  box-shadow: none !important;
  padding-top: .25rem !important;
  padding-bottom: .25rem !important;
  border-radius: 0 1rem 0 0;
  overflow: hidden;                 /* respects the radius */
  line-height: 1.1;
  margin-right: 0; 
}
.main-footer .fw-semibold {
  color: var(--pbd-footer-muted, var(--bs-secondary-color));
}

/* ================================
   Soft secondary outline button
   ================================ */
.btn-outline-secondary {
  border-color: #cbd5e1;
  color: #475569;
}
.btn-outline-secondary:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

/* =========================================================
   BUTTONS - UNIFORM SPACING ACROSS VIEWS
   ========================================================= */
.btn {
  min-width: 138px;
  border-radius: 0.5rem;
  margin: 0 0 .5rem 0; /* vertical breathing room when wrapping */
}

/* Fallback spacing when there is no container gap */
.btn + .btn { margin-left: .5rem; }

/* Typical action containers with real gap and wrap */
.card-header .d-flex,
.content-header .d-flex,
.content_header .d-flex, /* in case you use this name in Blade */
.card-footer,
.btn-toolbar,
.btn-row,
.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

/* Avoid double spacing where a gap already exists */
.card-footer .btn { margin: 0; }

/* Groups and toolbars: spacing without breaking group styling */
.btn-group,
.btn-toolbar { gap: .5rem; }
.btn-group > .btn { margin: 0; }

/* Equal width buttons (use .btn-eq in your views) */
.btn-eq { flex: 1; }

/* Mobile: let buttons take width when needed */
@media (max-width: 480px){
  .card-header .d-flex,
  .content-header .d-flex,
  .content_header .d-flex,
  .card-footer,
  .btn-toolbar,
  .action-bar,
  .btn-row { gap: .5rem; }
  .btn { flex: 1 1 auto; }
}

/* =============================================
   Favorite button (star) - compact and clear
   ============================================= */
.btn.btn-fav{ 
  min-width: auto !important; /* do not inherit the global min-width */
  width: auto; padding: .25rem .5rem; 
  border-color: #cbd5e1; color: #475569; background: transparent;
}
.btn.btn-fav:hover{ background-color: #f1f5f9; color: #1e293b; }
.btn.btn-fav.is-on{ 
  background-color: var(--bs-warning, #f59e0b);
  border-color: var(--bs-warning, #f59e0b);
  color: #111827;
}
.btn.btn-fav.is-on:hover{ filter: brightness(0.95); }

/* =========================================================
   COMPAT: MR/ML mapping (BS4) -> logical margins in BS5
   ========================================================= */
.mr-1 { margin-inline-end: .25rem !important; }
.mr-2 { margin-inline-end: .5rem !important; }
.mr-3 { margin-inline-end: 1rem !important; }
.ml-1 { margin-inline-start: .25rem !important; }
.ml-2 { margin-inline-start: .5rem !important; }
.ml-3 { margin-inline-start: 1rem !important; }

/* ==========================
   Headings / primary text
   ========================== */
.content-header h1 { color: var(--bs-emphasis-color) !important; }

/* ==========================
   User dropdown
   ========================== */
.user-menu .dropdown-menu .dropdown-item {
  padding: .35rem .75rem;
}
.user-menu .dropdown-menu .dropdown-item i {
  width: 1rem;
  text-align: center;
}

/* ===============================
   Layout adjustments (robustness)
   =============================== */
/* Sidebar: use bottom:0 to avoid clipping with 100vh in some environments */
.main-sidebar {
  bottom: 0;
  height: auto !important;
}

/* Preloader: avoid oval distortion and honor the configured size */
.preloader img { border-radius: 0 !important; clip-path: none !important; object-fit: contain; }

/* === FIX REAL: mover submenús en sidebar colapsado más hacia la izquierda === */
body.sidebar-mini.sidebar-collapse .os-content .nav-treeview {
  margin-left: 0 !important;
}
body.sidebar-mini.sidebar-collapse .os-content .nav-treeview .nav-link .nav-icon {
  transform: translateX(-15px);
}
