/* Layout general */
.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Contenido principal crece */
.content {
  flex: 1;
  margin-left: 240px;
  padding: 20px;
}

/* Footer */
.footer {
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  margin-left: 240px;
}

/* fin layout */

/*login*/
body {
  margin: 0;
  height: 100vh;
  background:
    linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
    url("https://images.unsplash.com/photo-1581093588401-22d54a1f0c9b");
  background-size: cover;
  background-position: center;
  font-family: "Segoe UI", sans-serif;
}

.login-container {
  height: 100vh;
}

.login-card {
  border: none;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

.login-card h3 {
  font-weight: 600;
}

.form-control {
  border-radius: 8px;
}

.btn-primary {
  border-radius: 8px;
  padding: 10px;
  font-weight: 500;
  background: #e75480;
  border-color: #e75480;
  border-radius: 10px;
}

.btn-primary:hover {
  background: #d81b60;
  border-color: #d81b60;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: #0d6efd;
}
/*fin login*/

/* Sidebar */
body {
  overflow-x: hidden;
}

.sidebar {
  width: 250px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: #fce4ec;
  color: #4b4453;
  transition: all 0.3s;
  z-index: 1000; /* 🔥 importante */
}

.sidebar a {
  color: #6d4c57;
  text-decoration: none;
  padding: 12px 20px;
  display: block;
  transition: 0.2s;
}

.sidebar a:hover {
  background: #f8bbd0;
  color: #4a2c36;
}

.sidebar .active {
  background: #e75480;
  color: white;
  border-radius: 10px;
}

.sidebar-header {
  padding: 20px;
  font-size: 1.3rem;
  font-weight: bold;
  text-align: center;
  border-bottom: 1px solid #f4c2d7;
  color: #ad1457;
}

.sidebar i {
  color: #d81b60;
}

/* Mobile */
@media (max-width: 768px) {
  .sidebar {
    left: -250px;
  }

  .sidebar.active {
    left: 0;
  }

  .content {
    margin-left: 0;
  }
}

/* fin sidebar */

/* Dashboard */
body {
  background: #fff5f8;
  font-size: 0.9rem; /* 👈 tamaño contenido */
}

.card {
  border: 1px solid #f3d6df;
  border-radius: 18px;
  box-shadow: 0 8px 25px rgba(231, 84, 128, 0.08);
}

.card h6 {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 5px;
}

.card h4 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}

.icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
}

.bg-blue {
  background: #2563eb;
}
.bg-green {
  background: #16a34a;
}
.bg-orange {
  background: #f59e0b;
}
.bg-red {
  background: #dc2626;
}

.table {
  font-size: 0.85rem;
}
/* fin dashboard */

/* Footer */
.footer {
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  margin-left: 240px; /* 👈 igual que sidebar */
}

@media (max-width: 768px) {
  .footer {
    margin-left: 0;
  }
}
/* fin footer */

.container-fluid {
  max-width: 100%;
  overflow-x: hidden;
}

html,
body {
  overflow-x: hidden;
}

.row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.card {
  border-radius: 12px;
}

.card-header {
  font-weight: 600;
}

/* =========================================
   📱 TABLAS MOBILE MODERNAS
========================================= */

@media (max-width: 768px) {
  .table-responsive {
    overflow: visible;
  }

  .table thead {
    display: none;
  }

  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }

  /* CARD */
  .table tr {
    background: #fff;

    border: 1px solid #f3d6df;

    border-radius: 18px;

    padding: 14px;

    margin-bottom: 16px;

    box-shadow: 0 6px 18px rgba(231, 84, 128, 0.08);
  }

  /* CELDAS */
  .table td {
    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    gap: 12px;

    padding: 10px 0;

    border: none;

    border-bottom: 1px dashed #f5d3df;

    font-size: 0.92rem;
  }

  .table td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  /* LABEL */
  .table td::before {
    content: attr(data-label);

    font-weight: 700;

    color: #ad1457;

    min-width: 90px;

    text-align: left;

    flex-shrink: 0;
  }

  /* VALOR */
  .table td span,
  .table td div {
    text-align: right;

    color: #4b4453;

    word-break: break-word;
  }

  /* TITULO PRODUCTO */
  .table td[data-label="Nombre"] {
    font-size: 1rem;

    font-weight: 700;

    color: #d81b60;
  }

  /* ACCIONES */
  .table td[data-label="Acción"] {
    justify-content: flex-end;

    gap: 8px;

    padding-top: 14px;
  }

  /* BOTONES */
  .table td[data-label="Acción"] .btn {
    min-width: 42px;

    height: 42px;

    border-radius: 12px;

    display: flex;

    align-items: center;

    justify-content: center;
  }
}

/* HEADER TABLAS */
.table-header-mobile {
  margin-bottom: 18px;
}

.table-header-mobile h6 {
  font-size: 0.95rem;

  font-weight: 700;

  color: #4b4453;

  margin: 0;
}

@media (max-width: 768px) {
  .table-header-mobile {
    flex-direction: column;

    align-items: stretch !important;
  }

  .table-header-mobile input {
    width: 100% !important;
  }
}

.header {
  background: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.content {
  margin-left: 250px;
}

.header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

@media (max-width: 768px) {
  .content {
    margin-left: 0;
  }
}

.input-group-text {
  background-color: #f8f9fa;
  border-right: 0;
}

.input-group .form-control {
  border-left: 0;
}

/* 🌟 Card más elegante */
.card {
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* 🧩 Secciones */
.form-section {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #f1f3f5;
}

/* 🏷️ Títulos */
.form-section h6 {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ✨ Input moderno */
.form-control,
.form-select {
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
  height: 44px;
}

/* 🎯 Focus animado */
.form-control:focus,
.form-select:focus {
  border-color: #e75480;
  box-shadow: 0 0 0 3px rgba(231, 84, 128, 0.18);
}

/* 📦 Input group */
.input-group-text {
  border-radius: 10px 0 0 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-right: 0;
}

/* Ajuste input */
.input-group .form-control {
  border-left: 0;
}

/* 🧲 Hover sutil */
.form-control:hover,
.form-select:hover {
  border-color: #c7d2fe;
}

/* 🔘 Botones */
.btn {
  border-radius: 10px;
  padding: 8px 16px;
}

/* 🎬 Animación suave */
.form-control,
.form-select {
  transform: scale(1);
}

.form-control:focus,
.form-select:focus {
  transform: scale(1.02);
}

.is-valid {
  border-color: #198754 !important;
}

.is-invalid {
  border-color: #dc3545 !important;
}

.invalid-feedback {
  font-size: 0.8rem;
}

.container {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 🔥 MODO COMPACTO REAL */
.form-sm .form-control,
.form-sm .form-select {
  padding: 0.2rem 0.4rem !important;
  font-size: 0.8rem !important;
  height: auto !important;
}

.form-sm .form-label {
  font-size: 0.75rem !important;
  margin-bottom: 2px !important;
}

.form-sm .input-group-text {
  padding: 0.2rem 0.4rem !important;
  font-size: 0.75rem !important;
}

.form-sm .btn {
  padding: 0.3rem 0.5rem !important;
  font-size: 0.8rem !important;
}

.form-sm .table td,
.form-sm .table th {
  padding: 0.3rem !important;
  font-size: 0.8rem !important;
}

/* 🔥 MENOS ESPACIO ENTRE CAMPOS */
.form-sm .mb-3 {
  margin-bottom: 0.5rem !important;
}

/* 🔥 TITULOS MÁS COMPACTOS */
.form-sm .form-section h6 {
  font-size: 0.8rem !important;
  margin-bottom: 0.2rem !important;
}

.icon-box {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.3rem;
}

/* colores personalizados */
.bg-cyan {
  background: #06b6d4;
}

#listaNotificaciones {
  border-radius: 16px;
  overflow: hidden;
}

#listaNotificaciones .dropdown-item {
  white-space: normal;
  transition: all 0.2s ease;
}

#listaNotificaciones .dropdown-item:hover {
  background: #f8fafc;
  transform: translateX(2px);
}

#listaNotificaciones .dropdown-header {
  background: #f8fafc;
}

#badgeNotificaciones {
  font-size: 0.65rem;
}

.badge-notificacion {
  animation: pulse 1s infinite;
}

.preview-img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #dee2e6;
  padding: 2px;
  background: #fff;
}

.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 99999;

  display: flex;
  align-items: center;
  justify-content: center;

  backdrop-filter: blur(2px);
}

/* =========================================
   📱 MOBILE FIXES ERP FLORERIA
========================================= */

@media (max-width: 768px) {
  /* Layout principal */
  .content {
    margin-left: 0 !important;
    padding: 12px !important;
    width: 100%;
  }

  /* Header */
  .header {
    margin: 0 !important;
    width: 100%;
    border-radius: 14px;
    padding: 12px 14px;
  }

  /* Cards */
  .card {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 16px;
  }

  /* Card body */
  .card-body {
    padding: 14px;
  }

  /* Filas bootstrap */
  .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Columnas bootstrap */
  .row > * {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Separación vertical cards */
  .card,
  .form-section {
    margin-bottom: 14px;
  }

  /* Contenedor principal */
  .container,
  .container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Form sections */
  .form-section {
    padding: 14px;
    border-radius: 16px;
  }

  /* Tablas mobile */
  .table tr {
    width: 100%;
    margin: 0 0 14px 0;
  }

  /* Footer */
  .footer {
    margin-left: 0 !important;
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Inputs más cómodos mobile */
  .form-control,
  .form-select {
    min-height: 46px;
    font-size: 16px;
  }

  /* Botones */
  .btn {
    min-height: 44px;
  }
}

@media (max-width: 768px) {
  .dashboard-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
  }

  .dashboard-card h4 {
    font-size: 1.4rem;
  }

  .icon-box {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }
}

/* =========================================
   🌸 TOPBAR MOBILE ERP
========================================= */

.topbar-mobile {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 18px;
}

/* BOTON MENU */
.btn-menu-text {
  border: none;
  border-radius: 14px;

  background: #e75480;
  color: white;

  padding: 10px 16px;

  display: flex;
  align-items: center;
  gap: 8px;

  font-weight: 600;

  box-shadow: 0 6px 18px rgba(231, 84, 128, 0.22);
}

.btn-menu-text i {
  font-size: 1.2rem;
}

/* ICONOS DERECHA */
.btn-top-icon {
  width: 42px;
  height: 42px;

  border: none;
  border-radius: 12px;

  background: white;
  color: #e75480;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);

  font-size: 1.1rem;
}

/* TITULO PAGINA */
.page-title {
  margin-bottom: 18px;
}

.page-title h2 {
  font-weight: 700;
  color: #4b4453;
  margin: 0;
}

/* =========================================
   🌸 TOPBAR GENERAL
========================================= */

.topbar-mobile {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 20px;

  background: white;

  padding: 14px 18px;

  border-radius: 18px;

  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);

  border: 1px solid #f1d4de;
}

/* DESKTOP */
@media (min-width: 769px) {
  .topbar-mobile {
    padding: 16px 22px;
  }
}

/* =========================================
   🌸 PAGE HEADER
========================================= */

.page-header {
  margin-bottom: 20px;
}

.page-title {
  font-weight: 700;
  color: #4b4453;
}

/* BOTON NUEVO */
.btn-page-action {
  background: #e75480;
  color: white;

  border: none;
  border-radius: 14px;

  padding: 10px 18px;

  font-weight: 600;

  display: flex;
  align-items: center;
  gap: 8px;

  box-shadow: 0 6px 18px rgba(231, 84, 128, 0.22);

  transition: all 0.2s ease;
}

.btn-page-action:hover {
  background: #d81b60;
  transform: translateY(-1px);

  color: white;
}

/* MOBILE */
@media (max-width: 768px) {
  .page-header .d-flex {
    align-items: center !important;
  }

  .page-title {
    font-size: 1.4rem;
  }

  .btn-page-action {
    width: auto;
    justify-content: center;

    padding: 8px 14px;

    font-size: 0.9rem;
  }
}

.page-header {
  margin-bottom: 22px;
}

.page-title {
  letter-spacing: -0.5px;
}
