body {
  background: var(--color-secondary-dark);
}

h1 {
  font-size: 2.0rem;
}

ul { 
  list-style: none; 
  padding: 0; 
}

li {
  padding: 10px;
  margin: 5px 0;
  background: #fff;
  cursor: grab;
}

.dashboard-login {
  width: 100%;
  max-width: 500px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  text-align: center;
  position: relative;
  height: auto;
}

/* =========================================
   CARD
========================================= */
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  width: 100%;
  margin: 0 auto;
}

/* =========================================
   MODULE COLORS
========================================= */
.module-color {
  --module-color: var(--color-main);
}

.module-card {
  position: relative;
  min-height: 330px;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, .07),
    rgba(255, 255, 255, .025)
  );
  box-shadow: 
    0 12px 35px rgba(0, 0, 0, .18),
    inset 0 1px 0 rgba(255, 255, 255, .03);
  overflow: hidden;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}

/* Halo interior */
.module-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at 0% 0%,
    var(--module-color),
    transparent 55%
  );
  opacity: .06;
  pointer-events: none;
  transition: opacity .4s ease, transform .4s ease;
}

/* =========================================
   HOVER
========================================= */
.module-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--module-color) 45%, transparent);
  box-shadow: 
    0 15px 40px rgba(0, 0, 0, .35),
    0 0 25px color-mix(in srgb, var(--module-color) 20%, transparent);
}

.module-card:hover::before {
  opacity: .15;
}

/* =========================================
   HEADER
========================================= */
.module-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.module-title {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* =========================================
   ICON
========================================= */
.module-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 15px;
  color: white;
  font-size: 21px;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--module-color) 95%, white),
    var(--module-color)
  );
  box-shadow: 0 8px 25px color-mix(in srgb, var(--module-color) 25%, transparent);
  transition: transform .3s ease, box-shadow .3s ease;
}

@keyframes moduleGlow {
  0%, 100% {
    box-shadow: 0 0 15px color-mix(in srgb, var(--module-color) 30%, transparent);
  }
  50% {
    box-shadow: 0 0 28px color-mix(in srgb, var(--module-color) 50%, transparent);
  }
}

.module-card:hover .module-icon {
  transform: scale(1.05);
  animation: moduleGlow 2s ease-in-out infinite;
  box-shadow: 
    0 0 20px color-mix(in srgb, var(--module-color) 40%, transparent),
    0 8px 25px color-mix(in srgb, var(--module-color) 30%, transparent);
}

/* =========================================
   TEXT
========================================= */
.module-card a:hover {
  text-decoration: none;
  color: var(--color-secondary-light-max);
}

.module-title h2 {
  margin: 0 0 3px;
  color: #f4f6fa;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.3px;
}

.module-title p {
  margin: 0;
  color: rgba(255, 255, 255, .55);
  font-size: 13px;
}

/* =========================================
   ARROW
========================================= */
.module-arrow {
  color: rgba(255, 255, 255, .65);
  font-size: 15px;
  transition: transform .25s ease, color .25s ease;
}

.module-card:hover .module-arrow {
  color: white;
  transform: translateX(4px);
}

/* =========================================
   OPTIONS
========================================= */
.module-options {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.module-option {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  gap: 11px;
  border-radius: 10px;
  color: rgba(255, 255, 255, .78);
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .025);
  text-decoration: none;
  font-size: 13px;
  transition: background .2s ease, color .2s ease, transform .2s ease, border-color .2s ease;
}

.module-option i {
  width: 16px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, .65);
  font-size: 12px;
  text-align: center;
  transition: color .2s ease;
}

.module-option:hover {
  color: white;
  background: color-mix(in srgb, var(--module-color) 14%, rgba(255, 255, 255, .055));
  border-color: color-mix(in srgb, var(--module-color) 20%, transparent);
  transform: translateX(3px);
}

.module-option:hover i {
  color: var(--module-color);
}

/* =========================================
   TWO COLUMN OPTIONS
========================================= */
.module-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.module-option-full {
  grid-column: span 2;
}

/* =========================================
   RESPONSIVE MODULE GRID
========================================= */
@media (max-width: 1100px) {
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .module-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .module-card {
    min-height: auto;
    padding: 20px;
  }
}

@media (max-width: 450px) {
  .module-options-grid {
    grid-template-columns: 1fr;
  }
  .module-option-full {
    grid-column: span 1;
  }
}

/* =========================================
   ELEMENTOS DE INTERFAZ GENERAL
========================================= */
.code-input {
  font-size: 1.5rem;
  letter-spacing: 5px;
  text-align: center;
}

.name-input {
  font-size: 1.5rem;
}

.image-gestor {
  max-width: 100%;
  max-height: 500px;
}

.image-gestor-thumbnail {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.title-item {
  height: 60px;
  display: inline;
  line-height: 20px;
  padding-top: 8px;
}

.title-item-drag {
  color: #cccccc;
  height: 60px;
  width: 30px;
  padding: 10px;
  cursor: pointer;
}

.dragging {
  opacity: 0.4;
  background-color: #f0f4f8;
  border: 2px dashed #007bff;
}

.drag-handle {
  cursor: grab;
  user-select: none;
}

.container {
  margin: 0 auto;
  padding: 0;
  position: relative;
  z-index: 100;
  width: 100%;
}

.container .content {
  background: #fafbfb;
  display: flex;
  width: 100%;
}

/* =========================================
   SIDEBAR & LAYOUT
========================================= */
.sidebar {
  position: fixed;
  visibility: hidden;
  display: flex;
  top: 0;
  left: 0;
  z-index: 100;
  height: 100dvh;
}

.sidebar-div {
  background: var(--color-secondary-dark);
  position: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  width: 120px;
  height: 100%;
  border-right: 0.5px solid var(--color-secondary-light);
}

.sidebar-div-out {
  opacity: 1;
  width: calc(100dvh - 120px);
  height: 100%;
}

.sidebar-closed {
  display: flex;
  visibility: visible;
  z-index: 101;
  flex-wrap: wrap;
  align-content: center;
  height: 100dvh;
  position: fixed;
}

.open-sidebar {
  color: #fff;
  background-color: var(--color-main-dark);
  height: 60px;
  display: flex;
  z-index: 101;
  flex-wrap: wrap;
  align-content: center;
  border-radius: 0 5px 5px 0;
  padding: 10px 5px;
}

.main-content {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background: var(--color-secondary-dark);
  margin-left: 0;
}

@media all and (min-width: 576px) {
  .main-content {
    width: calc(100% - 120px);
    margin-left: 120px;
  }
  .sidebar {
    visibility: visible;
  }
  .sidebar-closed,
  .sidebar-div-out {
    display: none;
    visibility: hidden;
  }
  .image-gestor-thumbnail {
    aspect-ratio: 1 / 1;
  }
}

.logo-gestor {
  margin: 15px 20px;
  width: 50px;
}

.sidebar .logo-gestor .icon {
  font-size: 3em;
  color: #ffffff;
}

.sidebar nav {
  position: relative;
}

.sidebar nav .menu-options {
  font-size: 1.25em;
  list-style: none;
  width: 100%;
  padding: 0 10px;
  text-align: left;
}

.sidebar nav .menu-options li {
  background: var(--color-secondary-dark);
  color: #ffffff;
  border-radius: 5px;
  box-sizing: border-box;
  margin: 20px 0;
  display: flex;
  align-items: center;
  width: 100px;
}

.sidebar nav .menu-options li span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.sidebar nav .menu-options li.menu-parent {
  background: none;
}

.sidebar nav .menu-options li.selected, 
.sidebar nav .menu-options li:hover {
  background: #ffffff;
  color: var(--color-secondary-dark);
  cursor: pointer;
}

.sidebar nav .menu-options .icon {
  font-size: inherit;
}

.sidebar .more-options {
  position: absolute;
  bottom: 16px;
  color: #ffffff;
  cursor: pointer;
}

.sidebar span {
  font-size: 0.7rem;
  margin-left: 5px;
}

/* =========================================
   APP MAIN CONTENT & SUBMENU
========================================= */
.main-content .app {
  display: flex;
  flex-direction: column;
}

.main-content .app header.sub-menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-secondary-dark);
  height: 70px;
  padding-left: 40px;
  color: #fff;
  border-bottom: 0.5px solid;
  border-image: linear-gradient(to right, rgba(255, 255, 255, 0), var(--color-secondary-light), rgba(255, 255, 255, 0)) 1;
}

.main-content .app header.sub-menu .menu-categorias-gestor {
  display: flex;
  flex-wrap: nowrap;
  list-style: none;
  height: 100%;
  overflow-x: auto;
  align-items: center;
}

.main-content .app header.sub-menu .menu-categorias-gestor li {
  margin: 0 10px;
  text-transform: uppercase;
  font-weight: bold;
  font-size: 0.75em;
  color: #6d7684;
  display: flex;
  align-items: center;
  text-align: center;
  padding: 5px 15px;
  border-radius: 20px;
  white-space: nowrap;
}

.main-content .app header.sub-menu .menu-categorias-gestor li.selected, 
.main-content .app header.sub-menu .menu-categorias-gestor li:hover {
  color: #fff;
  background-color: var(--color-main-dark);
  position: relative;
  cursor: pointer;
}

.main-content .app header.sub-menu .menu-categorias-gestor li.selected .badge, 
.main-content .app header.sub-menu .menu-categorias-gestor li:hover .badge {
  background: #0068ff;
  color: #fafbfb;
}

.main-content .app header.sub-menu .menu-categorias-gestor li .badge {
  border-radius: 8px;
  padding: 4px 5px;
  margin: 0 5px;
  background: #bbc3c9;
  color: #969da8;
  font-size: 12px;
  height: 12px;
  width: 15px;
}

.main-content .app .app-content {
  margin: 20px;
  padding: 20px;
  background: #fafbfb;
  border-radius: 5px;
}

.main-content .app .app-table {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.main-content .app .app-content header {
  margin: 20px;
  display: flex;
  justify-content: space-between;
  flex-direction: row-reverse;
}

.main-content .app .app-content header .searchbox {
  display: flex;
  padding: 10px;
  background: #eeeff1;
  border-radius: 5px;
  width: 200px;
}

.main-content .app .app-content header .searchbox .icon {
  color: #9199a5;
  margin: 0 5px;
}

.main-content .app .app-content header .searchbox input.search-text {
  border: none;
  background: inherit;
  font-size: 0.75em;
  font-weight: 600;
  outline: none;
}

/* =========================================
   INPUTS & FORM ELEMENTS
========================================= */
input[type="email"] {
  font-size: 1.2rem;
}

/* Custom file upload button */
input[type="file"] {
  position: relative;
}

input[type="file"]::file-selector-button {
  width: 136px;
  color: transparent;
  border-radius: 4px;
  padding: 0 16px;
  height: 40px;
  cursor: pointer;
  background-color: white;
  border: 1px solid rgba(0, 0, 0, 0.16);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
  margin: 16px 16px 16px 0;
  transition: background-color 200ms;
}

input[type="file"]::before {
  position: absolute;
  pointer-events: none;
  top: 10px;
  left: 16px;
  height: 20px;
  width: 20px;
  content: "";
  margin: 16px 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230964B0'%3E%3Cpath d='M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zM7 9l1.41 1.41L11 7.83V16h2V7.83l2.59 2.58L17 9l-5-5-5 5z'/%3E%3C/svg%3E");
}

input[type="file"]::after {
  position: absolute;
  pointer-events: none;
  top: 11px;
  left: 40px;
  color: #0964b0;
  content: "Upload File";
  margin: 16px 0;
}

input[type="file"]::file-selector-button:hover {
  background-color: #f3f4f6;
}

input[type="file"]::file-selector-button:active {
  background-color: #e5e7eb;
}

.col-row { 
  display: flex; 
  gap: 10px; 
  margin-bottom: 5px; 
}

.otp-container {
  display: flex;
  gap: 10px;
  justify-content: center;
}

input.otp-input {
  width: 45px;
  height: 55px;
  font-size: 24px;
  text-align: center;
  font-weight: bold;
  border: 2px solid #ccc;
  border-radius: 8px;
  padding: 0;
  outline: none;
  transition: border-color 0.2s ease-in-out;
}

.otp-input:focus {
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.otp-input::-webkit-outer-spin-button,
.otp-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.button-tag {
  display: inline-flex;
  margin: 5px;
  align-items: center;
  width: fit-content;
  border-radius: 35px;
  background-color: #eee;
  color: #333;
  cursor: pointer;
}

.button-tag.checked,
.check-tag:checked + .button-tag {
  background-color: var(--color-main);
  color: #fff;
}

.button-tag input[type=checkbox] {
  margin: 8px;
}

.color-drop {
  height: 20px;
  width: 20px;
  margin: 0 8px;
  border-radius: 50%;
}

.app-content header .app-list-options {
  display: flex;
  justify-items: center;
  align-items: center;
}

.app-content header .app-list-options .sort-dropdown {
  display: flex;
  border: 1px solid #bbc3c9;
  border-radius: 5px;
  padding: 12px;
  color: #bbc3c9;
  font-size: 0.75em;
  font-weight: 600;
}

.app-content header .app-list-options .sort-dropdown .by,
.app-content header .app-list-options .sort-dropdown i {
  color: #1e2026;
  margin-left: 5px;
}

.app-content header .app-list-options .sort-dropdown .drop {
  border-left: 1px solid #bbc3c9;
  margin-left: 10px;
}

.app-content header .app-list-options .icon {
  margin: 0 10px;
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 1px 1px 1px rgba(181, 181, 181, 0.38);
  position: relative;
  color: #bbc3c9;
}

.app-content header .app-list-options .icon:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.app-content header .app-list-options .icon:last-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.app-content header .app-list-options .icon.selected {
  background: #dbdee2;
  color: #88909c;
}

.app-content header .app-list-options .display-group {
  display: flex;
}

.app-content header .app-list-options .display-group .icon {
  margin-right: 0;
  margin-left: 0;
}

.background-none {
  background: none !important;
}

.item-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.item-list .container-item {
  padding: 0;
  margin: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  text-align: left;
  border-radius: 5px;
  box-shadow: 0 2px 2px 2px rgba(181, 181, 181, 0.38);
  user-select: none;
  overflow: hidden;
  flex: 250px;
}

.item-list .container-item .logo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-list .container-item .logo-row img {
  display: block;
}

.item-list .container-item .logo-row .icon {
  color: #bbc3c9;
}

.new-item-icon {
  position: fixed;
  z-index: 1000;
  bottom: 30px;
  right: 30px;
  color: var(--color-main-light-max);
  background: var(--color-main);
  border-radius: 50%;
  text-align: center;
  padding-top: 15px;
  font-size: 2em;
  box-sizing: border-box;
  box-shadow: 10px 10px 73px 12px rgba(0, 104, 255, 0.35);
  width: 60px;
  height: 60px;
  cursor: pointer;
}

@media all and (min-width: 576px) {
  .new-item-icon {
    bottom: 50px;
    right: 50px;
  }
}

/* =========================================
   FORMULARIO Y SWITCHES
========================================= */
.form-group { 
  margin-bottom: 15px; 
  display: flex; 
  flex-direction: column; 
  position: relative;
}

.form-group label { 
  font-weight: bold; 
  margin-bottom: 5px; 
}

.form-group input, 
.form-group select { 
  padding: 8px; 
  border: 1px solid #ccc; 
  border-radius: 4px; 
}

.form-group input[readonly], 
.form-group input:disabled { 
  background: #e9ecef; 
}

img.preview { 
  max-width: 200px; 
  margin-top: 10px; 
  border-radius: 5px; 
}

.plain-text-value { 
  padding: 8px 12px; 
  background: #f8f9fa; 
  border: 1px solid #e9ecef; 
  border-radius: 4px; 
  color: #495057; 
  font-weight: 500; 
}

.switch { 
  position: relative; 
  display: inline-block; 
  width: 50px; 
  height: 26px; 
}

.switch input { 
  opacity: 0; 
  width: 0; 
  height: 0; 
}

.slider { 
  position: absolute; 
  cursor: pointer; 
  top: 0; left: 0; right: 0; bottom: 0; 
  background-color: #ccc; 
  transition: .3s; 
  border-radius: 26px; 
}

.slider:before { 
  position: absolute; 
  content: ""; 
  height: 20px; 
  width: 20px; 
  left: 3px; 
  bottom: 3px; 
  background-color: white; 
  transition: .3s; 
  border-radius: 50%; 
}

input:checked + .slider { 
  background-color: #28a745; 
}

input:checked + .slider:before { 
  transform: translateX(24px); 
}

input:disabled + .slider { 
  opacity: 0.5; 
  cursor: not-allowed; 
}

.upload-card { 
  border: 2px dashed #ccc; 
  padding: 30px; 
  text-align: center; 
  border-radius: 8px; 
  background: #fafafa; 
}

.btn {
  padding: 10px 15px;
  border: 1px solid var(--border-color, #ccc);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  min-width: 100px;
  margin-top: 15px; 
  margin-left: 10px;
}

.btn:hover:not(:disabled) {
  border-color: var(--primary, #007bff);
  color: var(--primary, #007bff);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-warning { background: #d16f66; color: black; }
.btn-success { background: #28a745; color: white; }
.btn-primary { background: #00a146; color: white; }
.btn-secondary { background: #6c757d; color: white; }
.btn-secondary:hover { background: #5a6268; }

.hidden { display: none !important; }
.error-message { color: red; font-weight: bold; }

.card { 
  background: white; 
  border-radius: 8px; 
  padding: 20px; 
  margin-bottom: 20px; 
  box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
}

.card-header { 
  font-size: 1.2em; 
  font-weight: bold; 
  border-bottom: 1px solid #eee; 
  padding-bottom: 10px; 
  margin-bottom: 15px; 
}

/* =========================================
   ROLES Y MODALES
========================================= */
.layout-grid { 
  display: grid; 
  grid-template-columns: 250px 1fr 250px; 
  gap: 20px; 
  max-width: 1400px; 
  margin: auto; 
}

.panel { 
  background: #fff; 
  padding: 15px; 
  border-radius: 8px; 
  box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
  height: 85vh; 
  overflow-y: auto; 
}

.role-item { 
  padding: 10px; 
  margin-bottom: 5px; 
  border-radius: 5px; 
  cursor: pointer; 
  transition: 0.2s; 
  border: 1px solid #eee; 
}

.role-item:hover { background: #f0f4f8; }

.role-item.active { 
  background: #e3f2fd; 
  border-color: #2196f3; 
  font-weight: bold; 
  color: #0d47a1; 
}

.btn-global-view { 
  width: 100%; 
  padding: 10px; 
  margin-bottom: 15px; 
  background: #37474f; 
  color: white; 
  border: none; 
  border-radius: 5px; 
  cursor: pointer; 
  text-align: center; 
}

.role-card-summary { 
  background: #fafafa; 
  border: 1px solid #e0e0e0; 
  border-radius: 6px; 
  padding: 12px; 
  margin-bottom: 15px; 
  cursor: pointer; 
  transition: 0.2s; 
}

.role-card-summary:hover { 
  border-color: #2196f3; 
  box-shadow: 0 2px 8px rgba(33,150,243,0.15); 
}

.role-card-title { 
  font-weight: bold; 
  font-size: 1.1em; 
  color: #1565c0; 
  margin-bottom: 8px; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
}

.parent-group { margin-bottom: 8px; font-size: 0.9em; }

.summary-tag { 
  display: inline-block; 
  background: #e0f2f1; 
  color: #00695c; 
  padding: 3px 8px; 
  border-radius: 12px; 
  font-size: 0.82em; 
  margin: 2px; 
  border: 1px solid #b2dfdb; 
}

.perm-table { width: 100%; border-collapse: collapse; margin-top: 15px; }

.perm-table th, 
.perm-table td { 
  padding: 8px; 
  text-align: center; 
  border-bottom: 1px solid #eee; 
}

.perm-table td:first-child { text-align: left; }

.row-parent { background: #f5f5f5; font-weight: bold; }

.row-child td:first-child { padding-left: 30px; border-left: 3px solid #2196f3; }

.btn-save { 
  background: #4caf50; 
  color: white; 
  padding: 10px 20px; 
  border: none; 
  border-radius: 5px; 
  cursor: pointer; 
  margin-top: 15px; 
  width: 100%; 
  font-size: 1em; 
}

.user-count-link { color: #2196f3; text-decoration: underline; cursor: pointer; }

.modal-overlay { 
  display: none; 
  position: fixed; 
  top: 0; left: 0; 
  width: 100%; height: 100%; 
  background: rgba(0,0,0,0.5); 
  z-index: 1000; 
  align-items: center; 
  justify-content: center; 
}

.modal-close { position: absolute; top: 10px; right: 15px; font-size: 20px; cursor: pointer; }

.user-list-item { padding: 8px; border-bottom: 1px solid #eee; }

/* Overlay oscuro que cubre toda la pantalla */
#modal-add-new.gestor-modal-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.65) !important;
    z-index: 99999 !important;
    justify-content: center;
    align-items: flex-start;
    padding: 50px 15px 20px 15px;
    box-sizing: border-box;
    overflow-y: auto;
}

/* Caja de contenido interior del Modal */
#modal-add-new .gestor-modal-content {
    background: #ffffff;
    width: 100% !important;
    max-width: 650px !important; /* Controla el ancho del modal */
    min-width: 300px;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    box-sizing: border-box;
    margin: 0 auto;
}

/* Botón de cerrar (X) */
#modal-add-new .close-modal {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 1.6rem;
    font-weight: bold;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

#modal-add-new .close-modal:hover {
    color: #000;
}

/* Desplegable de marcas para que no se corte dentro del modal */
#results_modal_brand {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 0 0 6px 6px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 100000;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.perm-table thead th {
  position: sticky;
  top: -15px;
  background: #ffffff;
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  padding-top: 12px;
  padding-bottom: 12px;
}

.sticky-footer {
  position: sticky;
  bottom: -15px;
  background: #ffffff;
  padding: 12px 0;
  margin-top: 15px;
  border-top: 1px solid #eee;
  z-index: 10;
  box-shadow: 0 -3px 6px rgba(0, 0, 0, 0.05);
}

/* Autocomplete e Buscador */
.autocomplete-results {
  position: absolute;
  top: calc(100% - 8px); 
  left: 16px;
  width: calc(100% - 32px);
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
  z-index: 1000;
  max-height: 250px;
  overflow-y: auto;
}

.autocomplete-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
  font-size: 0.95rem;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: var(--color-background-gray, #f0f0f0);
}

.add-new-action {
  color: var(--color-main-dark);
  font-weight: 700;
  background: var(--color-secondary-light);
  justify-content: center;
}

.add-new-action:hover {
  background: var(--color-secondary);
  color: #fff;
}

/* =========================================
   SCHEDULE / GANTT
========================================= */
.gantt-section,
.gantt-container {
  width: 100%;
  overflow-x: visible;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.gantt-header-hours {
  display: grid;
  gap: 2px;
  background: var(--color-main-dark);
  color: #fff;
  text-align: center;
  border-radius: 8px 8px 0 0;
  font-weight: 500;
  padding: 10px 0;
  font-size: 0.85rem;
}

.gantt-header-hours div {
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.gantt-row {
  display: grid;
  gap: 2px;
  border-bottom: 1px solid #f0f0f0;
  align-items: center;
  min-height: 50px;
  transition: background 0.2s;
  position: relative;
}

.gantt-row:hover {
  background: #fafbfb;
  z-index: 100;
}

.gantt-label { 
  font-size: 13px; 
  padding-right: 10px; 
  border-right: 1px solid #ddd; 
}

.gantt-customer { 
  background: var(--color-background-gray, #f0f0f0);
  font-weight: bold; 
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  color: #333; 
}

.gantt-location { 
  padding-left: 15px; 
  color: #666; 
  font-size: 12px; 
}

.gantt-event {
  position: relative;
  background-color: var(--color-main, #007bff);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  min-height: 26px;
  margin: 6px 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.gantt-event:hover {
  z-index: 9999;
}

.gantt-real-time {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  z-index: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.gantt-event-title {
  position: relative;
  z-index: 2;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  padding-left: 4px;
}

.gantt-tooltip {
  visibility: hidden;
  background-color: #2c3e50;
  color: #fff;
  text-align: left;
  border-radius: 6px 6px 0 0;
  padding: 12px;
  position: absolute;
  z-index: 10000;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  min-width: 220px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  white-space: normal;
  pointer-events: auto;
}

.gantt-event:hover .gantt-tooltip {
  visibility: visible;
  opacity: 1;
}