body {
  font-family: "Roboto", "Segoe UI", sans-serif;
}

.card-erp {
  border-radius: 1rem;
  box-shadow: 0 0.5rem 1.5rem rgba(31, 45, 61, 0.1);
  border: none;
}

.badge-status {
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 50rem;
}

.hover-shadow:hover {
  transform: translateY(-2px);
  box-shadow: 0 1rem 2rem rgba(31, 45, 61, 0.15);
  transition: all 0.2s ease-in-out;
}

/* ========= CAMPANITA DE NOTIFICACIONES ========= */

/* base */
.nav-notif-bell {
  position: relative;
}

/* si hay nuevas => sacudimos la campana */
.nav-notif-bell.notif-bell-alert .bi-bell,
.nav-notif-bell.notif-bell-alert .bi-bell-fill {
  animation: bell-shake 0.9s ease-in-out infinite;
  transform-origin: top center;
}

/* el puntito rojo late / hace pulso */
#nav-notif-dot.notif-badge-pulse {
  box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.8);
  animation: notif-pulse 1.4s ease-out infinite;
}

/* Animación de sacudida de la campana */
@keyframes bell-shake {
  0%   { transform: rotate(0deg); }
  15%  { transform: rotate(-15deg); }
  30%  { transform: rotate(12deg); }
  45%  { transform: rotate(-9deg); }
  60%  { transform: rotate(6deg); }
  75%  { transform: rotate(-3deg); }
  100% { transform: rotate(0deg); }
}

/* Pulso alrededor del badge rojo (sin tocar su translate de Bootstrap) */
@keyframes notif-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.8);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(220, 53, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
  }
}

/* Columna "Contacto" en facturación: ancho limitado con "..." */
.invoice-contact {
  max-width: 260px;          /* ajustá este número a gusto: 220, 280, etc. */
}

.invoice-contact .text-truncate {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body {
  background-image: url("/static/img/rv-fondo.png.png"); 
  background-size: cover;
  background-position: center top;
  background-attachment: fixed; /* efecto lindo tipo panel fijo */
}

.card-erp,
.card {
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(4px); /* si querés un toquecito glass */
}

.navbar-brand-image {
  display: flex;
  align-items: center;
  padding-top: 0;
  padding-bottom: 0;
  margin-right: .2rem;
}

.navbar-brand-logo {
  height: 22px;
  width: auto;
  display: block;
  object-fit: contain;
}

.module-header {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(4px);
}

.module-header-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
  color: #1f2937;
}

.module-header-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  color: #6b7280;
}

.module-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

@media (max-width: 991.98px) {
  .module-header {
    padding: 0.95rem 1rem;
  }

  .module-header-title {
    font-size: 1.3rem;
  }

  .module-header-actions {
    margin-top: 0.85rem;
    width: 100%;
  }
}
/* ==========================================================
   CAPA MOBILE RV GRÁFICA
   Solo afecta pantallas chicas. Desktop queda igual.
   ========================================================== */
.mobile-bottom-nav,
.mobile-cards {
  display: none;
}

@media (max-width: 768px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    background-attachment: scroll;
    padding-bottom: 82px;
  }

  main.container-fluid,
  main.container-xxl,
  .container,
  .container-fluid,
  .container-lg,
  .container-xl,
  .container-xxl {
    padding-left: .75rem !important;
    padding-right: .75rem !important;
  }

  main.container-fluid {
    padding-top: .85rem !important;
    padding-bottom: 1rem !important;
  }

  .navbar {
    position: sticky;
    top: 0;
    z-index: 1040;
  }

  .navbar .container-fluid {
    padding-left: .85rem !important;
    padding-right: .85rem !important;
  }

  .navbar-brand img {
    height: 20px !important;
    max-height: 20px !important;
  }

  .navbar-collapse {
    margin-top: .65rem;
    padding: .75rem;
    border-radius: 16px;
    background: rgba(6, 28, 55, .22);
  }

  .navbar-nav .nav-link {
    min-height: 42px;
    display: flex;
    align-items: center;
    border-radius: 12px;
    padding-left: .85rem;
    padding-right: .85rem;
    font-weight: 700;
  }

  .navbar-nav .nav-link:hover,
  .navbar-nav .nav-link:focus {
    background: rgba(255,255,255,.12);
  }

  .navbar .dropdown-menu-lg {
    width: calc(100vw - 1.5rem);
    max-width: calc(100vw - 1.5rem);
  }

  .toast-container {
    left: .75rem !important;
    right: .75rem !important;
    top: .75rem !important;
    padding: 0 !important;
  }

  .toast {
    width: 100%;
  }

  footer {
    display: none;
  }

  .module-header,
  .module-hero,
  .rv-module-hero {
    border-radius: 14px !important;
    margin-bottom: .75rem !important;
  }

  .module-header,
  .module-hero .card-body,
  .rv-module-hero__content {
    padding: .9rem !important;
  }

  .module-header-title,
  .module-title,
  .rv-module-hero__title,
  h1.h3,
  h1.h4 {
    font-size: 1.18rem !important;
    line-height: 1.15 !important;
  }

  .module-header-subtitle,
  .module-desc,
  .rv-module-hero__subtitle,
  .text-muted {
    font-size: .82rem;
  }

  .module-header-actions,
  .module-hero-actions,
  .rv-module-hero__actions,
  .inventory-page > .d-flex:first-child,
  .contacts-page .rv-module-hero__content {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: .55rem !important;
  }

  .module-header-actions .btn,
  .module-hero-actions .btn,
  .rv-module-hero__actions .btn,
  .inventory-page > .d-flex:first-child .btn {
    width: 100%;
  }

  .card,
  .card-erp,
  .compact-card,
  .compact-filter {
    border-radius: 14px !important;
  }

  .card-body,
  .compact-card .card-body,
  .compact-filter .card-body,
  .card-erp .card-body {
    padding: .85rem !important;
  }

  .row {
    --bs-gutter-x: .75rem;
    --bs-gutter-y: .75rem;
  }

  .form-label {
    font-size: .82rem;
    font-weight: 800;
    margin-bottom: .28rem;
  }

  .form-control,
  .form-select,
  .choices__inner {
    min-height: 44px;
    font-size: 16px !important;
    border-radius: 11px !important;
  }

  textarea.form-control {
    min-height: 96px;
  }

  .form-text,
  .small {
    font-size: .76rem;
  }

  .btn {
    min-height: 44px;
    border-radius: 11px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    font-weight: 700;
  }

  .btn-sm {
    min-height: 40px;
    padding: .46rem .68rem;
  }

  .btn-group {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: .38rem;
    width: 100%;
  }

  .btn-group > .btn {
    border-radius: 11px !important;
  }

  .table-wrap,
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .compact-table,
  .table {
    min-width: 760px;
  }

  .compact-table thead th,
  .table thead th {
    font-size: .68rem;
    padding: .62rem .65rem;
    white-space: nowrap;
  }

  .compact-table tbody td,
  .table tbody td {
    font-size: .82rem;
    padding: .58rem .65rem;
  }

  .desktop-table-mobile-hide {
    display: none !important;
  }

  .mobile-cards {
    display: grid;
    gap: .68rem;
  }

  .mobile-card {
    background: rgba(255,255,255,.97);
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 16px;
    padding: .86rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
    backdrop-filter: blur(4px);
  }

  .mobile-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .65rem;
    margin-bottom: .42rem;
    color: #64748b;
    font-size: .75rem;
    font-weight: 800;
  }

  .mobile-card__number {
    color: #0f172a;
    font-size: .95rem;
    font-weight: 900;
  }

  .mobile-card__title {
    color: #111827;
    font-size: .98rem;
    font-weight: 900;
    line-height: 1.18;
    margin-bottom: .24rem;
  }

  .mobile-card__meta {
    color: #64748b;
    font-size: .78rem;
    line-height: 1.35;
  }

  .mobile-card__total {
    color: #0f172a;
    font-size: 1.02rem;
    font-weight: 900;
    margin-top: .55rem;
  }

  .mobile-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: .34rem;
    margin-top: .55rem;
  }

  .mobile-card__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
    margin-top: .75rem;
  }

  .mobile-card__actions.mobile-card__actions--3 {
    grid-template-columns: 1fr;
  }

  .remito-badge {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
  }

  .pagination {
    justify-content: center !important;
    flex-wrap: wrap;
    gap: .25rem;
  }

  .page-link {
    min-height: 40px;
    display: flex;
    align-items: center;
    border-radius: 10px !important;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: .55rem;
    right: .55rem;
    bottom: .55rem;
    z-index: 1050;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .25rem;
    padding: .42rem;
    background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 20px;
    box-shadow: 0 16px 42px rgba(15, 23, 42, .22);
    backdrop-filter: blur(10px);
  }

  .mobile-bottom-nav a {
    min-height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .12rem;
    border-radius: 15px;
    color: #64748b;
    text-decoration: none;
    font-size: .66rem;
    font-weight: 900;
    line-height: 1;
  }

  .mobile-bottom-nav a i {
    font-size: 1.08rem;
    line-height: 1;
  }

  .mobile-bottom-nav a.active,
  .mobile-bottom-nav a:hover,
  .mobile-bottom-nav a:focus {
    background: #0d6efd;
    color: #fff;
  }
}

@media (max-width: 768px) {
  .quick-consumption-table table {
    min-width: 0;
  }

  .quick-consumption-table thead {
    display: none;
  }

  .quick-consumption-table tbody,
  .quick-consumption-table tr,
  .quick-consumption-table td {
    display: block;
    width: 100%;
  }

  .quick-consumption-table tr {
    margin-bottom: .75rem;
    padding: .75rem;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 14px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
  }

  .quick-consumption-table td {
    padding: .34rem 0 !important;
    border: 0 !important;
  }

  .quick-consumption-table td:nth-child(1)::before,
  .quick-consumption-table td:nth-child(2)::before,
  .quick-consumption-table td:nth-child(3)::before {
    display: block;
    margin-bottom: .25rem;
    color: #475569;
    font-size: .78rem;
    font-weight: 900;
  }

  .quick-consumption-table td:nth-child(1)::before { content: "Material"; }
  .quick-consumption-table td:nth-child(2)::before { content: "Metros lineales usados"; }
  .quick-consumption-table td:nth-child(3)::before { content: "Detalle"; }

  .quick-consumption-actions {
    flex-direction: column-reverse;
  }

  .quick-consumption-actions .btn {
    width: 100%;
  }
}
