/* CSS */

/* ===================== */
/* App Layout Shell      */
/* ===================== */

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

/* Fixed top header */
.app-header {
  position: fixed;
  top: 0;
  left: 72px;
  right: 0;
  z-index: 1030;
  background-color: #ffffff;
  border-bottom: 1px solid #e0e0e0;
  /* box-shadow: 0 1px 3px rgba(0,0,0,0.08); */
  height: 56px;
  padding: 0 8px;
  transition: left 0.3s ease-in-out;
}

.sidebar-open .app-header {
  left: 250px;
}

/* Fixed left sidebar — always visible, collapses to icon strip */
.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 72px;
  z-index: 1020;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease-in-out;
  background-color: #ffffff;
  border-right: 1px solid #e8eaed;
}

.sidebar-open .app-sidebar {
  width: 250px;
}

/* Sidebar brand row (logo + text + hamburger) */
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 56px;
  flex-shrink: 0;
  border-bottom: 1px solid #e8eaed;
  background-color: #ffffff;
  padding: 0;
  overflow: hidden;
}

.sidebar-open .sidebar-brand {
  justify-content: flex-start;
  padding: 0 12px;
  gap: 0;
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.sidebar-open .sidebar-brand-link {
  flex: 1;
  overflow: hidden;
}

.sidebar-brand-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-weight: 700;
  color: #3c4043;
  font-size: 1rem;
  margin-left: 10px;
  white-space: nowrap;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width 0.25s ease, opacity 0.15s ease;
}

.sidebar-open .sidebar-brand-text {
  max-width: 140px;
  opacity: 1;
}

.sidebar-hamburger {
  background: none;
  border: none;
  color: #5f6368;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  flex-shrink: 0;
}

.sidebar-hamburger:hover {
  color: #1a73e8;
}

/* Hamburger inside sidebar-brand: only on mobile */
.sidebar-brand-toggle {
  display: none;
  margin-left: auto;
  flex-shrink: 0;
}

@media (max-width: 991.98px) {
  .sidebar-open .sidebar-brand-toggle {
    display: flex;
    align-items: center;
  }
}

/* Scrollable nav area */
.app-sidebar .sidebar-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Main content */
.app-content {
  margin-top: 56px;
  margin-left: 72px;
  min-height: calc(100vh - 56px);
  transition: margin-left 0.3s ease-in-out;
}

.sidebar-open .app-content {
  margin-left: 250px;
}

/* Collapse nav labels when sidebar is narrow */
body:not(.sidebar-open) .sidebar-nav .nav-link {
  justify-content: center;
  padding: 9px 8px;
}

body:not(.sidebar-open) .sidebar-nav .nav-icon {
  margin-right: 0;
  min-width: auto;
}

body:not(.sidebar-open) .sidebar-nav .nav-link p {
  max-width: 0;
  opacity: 0;
}

.sidebar-nav .nav-link p {
  padding: 0;
  margin: 0;
  white-space: nowrap;
  max-width: 160px;
  opacity: 1;
  overflow: hidden;
  transition: max-width 0.25s ease, opacity 0.15s ease;
}

/* Mobile: sidebar slides in as overlay */
@media (max-width: 991.98px) {

  .app-sidebar {
    width: 250px;
    transform: translateX(-250px);
    transition: transform 0.3s ease-in-out;
  }

  .sidebar-open .app-sidebar {
    transform: translateX(0);
    z-index: 1040;
    box-shadow: 4px 0 12px rgba(0,0,0,0.15);
  }

  .app-header {
    left: 0;
  }

  .sidebar-open .app-header {
    left: 0;
  }

  .app-content {
    margin-left: 0;
  }

  .sidebar-open .app-content {
    margin-left: 0 !important;
  }

  body:not(.sidebar-open) .sidebar-nav .nav-link {
    justify-content: flex-start;
    padding: 9px 16px;
  }

  body:not(.sidebar-open) .sidebar-nav .nav-icon {
    margin-right: 8px;
    min-width: 1.6rem;
  }

  body:not(.sidebar-open) .sidebar-nav .nav-link p {
    max-width: 160px;
    opacity: 1;
  }
}

/* ===================== */
/* Sidebar nav items     */
/* ===================== */

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

.sidebar-nav .nav-item {
  list-style: none;
}

.sidebar-nav .nav-link {
  border-radius: 0 24px 24px 0;
  margin-right: 12px;
  color: #3c4043;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 9px 16px;
  transition: background-color 0.15s ease, padding 0.3s ease, justify-content 0s;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.sidebar-nav .nav-link:hover {
  background-color: #f1f3f4;
  color: #1a73e8;
}

.sidebar-nav .nav-link:hover .nav-icon {
  color: #1a73e8;
}

.sidebar-nav .nav-link.active {
  background-color: #e8f0fe;
  color: #1a73e8;
  font-weight: 600;
}

.sidebar-nav .nav-link.active .nav-icon {
  color: #1a73e8;
}

.sidebar-nav .nav-icon {
  color: #5f6368;
  font-size: 1rem;
  min-width: 1.6rem;
  margin-right: 8px;
}

/* Nav section header */
.nav-header {
  color: #80868b;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 8px 16px;
  text-transform: uppercase;
}

/* ===================== */
/* Header                */
/* ===================== */

.user-avatar {
  color: #5f6368;
  font-size: 1.4rem;
  line-height: 1;
}
.user-avatar:hover {
  color: #1a73e8;
}
.app-header .nav-link.dropdown-toggle::after {
  display: none;
}
.app-header .dropdown-menu {
  min-width: 180px;
  border-radius: 8px;
  margin-top: 4px;
}
.app-header .dropdown-item {
  font-size: 0.9rem;
  padding: 8px 16px;
}
.app-header .dropdown-item:hover {
  background-color: #f1f3f4;
  color: #1a73e8;
}

/* ===================== */
/* Page header           */
/* ===================== */

.page-header h1 {
  background-color: transparent;
  color: #202124;
  font-size: 1.75rem;
  font-weight: 400;
  padding: 0;
  display: block;
  text-align: left;
  border: none;
  box-shadow: none;
  letter-spacing: -0.01em;
}
.page-header {
  padding: 24px 0 8px 0;
}

/* AJAX content transition */
#main-content {
  transition: opacity 0.15s ease;
}
#main-content.content-loading {
  opacity: 0.4;
  pointer-events: none;
}

/* ===================== */
/* General               */
/* ===================== */

body {
  padding: 0;
  margin: 0;
  background-color: #f8f9fa;
}

h1 {
  margin: 0;
  font-size: 1.75rem;
  background-color: transparent;
  color: #202124;
  display: block;
  padding: 0;
  text-align: left;
  font-weight: 400;
}

h2 {
  padding-top: 15px;
  padding-bottom: 10px;
  text-align: left;
  font-size: 1.8em;
  color: #2c2c2c;
}

h3 {
  padding: 10px;
  margin-bottom: 30px;
  font-size: 1.5em;
}

h4 {
  padding: 10px;
  margin-bottom: 0;
  font-size: 1.2em;
}

p {
  padding: 0 10px;
  font-size: 1em;
}

.contenido {
  transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
  margin-bottom: 20px;
  padding: 25px;
  background-color: #fff3e6;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#graficoapex {
  height: 100%;
}

.select2-container {
  width: 100% !important;
}

.select2-selection__choice {
  background-color: #e8f0fe !important;
  border-color: #c5d8fc !important;
  color: #1a73e8 !important;
}

/* ===================== */
/* Default button style  */
/* Use btn btn-outline-primary for all action buttons.        */
/* Use btn btn-outline-danger only for destructive actions.   */
/* ===================== */
.btn {
  font-size: 0.9rem;
}
.btn-outline-primary {
  border-width: 1.5px;
}
.btn-outline-danger {
  border-width: 1.5px;
}

/* ===================== */
/* Loader                */
/* ===================== */

#loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
}

.loader {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}
.loader::before, .loader::after {
  content: "";
  box-sizing: border-box;
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 5px solid #FFF;
  animation: prixClipFix 2s linear infinite;
}
.loader::after {
  transform: rotate3d(90, 90, 0, 180deg);
  border-color: #FF3D00;
}

@keyframes rotate {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes prixClipFix {
  0%        { clip-path: polygon(50% 50%, 0 0, 0 0, 0 0, 0 0, 0 0); }
  50%       { clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 0, 100% 0, 100% 0); }
  75%, 100% { clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 100% 100%, 100% 100%); }
}

/* ===================== */
/* Misc                  */
/* ===================== */

#pivotGrid {
  border: 1px solid #ccc;
  border-radius: 5px;
  overflow: hidden;
}

#mensajeSinDatos {
  display: none;
  padding: 15px;
  border: 1px solid red;
  border-radius: 10px;
  background-color: #f8d7da;
  color: red;
  margin-top: 20px;
}

#mensajeSinDatos button {
  cursor: pointer;
}

/* ===================== */
/* DevExpress overrides  */
/* ===================== */

.dx-pivotgrid .dx-pivotgrid-area td {
  color: #000000 !important;
  font-weight: 500 !important;
  padding: 7px 10px !important;
}
.dx-pivotgrid .dx-pivotgrid-area-data tbody td {
  text-align: right !important;
  color: #141414 !important;
  white-space: nowrap !important;
  border-left: 1px solid #ddd !important;
}
.dx-pivotgrid-fields-container .dx-sort {
  color: #000000 !important;
}
.dx-pivotgrid .dx-pivotgrid-collapsed .dx-expand,
.dx-pivotgrid .dx-pivotgrid-expanded .dx-expand {
  font: 14px/1 DXIcons !important;
  font-size: 18px !important;
  text-align: center !important;
  line-height: 18px !important;
  color: #007bd4 !important;
}
.dx-pivotgridfieldchooser .dx-area-fields[group] {
  padding: 5px !important;
  background-color: rgba(255, 225, 166, 0.27) !important;
}
.dx-pivotgrid .dx-data-header,
.dx-pivotgrid .dx-column-header,
.dx-pivotgrid .dx-area-description-cell.dx-pivotgrid-background,
.dx-pivotgrid .dx-total,
.dx-pivotgrid .dx-area-description-cell {
  background-color: rgba(255, 225, 166, 0.27) !important;
}
.dx-pivotgrid .dx-area-tree-view td.dx-white-space-column {
  border-top: 1px solid transparent !important;
  background-color: rgba(255, 225, 166, 0.27) !important;
  width: 24px !important;
  padding: 0 !important;
  min-width: 24px !important;
}
.dx-pivotgrid .dx-grandtotal {
  background-color: #fffcd4 !important;
}
.dx-pivotgrid-fields-container .dx-area-field.dx-area-box {
  background-color: #ffffff !important;
  margin-bottom: 4px !important;
  border: 1px solid #bfbfbf !important;
  padding: 7px 10px !important;
}
.dx-pivotgrid-fields-container .dx-header-filter {
  color: #03A9F4 !important;
  font: 14px/1 DXIcons !important;
}
.dx-pivotgrid-fields-container .dx-header-filter:before {
  content: "\f050" !important;
}
.dx-pivotgrid-fields-container .dx-header-filter-empty {
  color: rgba(149, 149, 149, 0.5) !important;
}
.demo-container, #contenido {
  padding: 20px !important;
  box-sizing: border-box !important;
}
.demo-container {
  min-width: 960px !important;
}

h1 {
  font-size: 1.5rem !important;
}

h2 {
  font-size: 1.2rem !important;
}

.card-body .card-title {
  padding: 0 !important;
  font-size: 1.2rem !important;
}

.card-body .text-muted {
  padding: 0 !important;
}

/* ===================== */
/* Clean table style     */
/* ===================== */

.clean-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}

.clean-table thead th {
  font-size: 0.8rem;
  font-weight: 500;
  color: #80868b;
  border: none;
  border-bottom: 1px solid #e8eaed;
  padding: 10px 16px 10px;
  background: transparent;
}

.clean-table tbody tr {
  border-bottom: 1px solid #f1f3f4;
}

.clean-table tbody tr:last-child {
  border-bottom: none;
}

.clean-table tbody td {
  padding: 4px 4px;
  border: none;
  color: #202124;
  font-size: 0.88rem;
  vertical-align: middle;
  background: transparent;
}

.clean-table tbody tr:hover td {
  background-color: #f8f9fa;
}

.clean-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}

.clean-table thead th.sortable:hover {
  color: #3c4043;
}

.clean-table thead th .sort-icon {
  display: inline-block;
  margin-left: 5px;
  opacity: 0.35;
  font-size: 0.7rem;
}

.clean-table thead th.sort-asc .sort-icon,
.clean-table thead th.sort-desc .sort-icon {
  opacity: 1;
  color: #1a73e8;
}

/* Search input */
.table-search-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.table-search-wrapper .table-search-icon {
  position: absolute;
  left: 11px;
  color: #80868b;
  font-size: 0.8rem;
  pointer-events: none;
}

.table-search-input {
  padding: 6px 12px 6px 30px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #3c4043;
  background: #fff;
  outline: none;
  width: 220px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.table-search-input::placeholder {
  color: #aaa;
}

.table-search-input:focus {
  border-color: #bbb;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.06);
}