/* Importing Google Fonts - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

:root {
  /* Light theme colors */
  --color-text-primary: #1F2936;
  --color-text-placeholder: #798EAE;
  --color-bg-primary: #f9fafb;
  --color-bg-secondary: #ECECFD;
  --color-bg-sidebar: #FFFFFF;
  --color-border-hr: #E2E8F0;
  --color-hover-primary: #695CFE;
  --color-hover-secondary: #e2e2fb;
  --color-shadow: rgba(0, 0, 0, 0.05);
}

body.dark-theme {
  /* Dark theme colors */
  --color-text-primary: #F1F5F9;
  --color-text-placeholder: #A6B7D2;
  --color-bg-primary: #111827;
  --color-bg-secondary: #3D4859;
  --color-bg-sidebar: #1f2937;
  --color-border-hr: #3B475C;
  --color-hover-secondary: #48566a;
  --color-shadow: rgba(0, 0, 0, 0.3);
}

hr {
    border: 2px solid #efefef;
    margin-top: 10px;
    margin-bottom: 10px;
}

body {
  min-height: 100vh;
  background: var(--color-bg-primary);
}

/* Input y Select */
.form-control, .form-select {
    width: 100%;
    font-size: 0.95rem;
    padding: 0.45rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.3s ease;
}




  .flex-column {
    flex-direction: column;
  }

  .gap-4 {
    gap: 1.5rem;
  }

  .gap-3 {
    gap: 1rem;
  }

  .text-muted {
    color: #6c757d;
  }
  
  .text-left {
    text-align: left;
}

  .text-primary {
    color: #0d6efd;
  }

  .p-3 {
    padding: 1rem;
  }

  .mb-0 {
    margin-bottom: 0;
  }

  .mb-2 {
    margin-bottom: 0.5rem;
  }

  .ms-1 {
    margin-left: 0.25rem;
  }

  .badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 0.35rem;
    color: #fff;
  }




  .align-middle {
    vertical-align: middle;
  }

.float-right {
    float: right;
}
/* Botones genéricos */
.btn {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: 0.375rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  border: none;
}

/* Botones específicos */
.btn-success {
  background-color: #198754;
  border-color: #198754;
  color: #fff;
}

.btn-success:hover {
  background-color: #157347;
}

.btn-danger {
  background-color: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

.btn-danger:hover {
  background-color: #bb2d3b;
}

.btn-warning {
  background-color: #ffc107;
  border-color: #ffc107;
  color: #212529;
}

.btn-warning:hover {
  background-color: #e0a800;
}

/* D-Flex y utilidades */
.d-flex {
  display: flex !important;
}

.d-none {
  display: none !important;
}

.gap-2 {
  gap: 0.5rem !important;
}

/* Tablas */
.table {
    font-size: 0.95rem;
    border-color: #dee2e6;
    width: 100%;
}

.table th,
.table td {
  vertical-align: middle;
  white-space: nowrap;
  padding: 5px;
}


.table thead th {
    background-color: transparent;
    color: #212529;
    text-align: left;
}

/* Table responsiveness */
.table-responsive {
  border-radius: 0.5rem;
  overflow-x: auto;
}

/* Cards */
.card {
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}



/* Shadow personalizado */
.shadow-sm {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}


.sidebar {
  position: sticky;
  top: 0;
  width: 270px;
  height: 100vh;
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  background: var(--color-bg-sidebar);
  border-right: 1px solid var(--color-border-hr);
  box-shadow: 0 3px 9px var(--color-shadow);
  transition: width 0.4s ease;
}

.sidebar.collapsed {
  width: 90px;
}

.sidebar .sidebar-header {
  padding: 20px 18px;
  display: flex;
  position: relative;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border-hr);
}

.sidebar-header .header-logo {
    height: 46px;
    display: block;
    object-fit: contain;
    transition: opacity 0.4s ease;
}

.sidebar.collapsed .header-logo {
  opacity: 0;
  pointer-events: none;
}

.site-nav .sidebar-toggle,
.sidebar-header .sidebar-toggle {
  height: 40px;
  width: 40px;
  border: none;
  cursor: pointer;
  display: flex;
  position: absolute;
  right: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
  transition: 0.4s ease;
}

.site-nav .sidebar-toggle:hover,
.sidebar-header .sidebar-toggle:hover {
  background: var(--color-hover-secondary);
}

.sidebar.collapsed .sidebar-header .sidebar-toggle {
  transform: translateX(-2px);
  height: 48px;
  width: 50px;
}

.sidebar-header .sidebar-toggle span {
  font-size: 1.75rem;
  transition: transform 0.4s ease;
}

.sidebar.collapsed .sidebar-toggle span {
  transform: rotate(180deg);
}

.sidebar .sidebar-content {
  flex: 1;
  padding: 20px 18px;
  overflow: hidden auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-text-placeholder) transparent;
}

.sidebar.collapsed .sidebar-content {
  scrollbar-width: none;
}

.sidebar-content .search-form {
  border-radius: 8px;
  min-height: 48px;
  margin: 5px 0 20px;
  align-items: center;
  display: flex;
  padding: 0 15px;
  white-space: nowrap;
  background: var(--color-bg-secondary);
  transition: 0.4s ease;
}

.sidebar.collapsed .search-form:hover {
  cursor: pointer;
}

.sidebar-content .search-form:focus-within,
.sidebar.collapsed .search-form:hover {
  background: var(--color-hover-secondary);
}

.sidebar-content .search-form span {
  color: var(--color-text-placeholder);
}

.search-form input {
  background: none;
  outline: none;
  border: none;
  width: 100%;
  margin-left: 15px;
  font-size: 1rem;
  color: var(--color-text-primary);
}

.search-form input::placeholder {
  color: var(--color-text-placeholder);
}

.sidebar-content .menu-list {
  display: flex;
  gap: 4px;
  list-style: none;
  flex-direction: column;
}

.menu-list .menu-link {
  display: flex;
  gap: 12px;
  white-space: nowrap;
  border-radius: 8px;
  padding: 12px 15px;
  align-items: center;
  text-decoration: none;
  color: var(--color-text-primary);
  transition: 0.3s ease;
}

.menu-link .menu-label {
  transition: opacity 0.3s ease;
}

.sidebar.collapsed .menu-link .menu-label {
  opacity: 0;
  pointer-events: none;
}

.menu-list .menu-link:is(:hover, .active) {
  color: #fff;
  background: var(--color-hover-primary);

}

.sidebar .sidebar-footer {
  padding: 20px 18px;
  white-space: nowrap;
  border-top: 1px solid var(--color-border-hr);
}

.sidebar-footer .theme-toggle {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  cursor: pointer;
  border: none;
  padding: 0 15px;
  white-space: nowrap;
  color: var(--color-text-primary);
  background: var(--color-bg-secondary);
  transition: 0.3s ease;
}

.sidebar-footer .theme-toggle:hover {
  background: var(--color-hover-secondary);
}

.theme-toggle .theme-label {
  display: flex;
  gap: 10px;
  align-items: center;
}

.theme-toggle .theme-label .theme-text {
  font-size: 1rem;
  transition: opacity 0.4s 0.2s ease;
}

.sidebar.collapsed .theme-toggle :where(.theme-text, .theme-toggle-track) {
  opacity: 0;
  width: 0;
  transition: all 0.2s ease;
}

.theme-toggle .theme-toggle-track {
  height: 24px;
  width: 48px;
  border-radius: 999px;
  margin-left: auto;
  background: #c3d1ec;
  position: relative;
  transition: opacity 0.4s 0.2s ease, background-color 0.3s ease;
}

body.dark-theme .theme-toggle-track {
  background: #695CFE;
}

.theme-toggle-track .theme-toggle-indicator {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

body.dark-theme .theme-toggle-indicator {
  transform: translateX(24px);
}

.site-nav {
  top: 0;
  display: none;
  padding: 15px 20px;
  position: sticky;
  background: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border-hr);
}

.site-nav .sidebar-toggle {
  position: unset;
}

.container {
  display: flex;
}

.container .main-content {
  flex: 1;
  padding: 30px;
  color: var(--color-text-primary);
}

.main-content .page-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.main-content .card {
  border-radius: 8px;
  padding: 20px;
  background-color: var(--color-bg-sidebar);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Responsive media query code for small screens */
@media (max-width: 768px) {
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.6);
    transition: 0.4s ease;
  }

  body:has(.sidebar:not(.collapsed))::before {
    opacity: 1;
    pointer-events: auto;
  }

  body:has(.sidebar:not(.collapsed)) {
    overflow: hidden;
  }

  .site-nav {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 20;
    width: 270px;
    transition: left 0.4s ease;
  }

  .sidebar.collapsed {
    left: -270px;
    width: 270px;
  }

  .container .main-content {
    padding: 30px 20px;
  }
}