/* ===================== VARIABLES ===================== */
:root {
  --primary-bg: #000000;
  --secondary-bg: #292929;
  --gradient-red: #F10909;
  --gradient-pink: #FF2D55;
  --text-light: #FFFFFF;
  --gray-dark: #141414;
}

/* ===================== RESET & BASE ===================== */
body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background-color: var(--primary-bg);
  color: var(--text-light);
}

input, select, textarea, .btn {
  font-size: 1rem;
  padding: 10px;
  transition: all 0.2s ease-in-out;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gradient-pink);
  box-shadow: 0 0 5px var(--gradient-pink);
}

input::placeholder,
textarea::placeholder,
select::placeholder {
  color: #cccccc !important;
  opacity: 1;
}

/* ===================== LAYOUT ===================== */
.app-container {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--primary-bg);
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
  background: rgba(20, 20, 20, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  border-radius: 0 0 12px 12px;
  padding: 0 1.5rem;
  z-index: 100;
  text-align: center;
}

/* Logo centrado */
.logo {
  pointer-events: none;
}

.logo img {
  height: 40px;
  filter: drop-shadow(0 0 5px rgba(255, 45, 85, 0.4));
}

/* Elementos laterales posicionados */
.topbar-left,
.topbar-right {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 1rem;
}

/* Izquierda vacía por ahora (puedes poner un icono después si quieres) */
.topbar-left {
  left: 0;
}

.topbar-right {
  right: 0;
}

.welcome {
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-light);
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.05);
}

/* ✅ FIX para móvil */
@media (max-width: 576px) {
  .topbar {
    flex-direction: column;
    height: auto;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
  }

  .topbar-left,
  .topbar-right {
    position: static;
    width: 100%;
    justify-content: center;
  }

  .topbar-right {
    flex-direction: row;
    gap: 1rem;
    justify-content: center;
    margin-top: 0.25rem;
  }

  .logo img {
    height: 50px;
  }

  .welcome {
    font-size: 0.9rem;
  }
}


.topbar .btn {
  color: var(--gradient-pink);
  transition: transform 0.2s ease;
}

.topbar .btn:hover {
  transform: scale(1.1);
  color: var(--text-light);
}


.content-body {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 1.5rem;
  padding-bottom: 80px; /* Para dejar espacio al footer */
}

.left-panel {
  width: 100%;
}

/* ===================== CARDS & COMPONENTES ===================== */
.glass-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 1.5rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  margin-bottom: 4rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.detalle-card {
  background-color: #1e1e1e;
  border-radius: 12px;
  padding: 15px 20px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  border-left: 4px solid var(--gradient-red);
  transition: all 0.2s ease;
}

.detalle-card:hover {
  background-color: #2a2a2a;
  transform: translateY(-2px);
}

/* ===================== BOTONES ===================== */
.btn-custom {
  background: linear-gradient(90deg, var(--gradient-red), var(--gradient-pink));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(255, 0, 85, 0.4);
  opacity: 0.95;
}

.btn-outline-light {
  border-color: var(--gradient-pink);
  color: var(--text-light);
}

.btn-outline-light:hover {
  background: var(--gradient-pink);
  color: #000;
}

/* ===================== TABLAS ===================== */
.table-dark {
  background-color: #1a1a1a;
  color: #eaeaea;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

.table-dark thead th {
  background-color: #292929;
  color: var(--text-light);
  border-bottom: 2px solid #444;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.table-dark tbody tr {
  transition: background 0.2s ease;
}

.table-dark tbody tr:hover {
  background-color: #2a2a2a;
}

/* ===================== TABLA PERSONALIZADA (TONOS OSCUROS + ROJO/ROSA) ===================== */

.table-wrapper {
  background: rgba(26, 26, 26, 0.7); /* #1a1a1a con transparencia */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.table-custom {
  --bs-table-bg: transparent;
  color: var(--text-light);
}

.table-custom thead th {
  background: rgba(41, 41, 41, 0.8);
  color: #fff !important; /* ⬅️ Asegurado */
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.table-custom tbody tr {
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table-custom tbody tr:last-child {
  border-bottom: none;
}

.table-custom tbody td {
  padding: 14px 15px;
  vertical-align: middle;
  border: none;
  color: var(--text-light) !important; 
}

/* Hover en filas */
.table-custom tbody tr:hover {
  background: rgba(45, 45, 45, 0.6); /* más oscuro que el fondo */
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(255, 45, 85, 0.15);
}

/* Badges de estado con tus colores */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(241, 9, 9, 0.15); /* var(--gradient-red) con opacidad */
  color: #ff4d4d;
  border: 1px solid rgba(241, 9, 9, 0.3);
}

/* Colores específicos por estado (usando tu paleta) */
.status-levantamiento { background: rgba(255, 193, 7, 0.15); color: #ffc107; border-color: rgba(255, 193, 7, 0.3); }
.status-cotización,
.status-en-proceso { background: rgba(23, 162, 184, 0.15); color: #17a2b8; border-color: rgba(23, 162, 184, 0.3); }
.status-aprobación,
.status-programada { background: rgba(0, 123, 255, 0.15); color: #007bff; border-color: rgba(0, 123, 255, 0.3); }
.status-ejecutada { background: rgba(40, 167, 69, 0.15); color: #28a745; border-color: rgba(40, 167, 69, 0.3); }
.status-cancelada { background: rgba(220, 53, 69, 0.15); color: #dc3545; border-color: rgba(220, 53, 69, 0.3); }

/* Botón de ver detalles (en tus colores) */
.btn-view {
  background: rgba(255, 45, 85, 0.15); /* var(--gradient-pink) con opacidad */
  border: 1px solid rgba(255, 45, 85, 0.3);
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  transition: all 0.2s ease;
}

.btn-view:hover {
  background: rgba(241, 9, 9, 0.25); /* var(--gradient-red) */
  border-color: var(--gradient-red);
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(241, 9, 9, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .table-custom thead th,
  .table-custom tbody td {
    padding: 10px 8px;
    font-size: 0.85rem;
  }

  .status-badge {
    padding: 3px 10px;
    font-size: 0.75rem;
  }

  .btn-view {
    padding: 5px 10px;
  }
}

/* ===================== FOOTER / NAV INFERIOR ===================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(20, 20, 20, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.3);
  padding: 0.5rem 0;
  z-index: 1000;
  border-radius: 12px 12px 0 0;
}


.btn-nav {
  background: none;
  border: none;
  color: #bbb;
  font-size: 0.9rem;
  text-align: center;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: color 0.2s;
}

.btn-nav i {
  font-size: 1.3rem;
}

.btn-nav.active {
  background: none;
  color: #fff;
  position: relative;
  font-weight: bold;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-image: linear-gradient(90deg, var(--gradient-red), var(--gradient-pink));
}

.btn-nav.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, var(--gradient-red), var(--gradient-pink));
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
}

.btn-nav span {
  font-size: 0.75rem;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 992px) {
  .content-body {
    padding: 1rem;
  }

  .topbar {
    flex-direction: column;
    height: auto;
    gap: 0.5rem;
  }

  .sidebar {
    flex-direction: row;
    width: 100%;
    overflow-x: auto;
    padding: 0.5rem 1rem;
  }

  .sidebar a {
    flex: 1 0 auto;
    justify-content: center;
    padding: 0.75rem 1rem;
  }

  .sidebar a span {
    display: none;
  }
}

@media (max-width: 576px) {
  .btn-custom {
    width: 100%;
    padding: 12px 0;
  }

  .detalle-card label {
    font-size: 0.9rem;
  }

  .modal-body {
    padding: 1rem;
  }
}

/* ===================== MODAL ===================== */
.modal-content {
  border-radius: 16px;
  overflow: hidden;
  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-light);
}

.modal-header,
.modal-body,
.modal-footer {
  padding: 1.5rem;
}


.btn-outline-light,
.btn-outline-danger {
  border: none !important;
  background: transparent;
}

.btn-outline-light:hover,
.btn-outline-danger:hover {
  background-color: rgba(255, 255, 255, 0.1); /* opcional: efecto al pasar el mouse */
}

.tab-btn {
  background-color: #1e1e1e;
  color: var(--text-light);
  font-weight: 500;
  padding: 10px 20px;
  transition: all 0.2s ease-in-out;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin-right: 0.5rem;
}

.tab-btn.active {
  border-left: 4px solid var(--gradient-red);
  font-weight: bold;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}



/* ===================== COLUMNA DE FECHA DE EJECUCIÓN ===================== */

.table-custom tbody td .bi-calendar-event {
  color: var(--gradient-pink);
  transition: transform 0.2s ease;
}

.table-custom tbody td .bi-calendar-event:hover {
  transform: scale(1.1);
  color: var(--gradient-red);
}

/* Estilos para fechas especiales */
.fecha-hoy {
  background: rgba(40, 167, 69, 0.2);
  border-left: 3px solid #28a745;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.fecha-mañana {
  background: rgba(255, 193, 7, 0.2);
  border-left: 3px solid #ffc107;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.fecha-futura {
  background: rgba(0, 123, 255, 0.1);
  border-left: 3px solid #007bff;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.fecha-pasada {
  background: rgba(220, 53, 69, 0.2);
  border-left: 3px solid #dc3545;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
  opacity: 0.8;
}

/* ===================== ICONO DEL CALENDARIO SEGÚN CLASE DE FECHA ===================== */

.fecha-hoy .bi-calendar-event {
  color: #28a745 !important;
}

.fecha-mañana .bi-calendar-event {
  color: #ffc107 !important;
}

.fecha-futura .bi-calendar-event {
  color: #007bff !important;
}

.fecha-pasada .bi-calendar-event {
  color: #dc3545 !important;
}

/* Hover en el ícono */
.table-custom tbody td .bi-calendar-event:hover {
  transform: scale(1.1);
}

/* ===================== NAVBAR MEJORADO ===================== */

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  border-radius: 0 0 16px 16px;
  padding: 0 1.5rem;
  z-index: 1000;
}

/* Logo */
.logo img {
  height: 45px;
  filter: drop-shadow(0 0 8px rgba(255, 45, 85, 0.5));
  transition: transform 0.2s ease;
}

.logo img:hover {
  transform: scale(1.05);
}

/* Bienvenida */
.welcome {
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-light);
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.05);
}

.welcome .text-gradient {
  background: linear-gradient(90deg, var(--gradient-red), var(--gradient-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Botón de logout */
.btn-logout {
  background: rgba(241, 9, 9, 0.2);
  border: 1px solid rgba(241, 9, 9, 0.3);
  color: #ff4d4d;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: rgba(241, 9, 9, 0.3);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(241, 9, 9, 0.4);
}

.btn-logout i {
  font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 576px) {
  .topbar {
    height: auto;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
    border-radius: 0 0 12px 12px;
  }

  .logo img {
    height: 50px;
  }

  .welcome {
    font-size: 0.9rem;
    text-align: center;
  }

  .topbar-left,
  .topbar-right {
    width: 100%;
    justify-content: center;
  }

  .btn-logout {
    width: 36px;
    height: 36px;
  }
}
/* ===================== TÍTULO DE EDICIÓN MEJORADO ===================== */

.glass-card h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.glass-card h4 .text-muted {
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 1.2rem;
}


/* Solo para la card principal del edit */
.main-edit-card {
    margin-bottom: 4rem; /* espacio grande para el footer */
}

/* Para los resúmenes de costos */
.glass-card.resumen-costos {
  margin-top: 0.4rem;
    margin-bottom: 1rem; /* más ajustado */
}

@media (max-width: 576px) {
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 700px;
  }
}

.action-links {
    font-size: 0.9rem;
}

.action-link {
    background: none;
    border: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    opacity: 0.85;
    transition: all 0.15s ease;
}

.action-link i {
    font-size: 1.1rem;
}

.action-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.action-link:focus {
    outline: none;
}



/* ================= COTIZACIONES ================= */
.quote-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* Estados de cotización */
.quote-pendiente {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.35);
}

.quote-aceptada {
  background: rgba(40, 167, 69, 0.15);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.35);
}

.quote-rechazada {
  background: rgba(220, 53, 69, 0.15);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.35);
}


/* ================= FACTURAS / PAGOS ================= */

.invoice-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* Estados de factura */
.invoice-pendiente {
  background: rgba(220, 53, 69, 0.15);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.35);
}

.invoice-parcial {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.35);
}

.invoice-pagado {
  background: rgba(40, 167, 69, 0.15);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.35);
}
