:root {
      --sidebar-width: 210px;
      --sidebar-collapsed-width: 80px;
      --header-height: 70px;
      --primary-color: #696cff;
      --primary-dark: #5f61e6;
      --sidebar-bg: #2b2c40;
      --sidebar-hover: rgba(255, 255, 255, 0.08);
      --text-light: #a5a3ae;
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: 'Segoe UI', 'Public Sans', -apple-system, sans-serif;
      overflow-x: hidden;
      background: #f5f5f9;
    }

    /* ===== HEADER SUPERIOR ===== */
    .top-header {
      height: var(--header-height);
      background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--primary-color) 100%);
      color: white;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 1030;
      display: flex;
      align-items: center;
      padding: 0 30px;
      box-shadow: 0 4px 24px 0 rgba(34, 41, 47, 0.1);
    }

    .top-header .logo {
      font-size: 1.5rem;
      font-weight: 700;
      text-decoration: none;
      color: white;
      display: flex;
      align-items: center;
      gap: 12px;
      transition: transform 0.3s ease;
    }

    .top-header .logo img {
      width: 50px;
      height: 50px;
      gap: 15px;
    }

    @media (max-width: 767.98px) {
      .top-header .logo img {
        width: 35px;
        height: 35px;
      }
    }

    .top-header .logo:hover {
      transform: scale(1.05);
    }

    .top-header .logo img {
      width: 40px;
      height: 40px;
      object-fit: contain;
    }

    .top-header .user-info {
      margin-left: auto;
      display: flex;
      align-items: center;
      gap: 15px;
    }

    .top-header .company-badge {
      background: rgba(255, 255, 255, 0.2);
      padding: 8px 16px;
      border-radius: 20px;
      font-size: 0.875rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .top-header .user-badge {
      display: flex;
      align-items: center;
      gap: 10px;
      background: rgba(255, 255, 255, 0.15);
      padding: 8px 16px;
      border-radius: 25px;
      font-size: 0.875rem;
    }

    .top-header .user-badge i {
      font-size: 1.3rem;
    }

    .top-header .btn-logout {
      background: rgba(255, 255, 255, 0.2);
      border: 1px solid rgba(255, 255, 255, 0.3);
      color: white;
      padding: 8px 16px;
      border-radius: 20px;
      transition: all 0.3s ease;
      cursor: pointer;
      font-size: 0.875rem;
    }

    .top-header .btn-logout:hover {
      background: rgba(255, 255, 255, 0.3);
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    /* ===== SIDEBAR ===== */
    .sidebar {
      position: fixed;
      top: var(--header-height);
      left: 0;
      bottom: 0;
      width: var(--sidebar-width);
      background: var(--sidebar-bg);
      color: white;
      overflow-y: auto;
      overflow-x: hidden;
      transition: width 0.3s ease, transform 0.3s ease;
      z-index: 1020;
      box-shadow: 0 4px 24px 0 rgba(34, 41, 47, 0.1);
    }

    /* SIDEBAR COLLAPSED STATE */
    .sidebar.collapsed {
      width: var(--sidebar-collapsed-width);
    }

    .sidebar.collapsed .menu-header,
    .sidebar.collapsed .menu-sub,
    .sidebar.collapsed .menu-footer p,
    .sidebar.collapsed .menu-footer hr {
      display: none;
    }

    .sidebar.collapsed .sidebar-nav a span {
      opacity: 0;
      visibility: hidden;
      width: 0;
    }

    .sidebar.collapsed .sidebar-nav a {
      justify-content: center;
      padding: 12px 0;
      border-left: none;
    }

    .sidebar.collapsed .sidebar-nav a i {
      margin-right: 0;
      font-size: 1.5rem;
    }

    .sidebar.collapsed .menu-toggle::after {
      display: none;
    }

    .sidebar.collapsed .menu-footer {
      padding: 15px 10px;
      text-align: center;
    }

    /* ========== CORREÇÕES CRÍTICAS - Sidebar Collapsed ========== */
    .sidebar.collapsed .sidebar-nav a span,
    .sidebar.collapsed .menu-header,
    .sidebar.collapsed .menu-sub {
      display: none !important;
      opacity: 0 !important;
      visibility: hidden !important;
      width: 0 !important;
      height: 0 !important;
      overflow: hidden !important;
    }

    /* Força centralizar ícones */
    .sidebar.collapsed .sidebar-nav a {
      justify-content: center !important;
      padding: 12px 0 !important;
    }

    .sidebar.collapsed .sidebar-nav a i {
      margin-right: 0 !important;
      margin-left: 0 !important;
    }

    /* Impede qualquer interação com elementos escondidos */
    .sidebar.collapsed .sidebar-nav span,
    .sidebar.collapsed .menu-sub * {
      pointer-events: none !important;
      user-select: none !important;
    }

    /* Remove seta do menu-toggle quando colapsado */
    .sidebar.collapsed .menu-toggle::after {
      content: none !important;
      display: none !important;
    }
    /* ========== FIM CORREÇÕES CRÍTICAS ========== */

    /* Tooltip para sidebar colapsado */
    .sidebar.collapsed .sidebar-nav a {
      position: relative;
    }

    .sidebar.collapsed .sidebar-nav a:hover::after {
      content: attr(data-tooltip);
      position: absolute;
      left: 100%;
      top: 50%;
      transform: translateY(-50%);
      background: var(--sidebar-bg);
      color: white;
      padding: 8px 12px;
      border-radius: 6px;
      white-space: nowrap;
      margin-left: 10px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
      z-index: 1000;
      font-size: 0.875rem;
    }

    .sidebar::-webkit-scrollbar {
      width: 6px;
    }

    .sidebar::-webkit-scrollbar-track {
      background: rgba(255, 255, 255, 0.05);
    }

    .sidebar::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.2);
      border-radius: 3px;
    }

    .sidebar-nav {
      list-style: none;
      padding: 20px 0;
      margin: 0;
    }

    .sidebar-nav .menu-header {
      padding: 15px 20px 10px;
      font-size: 0.75rem;
      font-weight: 600;
      text-transform: uppercase;
      color: var(--text-light);
      letter-spacing: 0.5px;
      transition: opacity 0.3s ease;
    }

    .sidebar-nav a {
      display: flex;
      align-items: center;
      padding: 12px 20px;
      color: #c7c7d2;
      text-decoration: none;
      transition: all 0.3s ease;
      border-left: 3px solid transparent;
    }

    .sidebar-nav a span {
      transition: opacity 0.3s ease, width 0.3s ease;
      white-space: nowrap;
    }

    .sidebar-nav a:hover {
      background: var(--sidebar-hover);
      color: white;
      padding-left: 25px;
    }

    .sidebar.collapsed .sidebar-nav a:hover {
      padding-left: 0;
    }

    .sidebar-nav a.active {
      background: linear-gradient(90deg, rgba(105, 108, 255, 0.16) 0%, rgba(105, 108, 255, 0) 100%);
      border-left-color: var(--primary-color);
      color: white;
    }

    .sidebar.collapsed .sidebar-nav a.active {
      background: var(--sidebar-hover);
      border-left: none;
    }

    .sidebar-nav a.active i {
      color: var(--primary-color);
    }

    .sidebar-nav i {
      margin-right: 12px;
      font-size: 1.25rem;
      width: 24px;
      text-align: center;
      transition: transform 0.3s ease, margin 0.3s ease, font-size 0.3s ease;
    }

    .sidebar-nav a:hover i {
      transform: scale(1.1);
    }

    /* Submenu */
    .sidebar-nav .menu-sub {
      list-style: none;
      padding: 0;
      margin: 0;
      display: none;
      transition: all 0.3s ease;
    }

    .sidebar-nav .menu-item.open .menu-sub {
      display: block;
    }

    .sidebar-nav .menu-sub a {
      padding-left: 56px;
      font-size: 0.9rem;
    }

    .sidebar-nav .menu-sub a:hover {
      padding-left: 60px;
    }

    .sidebar-nav .menu-toggle::after {
      content: '\f282';
      font-family: 'boxicons';
      position: absolute;
      right: 20px;
      transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .sidebar-nav .menu-item.open .menu-toggle::after {
      transform: rotate(90deg);
    }

    .menu-toggle {
      position: relative;
      cursor: pointer;
    }

    /* Footer Menu */
    .menu-footer {
      padding: 20px;
      margin-top: auto;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
      text-align: center;
      font-size: 0.75rem;
      color: var(--text-light);
      transition: padding 0.3s ease;
    }

    .menu-footer hr {
      border-color: rgba(255, 255, 255, 0.1);
      margin: 10px 0;
      transition: opacity 0.3s ease;
    }

    /* ===== BOTÃO DE TOGGLE DO SIDEBAR ===== */
    .sidebar-collapse-btn {
      position: fixed;
      top: calc(var(--header-height) + 15px);
      left: calc(var(--sidebar-width) - 20px);
      width: 40px;
      height: 40px;
      background: var(--primary-color);
      border: none;
      border-radius: 50%;
      color: white;
      font-size: 1.25rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1021;
      box-shadow: 0 4px 12px rgba(105, 108, 255, 0.4);
      transition: all 0.3s ease;
    }

    .sidebar-collapse-btn:hover {
      background: var(--primary-dark);
      transform: scale(1.1);
      box-shadow: 0 6px 16px rgba(105, 108, 255, 0.5);
    }

    .sidebar.collapsed + .sidebar-collapse-btn {
      left: calc(var(--sidebar-collapsed-width) - 20px);
    }

    .sidebar.collapsed + .sidebar-collapse-btn i {
      transform: rotate(180deg);
    }

    /* ===== MAIN CONTENT ===== */
    .main-content {
      margin-left: var(--sidebar-width);
      margin-top: var(--header-height);
      padding: 30px;
      min-height: calc(100vh - var(--header-height) - 80px);
      transition: margin-left 0.3s ease;
    }

    .sidebar.collapsed ~ .main-content {
      margin-left: var(--sidebar-collapsed-width);
    }

    /* ===== FOOTER ===== */
    .content-footer {
      background: #fff;
      padding: 20px 30px;
      text-align: center;
      border-top: 1px solid #d9dee3;
      margin-left: var(--sidebar-width);
      box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
      transition: margin-left 0.3s ease;
    }

    .sidebar.collapsed ~ .content-footer {
      margin-left: var(--sidebar-collapsed-width);
    }

    .content-footer p {
      margin: 5px 0;
      font-size: 0.875rem;
    }

    /* ===== CARDS ===== */
    .card {
      border: none;
      border-radius: 12px;
      box-shadow: 0 2px 20px 0 rgba(34, 41, 47, 0.08);
      margin-bottom: 24px;
      transition: all 0.3s ease;
      background: white;
    }

    .card:hover {
      transform: translateY(-4px);
      box-shadow: 0 8px 30px 0 rgba(34, 41, 47, 0.12);
    }

    .card-header {
      background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--primary-color) 100%);
      color: white;
      border-radius: 12px 12px 0 0 !important;
      font-weight: 600;
      padding: 16px 24px;
      border-bottom: none;
    }

    .card-body {
      padding: 24px;
    }

    /* Grid Cards */
    .cards-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
      gap: 24px;
      margin-bottom: 24px;
    }

    .cards-4-col {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
      gap: 24px;
      margin-bottom: 24px;
    }

    /* ===== BOTÕES ===== */
    .btn {
      border-radius: 8px;
      padding: 10px 24px;
      font-weight: 500;
      transition: all 0.3s ease;
      border: none;
    }

    .btn-primary {
      background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
      color: white;
      box-shadow: 0 4px 12px rgba(105, 108, 255, 0.25);
    }

    .btn-primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(105, 108, 255, 0.4);
    }

    /* ===== LOADING ===== */
    .spinner-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(43, 44, 64, 0.8);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 9999;
    }

    .spinner-overlay.show {
      display: flex;
    }

    /* ===== ANIMATIONS ===== */
    .fade-in {
      animation: fadeIn 0.5s ease;
    }

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

    /* ===== TOGGLE BUTTON ===== */
    .sidebar-toggle {
      background: none;
      border: none;
      color: white;
      font-size: 1.5rem;
      cursor: pointer;
      margin-right: 15px;
      padding: 8px;
      border-radius: 8px;
      transition: background 0.3s ease;
      display: none;
    }

    .sidebar-toggle:hover {
      background: rgba(255, 255, 255, 0.1);
    }

    /* ===== RESPONSIVE ===== */
    @media (max-width: 991.98px) {
      .sidebar {
        transform: translateX(-100%);
      }

      .sidebar.show {
        transform: translateX(0);
        width: var(--sidebar-width);
      }

      .sidebar.collapsed {
        width: var(--sidebar-width);
      }

      .main-content,
      .content-footer {
        margin-left: 0;
      }

      .sidebar.collapsed ~ .main-content,
      .sidebar.collapsed ~ .content-footer {
        margin-left: 0;
      }

      .sidebar-toggle {
        display: block;
      }

      .sidebar-collapse-btn {
        display: none;
      }

      .top-header .company-badge {
        display: none;
      }

      .cards-grid,
      .cards-4-col {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 767.98px) {
      .main-content {
        padding: 20px 15px;
      }

      .top-header .user-badge span {
        display: none;
      }
    }


/* ===== COMPACTAÇÃO OTIMIZADA DE FORMS, LISTAS E COMPONENTES ===== */

/* INPUTS E SELECTS - Redução máxima mantendo usabilidade */
.form-control,
.form-select,
select.form-control,
input.form-control,
textarea.form-control {
  padding: 4px 8px !important;
  font-size: 0.8125rem !important;
  line-height: 1.3 !important;
  min-height: 30px !important;
  height: 30px !important;
}

/* Textarea precisa de altura mínima maior */
textarea.form-control {
  min-height: 60px !important;
  height: auto !important;
}

/* Select múltiplo compacto */
select[multiple].form-control {
  min-height: 70px !important;
  height: auto !important;
}

/* LABELS - Mais compactos */
.form-label {
  margin-bottom: 2px !important;
  font-size: 0.75rem !important;
  font-weight: 500;
  line-height: 1.2;
}

/* FORM GROUPS - Espaçamento mínimo */
.form-group {
  margin-bottom: 8px !important;
}

/* ROWS - Redução de espaçamento */
.row {
  margin-bottom: 6px !important;
}

/* Espaçamento entre colunas reduzido */
.row > [class*='col-'] {
  padding-left: 8px !important;
  padding-right: 8px !important;
}

/* MARGINS - Sistema compactado */
.mb-1 { margin-bottom: 3px !important; }
.mb-2 { margin-bottom: 6px !important; }
.mb-3 { margin-bottom: 8px !important; }
.mb-4 { margin-bottom: 12px !important; }
.mb-5 { margin-bottom: 16px !important; }

.mt-1 { margin-top: 3px !important; }
.mt-2 { margin-top: 6px !important; }
.mt-3 { margin-top: 8px !important; }
.mt-4 { margin-top: 12px !important; }
.mt-5 { margin-top: 16px !important; }

/* CARDS - Mais compactos */
.card {
  margin-bottom: 15px !important;
}

.card-header {
  padding: 10px 15px !important;
  font-size: 0.875rem !important;
}

.card-body {
  padding: 15px !important;
}

/* TABELAS - Células bem compactas */
.table {
  font-size: 0.8125rem !important;
  margin-bottom: 0 !important;
}

.table th,
.table td {
  padding: 6px 8px !important;
  vertical-align: middle;
  line-height: 1.3;
}

.table thead th {
  font-size: 0.75rem !important;
  font-weight: 600;
  padding: 8px 8px !important;
  white-space: nowrap;
}

/* BOTÕES - Redução significativa */
.btn {
  padding: 5px 12px !important;
  font-size: 0.8125rem !important;
  line-height: 1.3;
  min-height: 30px;
}

.btn-sm {
  padding: 3px 8px !important;
  font-size: 0.75rem !important;
  min-height: 26px;
}

.btn-lg {
  padding: 8px 16px !important;
  font-size: 0.9375rem !important;
  min-height: 36px;
}

/* Ícones em botões não devem distorcer */
.btn i {
  font-size: 1em;
  vertical-align: middle;
}

/* INPUT GROUPS */
.input-group {
  margin-bottom: 8px !important;
}

.input-group-text {
  padding: 4px 8px !important;
  font-size: 0.8125rem !important;
  line-height: 1.3;
}

/* CHECKBOXES E RADIOS */
.form-check {
  margin-bottom: 6px !important;
  padding-left: 1.25em;
}

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

.form-check-label {
  font-size: 0.8125rem !important;
  line-height: 1.3;
}

/* BADGES */
.badge {
  padding: 3px 6px !important;
  font-size: 0.7rem !important;
  line-height: 1.2;
}

/* LIST GROUPS */
.list-group-item {
  padding: 8px 10px !important;
  font-size: 0.8125rem !important;
}

/* MODALS */
.modal-header {
  padding: 10px 15px !important;
}

.modal-body {
  padding: 12px 15px !important;
}

.modal-footer {
  padding: 10px 15px !important;
  gap: 8px;
}

/* ALERTS */
.alert {
  padding: 8px 12px !important;
  font-size: 0.8125rem !important;
  margin-bottom: 12px !important;
}

/* FIELDSETS E LEGENDS */
fieldset {
  margin-bottom: 12px !important;
  padding: 10px !important;
  border: 1px solid #dee2e6;
  border-radius: 6px;
}

legend {
  font-size: 0.875rem !important;
  padding: 0 6px !important;
  margin-bottom: 6px !important;
  width: auto;
  float: none;
}

/* HR */
hr {
  margin: 12px 0 !important;
}

/* PAGINATION */
.pagination {
  margin-bottom: 8px !important;
}

.page-link {
  padding: 4px 8px !important;
  font-size: 0.8125rem !important;
  line-height: 1.3;
}

/* FORM TEXT (textos de ajuda) */
.form-text {
  margin-top: 2px !important;
  font-size: 0.7rem !important;
  line-height: 1.2;
}

/* BREADCRUMBS */
.breadcrumb {
  padding: 6px 10px !important;
  font-size: 0.8125rem !important;
  margin-bottom: 12px !important;
}

.breadcrumb-item + .breadcrumb-item {
  padding-left: 0.4rem;
}

/* TABS */
.nav-tabs .nav-link {
  padding: 6px 10px !important;
  font-size: 0.8125rem !important;
}

.tab-content {
  padding-top: 10px;
}

/* ACCORDIONS */
.accordion-button {
  padding: 8px 12px !important;
  font-size: 0.8125rem !important;
}

.accordion-body {
  padding: 10px 12px !important;
  font-size: 0.8125rem !important;
}

/* DROPDOWNS */
.dropdown-menu {
  font-size: 0.8125rem !important;
  padding: 4px 0;
}

.dropdown-item {
  padding: 4px 12px !important;
}

/* TOOLTIPS E POPOVERS */
.tooltip-inner {
  font-size: 0.75rem !important;
  padding: 4px 8px !important;
}

.popover-body {
  font-size: 0.8125rem !important;
  padding: 8px 10px !important;
}

/* PROGRESS BARS */
.progress {
  height: 1rem !important;
  font-size: 0.7rem !important;
}

/* SPINNERS */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* REDUÇÃO DE ESPAÇAMENTO GERAL DO MAIN CONTENT */
.main-content {
  padding: 20px !important;
}

@media (max-width: 767.98px) {
  .main-content {
    padding: 15px 10px !important;
  }
}

/* DATA TABLES (se usar DataTables) */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  padding: 4px 8px !important;
  font-size: 0.8125rem !important;
  height: 30px !important;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  font-size: 0.8125rem !important;
}

/* SELECT2 (se usar Select2) */
.select2-container--default .select2-selection--single {
  height: 30px !important;
  padding: 2px 8px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 26px !important;
  font-size: 0.8125rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 28px !important;
}

/* OTIMIZAÇÃO ESPECÍFICA PARA MAC - Remove espaços desnecessários */
@media (min-width: 1200px) {
  .container,
  .container-lg,
  .container-md,
  .container-sm,
  .container-xl {
    max-width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}

/* ===== COMPACTAÇÃO ESPECÍFICA DO MENU LATERAL ===== */

/* MENU HEADERS - Reduzir espaçamento */
.sidebar-nav .menu-header {
  padding: 10px 20px 6px !important;
  font-size: 0.7rem !important;
  margin-bottom: 2px !important;
  line-height: 1.2;
}

/* MENU ITEMS - Links principais mais compactos */
.sidebar-nav a {
  padding: 8px 20px !important;
  font-size: 0.8125rem !important;
  line-height: 1.3;
  min-height: 36px;
}

.sidebar-nav a:hover {
  padding-left: 22px !important;
}

/* ÍCONES - Menores e mais próximos */
.sidebar-nav i {
  margin-right: 10px !important;
  font-size: 1.125rem !important;
  width: 20px !important;
}

/* SUBMENU - Ainda mais compacto */
.sidebar-nav .menu-sub {
  margin-top: 2px;
  margin-bottom: 2px;
}

.sidebar-nav .menu-sub a {
  padding: 6px 20px 6px 48px !important;
  font-size: 0.75rem !important;
  line-height: 1.2;
  min-height: 30px;
}

.sidebar-nav .menu-sub a:hover {
  padding-left: 50px !important;
}

.sidebar-nav .menu-sub i {
  font-size: 1rem !important;
  margin-right: 8px !important;
  width: 18px !important;
}

/* MENU ITEM - Reduzir espaçamento entre itens */
.sidebar-nav .menu-item {
  margin-bottom: 2px !important;
}

/* ACTIVE STATE - Ajustar altura da barra */
.sidebar-nav .menu-item.active:before,
.layout-wrapper:not(.layout-horizontal) .bg-menu-theme .menu-inner > .menu-item.active:before {
  height: 36px !important;
  width: 3px !important;
}

/* MENU TOGGLE - Seta de dropdown */
.sidebar-nav .menu-toggle::after {
  font-size: 1rem !important;
  right: 16px !important;
}

/* MENU FOOTER - Mais compacto */
.menu-footer {
  padding: 12px 16px !important;
  font-size: 0.7rem !important;
}

.menu-footer hr {
  margin: 8px 0 !important;
}

/* SIDEBAR NAV - Reduzir padding geral */
.sidebar-nav {
  padding: 12px 0 !important;
}

/* ESTADOS DO MENU */
.sidebar-nav a.active {
  font-weight: 500;
}

/* OTIMIZAÇÃO PARA THEME-DEFAULT.CSS - Sobrescrever se necessário */
.bg-menu-theme .menu-header {
  padding: 10px 20px 6px !important;
  font-size: 0.7rem !important;
}

.bg-menu-theme .menu-link {
  padding: 8px 20px !important;
  font-size: 0.8125rem !important;
}

.bg-menu-theme .menu-sub > .menu-item > .menu-link {
  padding: 6px 20px 6px 48px !important;
  font-size: 0.75rem !important;
}

.bg-menu-theme .menu-sub > .menu-item > .menu-link:before {
  left: 1.125rem !important;
  width: 0.25rem !important;
  height: 0.25rem !important;
}

.bg-menu-theme .menu-sub > .menu-item.active > .menu-link:not(.menu-toggle):before {
  left: 1rem !important;
  width: 0.625rem !important;
  height: 0.625rem !important;
}

/* MENU ICONS - Garantir tamanho uniforme */
.menu-icon {
  font-size: 1.125rem !important;
  width: 20px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* SIDEBAR COLLAPSED - Ajustes */
.sidebar.collapsed .sidebar-nav a {
  padding: 10px 0 !important;
  min-height: 40px;
}

.sidebar.collapsed .sidebar-nav a i {
  font-size: 1.25rem !important;
}

/* ESPACAMENTO VERTICAL ENTRE SEÇÕES */
.sidebar-nav > .menu-item + .menu-header {
  margin-top: 12px !important;
}

/* HOVER STATES - Ajustes finos */
.bg-menu-theme .menu-link:hover,
.bg-menu-theme .menu-link:focus {
  background-color: rgba(67, 89, 113, 0.04);
}

.bg-menu-theme .menu-item.open > .menu-toggle {
  background-color: rgba(67, 89, 113, 0.04);
}

/* ACTIVE SUBMENU ITEM */
.bg-menu-theme .menu-sub > .menu-item.active > .menu-link {
  color: #696cff;
  font-weight: 500;
}

/* MENU TEXT - Garantir alinhamento */
.sidebar-nav a span {
  vertical-align: middle;
  line-height: 1.3;
}

/* OTIMIZAÇÃO ADICIONAL - Menu muito grande em resoluções específicas */
@media (min-height: 900px) and (max-height: 1080px) {
  .sidebar-nav .menu-header {
    padding: 8px 20px 4px !important;
    margin-bottom: 1px !important;
  }
  
  .sidebar-nav a {
    padding: 6px 20px !important;
    min-height: 32px;
  }
  
  .sidebar-nav .menu-sub a {
    padding: 5px 20px 5px 48px !important;
    min-height: 28px;
  }
}

/* MENU COMPACTO EXTREMO - Para telas menores que 800px de altura */
@media (max-height: 800px) {
  .sidebar-nav .menu-header {
    padding: 6px 20px 3px !important;
    font-size: 0.65rem !important;
    margin-bottom: 0 !important;
  }
  
  .sidebar-nav a {
    padding: 5px 20px !important;
    font-size: 0.75rem !important;
    min-height: 28px;
  }
  
  .sidebar-nav .menu-sub a {
    padding: 4px 20px 4px 46px !important;
    font-size: 0.7rem !important;
    min-height: 24px;
  }
  
  .sidebar-nav i {
    font-size: 1rem !important;
    width: 18px !important;
    margin-right: 8px !important;
  }
  
  .sidebar-nav .menu-sub i {
    font-size: 0.875rem !important;
    width: 16px !important;
  }
  
  .sidebar-nav {
    padding: 8px 0 !important;
  }
  
  .sidebar-nav .menu-item {
    margin-bottom: 1px !important;
  }
}

/* OTIMIZAÇÃO PARA SCROLLBAR NO MENU */
.sidebar::-webkit-scrollbar {
  width: 5px !important;
}

.sidebar::-webkit-scrollbar-thumb {
  border-radius: 2px !important;
}

/* GARANTIR TRANSIÇÕES SUAVES */
.sidebar-nav a,
.sidebar-nav .menu-sub {
  transition: all 0.2s ease-in-out;
}

/* ===== COMPACTAÇÃO DO CONTEÚDO INTERNO DOS WIDGETS ===== */

/* TÍTULOS DOS WIDGETS - Reduzir */
.widget-title,
.widget-card h5,
.widget-card h6 {
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  margin: 0 !important;
}

/* VALORES KPI - Números grandes */
.kpi-value,
.widget-body h1,
.widget-body h2,
.widget-body .display-1,
.widget-body .display-2 {
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
  margin: 0.5rem 0 !important;
}

/* LABELS ABAIXO DOS VALORES - "disparos", "taxa de entrega", etc */
.kpi-label,
.widget-body p,
.widget-body small,
.widget-body .text-muted {
  font-size: 0.75rem !important;
  line-height: 1.3 !important;
  margin: 0 !important;
  margin-top: 0.25rem !important;
}

/* ÍCONES DOS WIDGETS - Reduzir */
.widget-icon {
  width: 28px !important;
  height: 28px !important;
  font-size: 0.95rem !important;
  border-radius: 0.375rem;
}

/* WIDGET BODY - Compactar padding e altura */
.widget-body {
  padding: 0.75rem !important;
  min-height: 160px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* WIDGET HEADER - Compactar */
.widget-header {
  padding: 0.625rem 0.75rem !important;
  min-height: 40px;
}

/* CHART LABELS - Textos dos gráficos */
.chart-container canvas {
  font-size: 0.75rem !important;
}

/* LABELS DO CHART.JS - Compactar */
.chart-container {
  height: 180px !important;
  position: relative;
}

/* TABELAS DENTRO DOS WIDGETS */
.widget-table {
  font-size: 0.75rem !important;
}

.widget-table th {
  padding: 0.5rem !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
}

.widget-table td {
  padding: 0.5rem !important;
  font-size: 0.75rem !important;
}

/* LABELS DOS EIXOS DO GRÁFICO (LIGACAO, WHATSAPP, EMAIL) */
.widget-body .chart-labels,
.widget-body text,
.widget-body tspan {
  font-size: 0.75rem !important;
}

/* BOTÕES DE AÇÃO DO WIDGET (lixeira, etc) */
.widget-action-btn {
  font-size: 0.95rem !important;
  padding: 0.25rem !important;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* BADGES DENTRO DOS WIDGETS */
.widget-body .badge {
  font-size: 0.7rem !important;
  padding: 3px 6px !important;
}

/* SEPARADORES/DIVISORES */
.widget-body hr {
  margin: 0.5rem 0 !important;
}

/* LISTAS DENTRO DOS WIDGETS */
.widget-body ul,
.widget-body ol {
  font-size: 0.75rem !important;
  padding-left: 1.25rem;
  margin: 0.5rem 0 !important;
}

.widget-body li {
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

/* VALORES SECUNDÁRIOS (porcentagens, variações) */
.widget-body .secondary-value,
.widget-body .percentage,
.widget-body .variation {
  font-size: 0.8125rem !important;
  font-weight: 500;
}

/* AJUSTES ESPECÍFICOS PARA CHART.JS */
/* Forçar fonte menor nos gráficos */
#widgets-container canvas {
  font-family: 'Segoe UI', 'Public Sans', -apple-system, sans-serif !important;
}

/* CARD GERAL - Garantir compactação */
.widget-card {
  font-size: 0.875rem;
}

/* OTIMIZAÇÃO PARA 4 COLUNAS */
@media (min-width: 1200px) {
  .widget-body {
    min-height: 150px !important;
  }
  
  .kpi-value {
    font-size: 1.625rem !important;
  }
  
  .chart-container {
    height: 170px !important;
  }
}

/* TELAS MUITO GRANDES - Pode aumentar um pouco */
@media (min-width: 1600px) {
  .kpi-value {
    font-size: 1.875rem !important;
  }
  
  .widget-body {
    min-height: 170px !important;
  }
  
  .chart-container {
    height: 190px !important;
  }
}

/* GARANTIR QUE TEXTOS NÃO QUEBREM */
.widget-title,
.kpi-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Se o título for muito grande, permitir quebra mas manter compacto */
.widget-header.multi-line .widget-title {
  white-space: normal;
  line-height: 1.2;
  max-height: 2.4em;
  overflow: hidden;
}

/* LOADING STATE - Compactar */
.widget-loading {
  font-size: 0.8125rem !important;
  min-height: 140px !important;
}

.widget-loading .spinner-border {
  width: 1.75rem !important;
  height: 1.75rem !important;
}

/* EMPTY STATE DENTRO DO WIDGET */
.widget-body .empty-state {
  font-size: 0.75rem !important;
  color: #999;
  padding: 1rem 0;
}

.widget-body .empty-state i {
  font-size: 2rem !important;
  opacity: 0.3;
  margin-bottom: 0.5rem;
}