/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100vh;           /* altura fija igual al viewport */
  margin: 0;
  overflow: hidden;        /* evitar scroll en toda la página */
  display: flex;
  flex-direction: column;
}


/* MENÚ */
.menu-bar {
  background-color: #2c3e50;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: 48px;
  user-select: none;
  position: relative;
  z-index: 1000; 
  overflow: hidden;
}

.menu-bar .logo {
  font-weight: 700;
  font-size: 1.2rem;
  cursor: default;
}

.menu-bar .hamburger {
  display: block;
  font-size: 1.5rem;
  cursor: pointer;
  user-select: none;
}

.menu-bar nav ul {
  list-style: none;
  display: none;
  flex-direction: column;
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  background-color: #0078d7;
  padding: 1rem 0;
  z-index: 9999;  
  max-height: calc(100vh - 48px);  
  overflow-y: auto;
}

.menu-bar nav ul.show {
  display: flex;
}

.menu-bar nav ul li {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.menu-bar nav ul li:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.menu-bar nav ul li a {
  color: white;
  text-decoration: none;
  display: block;
  padding: 1em;
  width: 100%;
  height: 100%;
} 

/* Menú en pantallas grandes */
@media (min-width: 769px) {
  .menu-bar {
    justify-content: flex-start;
  }

  .menu-bar .hamburger {
    display: none;
  }

  .menu-bar nav ul {
    display: flex !important;
    position: static;
    flex-direction: row;
    padding: 0;
    background-color: transparent;
    z-index: auto;
    max-height: none;
    overflow: visible;
  }

  .menu-bar nav ul li {
    padding: 0.5rem 1rem;
    border-bottom: none;
  }
}

footer {
  flex-shrink: 0;
  text-align: center;
  padding: 1rem 0 0 0;
  font-size: 0.9rem;
  color: #666;
  border-top: 1px solid #ddd;
}


/* LAYOUT (sidebar + main content) */
.layout {
  display: flex;
  height: calc(100vh - 48px); /* alto del viewport menos header */
  overflow: hidden; /* evitar que layout cause scroll */
}

.sidebar {
  width: 250px;
  background-color: #2c3e50;
  color: #ecf0f1;
  padding: 20px 15px;
  overflow-y: auto;         
  height: auto;
  min-height: 0;           
  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.sidebar {
  width: 250px;
  background-color: #2c3e50;
  color: #ecf0f1;
  padding: 20px 15px;
  height: 100%;
  overflow-y: auto;
}
.sidebar h2 {
  font-size: 1.1rem;
  margin: 20px 0 10px;
  border-bottom: 1px solid #34495e;
  padding-bottom: 5px;
}

.sidebar a {

  display: block;
  color: #bdc3c7;
  padding: 8px 10px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.3s;
}

.sidebar a:hover {
  background-color: #34495e;
  color: white;
}

.main-content {
  flex-grow: 1;
  padding: 30px;
  height: 100%;
  overflow-y: auto;
}

.main-content h1 {
  margin-bottom: 1.5rem;
  color: #2c3e50;
  font-size: 1.8rem;
  text-align: left;
}


/* Sidebar y layout para pantallas pequeñas */
@media (max-width: 768px) {
  .menu-lateral {
    position: fixed;
    top: 48px;
    left: -250px; /* oculto por defecto */
    width: 240px;
    height: calc(100% - 48px);
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    transition: left 0.3s ease;
    z-index: 2001; /* arriba del contenido y toggle */
    overflow-y: auto;
  }

  .menu-lateral.show {
    left: 0; /* visible */
  }

  .main-content {
    position: relative;
    z-index: 1; /* más abajo que menú */
  }

  .sidebar-toggle {
    position: fixed;
    top: 60px; /* ajusta según tu diseño */
    left: 10px; /* fijo para que el botón siempre se vea */
    background-color: #2c3e50;
    color: white;
    padding: 8px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    z-index: 2002; /* encima del menú */
  }
  
 
  .sidebar-toggle {
    transition: left 0.3s ease;
  }
  
}



/* Sidebar colapsado y toggle */
.menu-lateral.collapsed {
  width: 0;
  padding: 0;
  overflow: hidden;
  transition: width 0.3s ease, padding 0.3s ease;
}

.sidebar-toggle {
  position: fixed;
  top: 60px; /* ajusta según tu diseño */
  left: 240px; /* ancho original del sidebar */
  background-color: #2c3e50;
  color: white;
  padding: 8px;
  border-radius: 0 5px 5px 0;
  cursor: pointer;
  z-index: 1100; 
}

/* Ocultar sidebar en pantallas pequeñas */
@media (max-width: 768px) {
  .menu-lateral {
    position: fixed;
    left: -250px;
    top: 48px; /* altura del header */
    width: 240px;
    height: calc(100% - 48px);
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    transition: left 0.3s ease;
    z-index: 1001;
  }

  .menu-lateral.show {
    left: 0;
  }

  .toggle-sidebar {
    display: block;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
  }
}

/* En pantallas grandes ocultamos el botón de toggle */
@media (min-width: 769px) {
  .toggle-sidebar {
    display: none;
  }

  .menu-lateral {
    position: static;
    height: auto;
  }
}

.menu-lateral.collapsed + .sidebar-toggle {
  left: 0;
}

.sidebar-toggle.collapsed::before {
  content: "\276F"; /* símbolo > */
}

.sidebar-toggle::before {
  content: "\276E"; /* símbolo < */
}

.sidebar-toggle.collapsed {
  border-radius: 0 5px 5px 0;
}

/* TABLAS */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

thead {
  background-color: #0078d7;
  color: white;
}

thead th {
  text-align: left;
  padding: 0.75rem 1rem;
}

tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e0e0e0;
}

tbody tr:hover {
  background-color: #f1f1f1;
}

/* Tablas responsivas para pantallas pequeñas */
@media (max-width: 600px) {
  table, thead, tbody, th, td, tr {
    display: block;
  }

  thead {
    display: none;
  }

  tbody tr {
    background-color: white;
    margin: 0.8rem 0;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  }

  tbody td {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border: none;
    border-bottom: 1px solid #eee;
  }

  tbody td:last-child {
    border-bottom: none;
  }

  tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #0078d7;
    margin-right: 1rem;
  }
}

/* Tablas estilizadas */
.table-container {
  overflow-x: auto;
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background-color: #fff;
  border: 1px solid #ddd;
  font-family: 'Segoe UI', sans-serif;
}

.styled-table th,
.styled-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.styled-table th {
  background-color: #0078d7;
  color: white;
}

@media (max-width: 768px) {
  .styled-table thead {
    display: none;
  }

  .styled-table tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.5rem;
    background-color: #f9f9f9;
  }

  .styled-table td {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
  }

  .styled-table td::before {
    content: attr(data-label);
    font-weight: bold;
    color: #555;
  }
}

/* BOTONES Y FORMULARIOS */
.form-card {
  background-color: #fff;
  padding: 2rem;
  max-width: 800px;
  margin: 2rem auto;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-family: 'Segoe UI', sans-serif;
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.checkbox-group {
  flex-direction: row;
  align-items: center;
}

.checkbox-item {
  display: block;
  margin-bottom: 0.5rem;
}

fieldset {
  border: 1px solid #ddd;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

legend {
  font-weight: bold;
  padding: 0 0.5rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-actions button,
.form-actions .btn-secondary {
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.form-actions button {
  background-color: #0078d7;
  color: white;
}

.form-actions .btn-secondary {
  background-color: #f3f3f3;
  color: #333;
  text-decoration: none;
}

@media (max-width: 768px) {
  .form-card {
    padding: 1rem;
    max-width: 95%;
  }

  .form-actions {
    flex-direction: column;
  }
}

.search-form {
  margin: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.search-form input[type="text"] {
  padding: 0.5rem;
  font-size: 1rem;
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 5px;
}

/* Botones */
.btn-primary,
.btn-secondary,
.btn-small {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-primary {
  background-color: #0078d7;
  color: white;
  border: none;
}

.btn-primary:hover {
  background-color: #005fa3;
}

.btn-secondary {
  background-color: #eee;
  color: #333;
  border: 1px solid #ccc;
}

.btn-small {
  background-color: #f3f3f3;
  color: #0078d7;
  font-size: 0.85rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* PAGINACIÓN */
.pagination {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.pagination .page {
  padding: 0.4rem 0.75rem;
  background-color: #eee;
  border-radius: 4px;
  text-decoration: none;
  color: #0078d7;
  border: 1px solid #ccc;
}

.pagination .page.current {
  background-color: #0078d7;
  color: white;
  font-weight: bold;
  cursor: default;
}

.actions {
  margin-top: 1rem;
}

/* FORMULARIO LOGIN */
.login-form {
  max-width: 320px;
  margin: 2em auto;
  padding: 2em;
  border-radius: 8px;
  font-family: Arial, sans-serif;
  background-size: cover;
  background-position: center;
  position: relative;
  z-index: 1;
}

.login-form::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  z-index: -1;
}

.login-form label {
  display: block;
  margin-bottom: 0.3em;
  font-weight: bold;
  color: #333;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  padding: 0.5em;
  margin-bottom: 1.2em;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

.login-form button {
  background-color: #0078d7;
  border: none;
  color: white;
  padding: 0.6em 1em;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  font-size: 1.1rem;
}

.login-form button:hover {
  background-color: #005fa3;
}

.login-form p.message {
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  margin-top: 1rem;
}

/* Scrollbars personalizados (opcional) */
.menu-bar nav ul::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.main-content::-webkit-scrollbar {
  width: 8px;
}

.menu-bar nav ul::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

/* Contenedor flex para botones dentro del TD */
.btn-icon-group {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
}

/* Botones solo icono */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 18px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background-color: white;
  color: #333;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.btn-icon:hover {
  background-color: #e0e7ff;
  border-color: #0078d7; /* coincidiendo con azul tabla */
  color: #005a9e;
}

/* Iconos dentro del botón */
.btn-icon i {
  pointer-events: none;
  line-height: 1;
}

.btn-action-group {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
}

.btn-action-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 18px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background-color: white;
  color: #333;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.btn-action-icon:hover:not(:disabled) {
  background-color: #e0e7ff;
  border-color: #0078d7;
  color: #005a9e;
}

.btn-action-icon:disabled,
.btn-action-icon[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-action-icon i {
  pointer-events: none;
  line-height: 1;
}

/* Dropdown minimal styling (puedes adaptar) */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  background: white;
  border: 1px solid #ccc;
  cursor: pointer;
  border-radius: 6px;
  padding: 0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.dropdown-menu {
  position: absolute;
  top: 40px;
  left: 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-width: 150px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 1000;
}

.dropdown-item {
  background: none;
  border: none;
  padding: 6px 12px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}

.dropdown-item:hover {
  background-color: #e0e7ff;
}


.login-page-wrapper {
    position: fixed;
    inset: 0; 
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 0;
    overflow: hidden;
}

.login-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.login-form {
    position: relative;
    z-index: 2;
    background-color: rgba(255, 255, 255, 0.95);
	 background-image: url('/tinyERP/assets/bg.jpg');
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-family: 'Segoe UI', sans-serif;
}

.login-form .login-image-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.login-form .login-image {
    max-width: 120px;
    height: auto;
}

.login-form label {
    font-weight: 600;
    color: #333;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    padding: 0.7rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
    transition: border-color 0.3s ease;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
    border-color: #4e54c8;
    outline: none;
}

.login-form label input[type="checkbox"] {
    margin-right: 0.4rem;
    transform: scale(1.1);
}

.login-form button[type="submit"] {
    padding: 0.75rem;
    background-color: #4e54c8;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.login-form button[type="submit"]:hover {
    background-color: #3c40aa;
}

.promo {
    background-color: #fffde7;
    border: 1px solid #fff59d;
    padding: 20px;
    border-radius: 14px;
    font-family: 'Nunito', sans-serif;
    color: #f57f17;
    text-align: center;
    max-width: 340px;
    margin: 20px auto;
    box-shadow: 0 2px 10px rgba(245, 127, 23, 0.15);
    transition: background-color 0.3s ease;
}

.promo:hover {
    background-color: #fff9c4;
}

.promo small {
    display: block;
    margin-top: 10px;
    font-size: 0.9em;
    color: #f9a825;
}
