/* assets/css/styles.css */
:root {
  --primary-color: #28a745;
  --secondary-color: #218838;
  --accent-color: #ffc107;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f5f5;
  color: #333;
}

/* Header y Navbar */
.navbar-dark.bg-success {
  background-color: var(--primary-color) !important;
}

.navbar-brand {
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Formularios */
.card {
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.card-header {
  background-color: var(--primary-color);
  color: white;
  font-weight: bold;
  border-radius: 10px 10px 0 0 !important;
  padding: 15px 20px;
}

.card-body {
  padding: 25px;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25);
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.area-input-container {
  max-width: 100%;
}

.area-input {
  flex: 0 1 auto !important;
  width: auto !important;
  min-width: 100px !important;
  max-width: 300px !important;
}

/* Dashboard */
.dashboard-stats .card {
  transition: transform 0.3s ease-in-out;
  border-left: 4px solid var(--primary-color);
}

.dashboard-stats .card:hover {
  transform: translateY(-5px);
}

.dashboard-stats .card-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
}

/* Tablas */
.table-hover tbody tr:hover {
  background-color: rgba(40, 167, 69, 0.1);
}

.table th {
  background-color: var(--primary-color);
  color: white;
}

/* Badges y estados */
.badge-pending {
  background-color: #ffc107;
  color: #212529;
}

.badge-approved {
  background-color: #28a745;
  color: white;
}

.badge-rejected {
  background-color: #dc3545;
  color: white;
}

.badge-in-process {
  background-color: #17a2b8;
  color: white;
}

/* Footer */
footer {
  margin-top: auto;
}

footer a {
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .card {
    margin-bottom: 15px;
  }

  .dashboard-stats .col-md-3 {
    margin-bottom: 15px;
  }
}

/* ==========================
   Sidebar - Layout Estático
   ========================== */
#sidebarMenu {
  width: 260px;
  min-height: calc(100vh - 56px);
  flex-shrink: 0;
}

#sidebarMenu .sidebar-content {
  padding: 1rem 0;
}

/* Área de scroll para menú */
#sidebarMenu .menu-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Enlaces del menú */
#sidebarMenu .nav-link {
  color: rgba(255, 255, 255, .8);
  border-left: 3px solid transparent;
  border-radius: 0;
  white-space: nowrap;
  padding: 0.5rem 1rem;
}

#sidebarMenu .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .06);
}

#sidebarMenu .nav-link.active,
#sidebarMenu .nav-link[aria-current="page"] {
  color: #fff;
  background: rgba(13, 110, 253, .15);
  border-left-color: #0d6efd;
  font-weight: 600;
}

#sidebarMenu .nav-link:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

/* Submenús */
#sidebarMenu .collapse .nav-link {
  padding-left: 2.5rem;
  font-size: 0.9rem;
}

#sidebarMenu .nav-link .fa-chevron-down {
  transition: transform .2s ease;
}

#sidebarMenu .nav-link[aria-expanded="true"] .fa-chevron-down {
  transform: rotate(180deg);
}

/* Colapsables - siempre vertical */
#sidebarMenu .collapse,
#sidebarMenu .collapsing {
  width: 100% !important;
}

#sidebarMenu .collapse .nav {
  flex-direction: column !important;
  flex-wrap: nowrap !important;
}

#sidebarMenu .collapse .nav-item {
  width: 100% !important;
  display: block !important;
}

/* Forzar columna única */
#sidebarMenu .nav,
#sidebarMenu ul {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
}

#sidebarMenu .nav-item,
#sidebarMenu li {
  display: block !important;
  width: 100% !important;
}

#sidebarMenu .nav-link {
  display: flex !important;
  width: 100% !important;
}

/* Sección usuario (abajo) */
#sidebarMenu hr {
  margin: 0.5rem 1rem;
}

#sidebarMenu .user-section {
  padding: 0.5rem 1rem;
}

/* ========================== 
   Layout Principal (Admin con Sidebar)
   ========================== */
/* Para nueva estructura con admin-wrapper */
.admin-wrapper {
  display: flex;
  min-height: calc(100vh - 56px);
}

.admin-wrapper main {
  flex: 1;
  padding: 1rem;
}

/* Para estructura existente con container-fluid > row */
.container-fluid>.row {
  display: flex;
  flex-wrap: nowrap;
}

.container-fluid>.row>#sidebarMenu {
  flex: 0 0 260px;
  width: 260px;
}

.container-fluid>.row>main {
  flex: 1;
  max-width: calc(100% - 260px);
}

/* ========================== 
   Responsive
   ========================== */
@media (max-width: 767.98px) {
  #sidebarMenu {
    display: none;
  }

  #sidebarMenu.show {
    display: block;
    position: fixed;
    top: 56px;
    left: 0;
    width: 280px;
    height: calc(100vh - 56px);
    z-index: 1000;
    overflow-y: auto;
  }
}