/* ============================================
   PALETA CORPORATIVA - MAÍZ Y ACHIRAS
   Colores extraídos del logo: verde #00AA58,
   amarillo #FEF112, rojo #ED343C
   ============================================ */

:root {
  --maiz-verde: #00AA58;
  --maiz-verde-dark: #007A3D;
  --maiz-verde-light: #E6F7EE;
  --maiz-amarillo: #FEF112;
  --maiz-amarillo-dark: #C8B800;
  --maiz-rojo: #ED343C;
  --maiz-rojo-dark: #C41E2A;

  /* Bootstrap overrides */
  --bs-primary: #00AA58;
  --bs-primary-rgb: 0, 170, 88;
  --bs-secondary: #6c757d;
  --bs-secondary-rgb: 108, 117, 125;
  --bs-success: #00AA58;
  --bs-success-rgb: 0, 170, 88;
  --bs-warning: #FEF112;
  --bs-warning-rgb: 254, 241, 18;
  --bs-danger: #ED343C;
  --bs-danger-rgb: 237, 52, 60;
  --bs-link-color: #007A3D;
  --bs-link-hover-color: #005a2d;
}

/* ---------- BRAND / LOGO ---------- */
.brand-link {
  background-color: #005a2d !important;
  color: #fff !important;
}
.sidebar-brand {
  background-color: #005a2d !important;
}

/* ---------- SIDEBAR ---------- */
.app-sidebar,
.main-sidebar {
  background-color: #005a2d !important;
}
.app-sidebar .nav-link,
.main-sidebar .nav-sidebar .nav-link {
  color: rgba(255,255,255,.85) !important;
  border-left: 3px solid transparent;
  transition: background-color .15s ease, border-color .15s ease;
}
.app-sidebar .nav-link:hover,
.main-sidebar .nav-sidebar .nav-link:hover {
  background-color: #007A3D !important;
  color: #FEF112 !important;
}
.app-sidebar .nav-link.active,
.main-sidebar .nav-sidebar .nav-link.active {
  background-color: #FEF112 !important;
  color: #005A2D !important;
  border-left-color: #00AA58 !important;
  font-weight: 600;
}
/* Ancestros del item activo — mismo tono amarillo sin borde */
.app-sidebar .nav-link.active-parent,
.main-sidebar .nav-sidebar .nav-link.active-parent {
  background-color: #FEF112 !important;
  color: #005A2D !important;
}
.app-sidebar .nav-treeview .nav-link.active,
.main-sidebar .nav-sidebar .nav-treeview .nav-link.active {
  background-color: #FEF112 !important;
  color: #005A2D !important;
  border-left-color: #00AA58 !important;
}
.app-sidebar .nav-treeview .nav-link.active-parent,
.main-sidebar .nav-sidebar .nav-treeview .nav-link.active-parent {
  background-color: #FEF112 !important;
  color: #005A2D !important;
}
.app-sidebar .nav-header,
.main-sidebar .nav-header {
  color: #FEF112 !important;
  opacity: .7;
}

/* Submenu items: reemplazar icono por guion centrado */
.app-sidebar .nav-treeview .nav-link > .nav-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.4em;
	visibility: hidden;
}
.app-sidebar .nav-treeview .nav-link > .nav-icon::before {
	content: '—';
	visibility: visible;
	font-weight: 700;
	font-size: 14px;
	color: rgba(255,255,255,.55);
}

/* Niveles de submenu — degradado sutil para orientar profundidad */
.app-sidebar .nav-treeview {
  background-color: rgba(0, 0, 0, 0.12) !important;
}
.app-sidebar .nav-treeview .nav-treeview {
  background-color: rgba(0, 0, 0, 0.20) !important;
}
.app-sidebar .nav-treeview .nav-treeview .nav-treeview {
  background-color: rgba(0, 0, 0, 0.26) !important;
}

/* ---------- NAVBAR ---------- */
.navbar {
  background-color: #fff !important;
  border-bottom: 3px solid #FEF112;
}

/* ---------- BTN PRIMARY (verde) ---------- */
.btn-primary {
  --bs-btn-bg: #00AA58;
  --bs-btn-border-color: #00AA58;
  --bs-btn-hover-bg: #008a47;
  --bs-btn-hover-border-color: #007A3D;
  --bs-btn-active-bg: #007A3D;
  --bs-btn-active-border-color: #006633;
  --bs-btn-disabled-bg: #00AA58;
  --bs-btn-disabled-border-color: #00AA58;
}

/* ---------- BTN DANGER (rojo corporativo) ---------- */
.btn-danger {
  --bs-btn-bg: #ED343C;
  --bs-btn-border-color: #ED343C;
  --bs-btn-hover-bg: #C41E2A;
  --bs-btn-hover-border-color: #b81c28;
  --bs-btn-active-bg: #b81c28;
  --bs-btn-active-border-color: #a01a24;
}

/* ---------- BTN SUCCESS ---------- */
.btn-success {
  --bs-btn-bg: #00AA58;
  --bs-btn-border-color: #00AA58;
  --bs-btn-hover-bg: #008a47;
  --bs-btn-hover-border-color: #007A3D;
}

/* ---------- BTN WARNING (amarillo maíz) ---------- */
.btn-warning {
  --bs-btn-bg: #E6D600;
  --bs-btn-border-color: #E6D600;
  --bs-btn-color: #333;
  --bs-btn-hover-bg: #C8B800;
  --bs-btn-hover-border-color: #b3a400;
  --bs-btn-hover-color: #222;
  --bs-btn-active-color: #222;
}

/* ---------- BTN OUTLINE ---------- */
.btn-outline-primary {
  --bs-btn-color: #00AA58;
  --bs-btn-border-color: #00AA58;
  --bs-btn-hover-bg: #00AA58;
  --bs-btn-hover-border-color: #00AA58;
}

/* ---------- LINKS EN CARDS ---------- */
.card a:not(.btn) {
  color: #007A3D;
}
.card a:not(.btn):hover {
  color: #005a2d;
}

/* ---------- BADGES ---------- */
.bg-primary, .badge-primary { background-color: #00AA58 !important; }
.bg-success, .badge-success { background-color: #00AA58 !important; }
.bg-warning, .badge-warning { background-color: #FEF112 !important; color: #333 !important; }
.bg-danger, .badge-danger { background-color: #ED343C !important; }

/* ---------- SMALL-BOX ---------- */
.small-box.bg-primary { background-color: #00AA58 !important; }
.small-box.bg-success { background-color: #00AA58 !important; }
.small-box.bg-danger { background-color: #ED343C !important; }
.small-box.bg-warning { background-color: #C8B800 !important; }

/* ---------- SWEETALERT2 ---------- */
.swal2-confirm { background-color: #00AA58 !important; }
.swal2-cancel { background-color: #ED343C !important; }

/* ---------- PAGINATION ---------- */
.page-item.active .page-link {
  background-color: #00AA58;
  border-color: #00AA58;
}
.page-link {
  color: #007A3D;
}
.page-link:hover {
  color: #005a2d;
}

/* ---------- FORMS ---------- */
.form-control:focus {
  border-color: #00AA58;
  box-shadow: 0 0 0 .2rem rgba(0,170,88,.25);
}
.form-check-input:checked {
  background-color: #00AA58;
  border-color: #00AA58;
}

/* ---------- MODAL HEADER ---------- */
.modal-header {
  background-color: #007A3D;
  color: #fff;
}
.modal-header .btn-close {
  filter: brightness(0) invert(1);
}

/* ---------- TABLE HEAD ---------- */
.table-primary {
  background-color: #E6F7EE;
}

/* ---------- DROPDOWN ---------- */
.dropdown-item:active {
  background-color: #00AA58;
}

/* ---------- DATA TABLES ---------- */
.dataTables_wrapper .dt-buttons .btn {
  background-color: #00AA58;
  border-color: #00AA58;
  color: #fff;
}

/* ---------- PROGRESS BAR ---------- */
.progress-bar {
  background-color: #00AA58;
}

/* ---------- LOGIN PAGE ---------- */
.login-page {
  background: linear-gradient(135deg, #007A3D 0%, #00AA58 50%, #005a2d 100%);
}
.login-page .card {
  border-top: 4px solid #FEF112;
}

/* FLATPICKR */
.flatpickr-wrapper {
	display: block;
	width: 100%;
}

/* TAMAÑO Y POSICIONAMIENTO FUENTE ICONOS */
.hicono {
	vertical-align: middle;
}
.hicono-1x {
	font-size: 1.5em;
	vertical-align: middle; }
.hicono-2x {
	font-size: 2em;
	vertical-align: middle; }
.hicono-3x {
	font-size: 3em;
	vertical-align: middle; }
.hicono-4x {
	font-size: 4em;
	vertical-align: middle; }
.hicono-5x {
	font-size: 5em; 
	vertical-align: middle;}
.hicono-6x {
	font-size: 6em;
	vertical-align: middle; }
.hicono-7x {
	font-size: 7em;
	vertical-align: middle; }
.hicono-8x {
	font-size: 8em;
	vertical-align: middle; }
.hicono-9x {
	font-size: 9em;
	vertical-align: middle; }
.hicono-10x {
	font-size: 10em;
	vertical-align: middle; }

/* DataTables pagination mobile-friendly */
.dataTables_wrapper .dataTables_paginate .pagination {
   flex-wrap: wrap;
   justify-content: center;
   gap: .25rem;
}

/* DataTables: espacio entre controles length y filter en móvil */
@media (max-width: 768px) {
   .dataTables_wrapper .dataTables_length {
      margin-bottom: .75rem;
   }
}

@media (max-width: 576px) {
   .dataTables_wrapper .dataTables_paginate .page-link {
      padding: .25rem .5rem;
      font-size: .875rem;
   }
}

/* Small-box: evitar desborde de títulos */
.small-box-parametros .inner h3{
   white-space: normal;
   overflow-wrap: anywhere;
   word-break: break-word;
   line-height: 1.1;
   margin-bottom: .25rem;
}

/* Ajuste en laptop (col-lg-3 suele ser el que revienta) */
@media (min-width: 992px){
   .small-box .inner h3{
      font-size: 1.25rem;
   }
}

/* DataTables: centrar encabezados */
table.dataTable thead th{
   text-align: center !important;
   vertical-align: middle;
}

/* DataTables: mantener fondo table-warning aunque se apliquen clases de ordenamiento */
table.dataTable thead.table-warning th,
table.dataTable thead.table-warning th.sorting,
table.dataTable thead.table-warning th.sorting_asc,
table.dataTable thead.table-warning th.sorting_desc {
   background-color: var(--bs-warning) !important;
   color: var(--bs-dark) !important;
}


