/* ============================
   BASE
============================ */
@font-face {
    font-family: "Feature Mono";
    src: url("../fonts/featuremono-bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

.balam-front, 
.balam-front input, 
.balam-front select, 
.balam-front textarea, 
.balam-front button {
    letter-spacing: -0.5px !important;
}

.balam-front {
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #dfdfdf;
    min-height: 100vh;
    padding: 0px 0;
    font-weight: 500;
}

.balam-mobile-only {
    display: none !important;
}

.balam-mobile-label {
    display: none;
}

body.balam-modal-open {
    overflow: hidden !important;
    overscroll-behavior: contain;
}

.balam-front-wrapper{
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 20px;
    box-sizing: border-box;
    background: transparent; /* Evita doble fondo */
}

.balam-client-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 40px;
    font-size: 14px;
    color: #333;
    }

.balam-client-col div {
    margin-bottom: 10px;
    line-height: 1;
    margin-top: 10px;
}

.balam-client-col strong {
    display: inline-block;
    min-width: 160px;
    font-weight: 600;
    color: #333;
}

.balam-min-price-exception-badge{
    display:inline-flex;
    align-items:center;
    gap:8px;
    margin:16px 0 6px;
    padding:5px 15px;
    border-radius:999px;
    background:#fff2d8;
    color:#cc8413;
    font-size:.85em;
    font-weight:700;
    
}

.balam-quote-totals{
    width: 300px;
}

.balam-btn.color-whatsapp{
    background:#25d366;
    color:#fff;
    border-color:#25d366;
}

.balam-btn.color-whatsapp:hover{
    background:#1fb85a;
    border-color:#1fb85a;
    color:#fff;
}

.balam-whatsapp-quote-btn{
    width:28px;
    height:28px;
    min-width:28px;
    min-height:28px;
    padding:0 !important;
    border-radius:50% !important;
    justify-content:center;
    align-items:center;
}

.balam-whatsapp-quote-btn svg{
    width:14px;
    height:14px;
    display:block;
    color:#fff;
    fill:#fff;
}

/* ============================
   HEADER PRINCIPAL
============================ */
.balam-front-header{
    margin-bottom: 20px;
}

.balam-front-header-inner{
    background: #333;
    border-radius: 18px;
    padding: 18px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    
}

.balam-front-header-left{
    font-family: "Feature Mono", "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0 !important;
}

.balam-front-header-right img{
    height: 36px;
    width: auto;
}

/* ============================
   BARRA DE ESTADO
============================ */
.balam-front-status{
    margin-top: 10px;
    border-radius: 16px;
    padding: 14px 0px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #333;
}

.balam-front-status-icon{
    width: 40px;
    height: 40px;
    object-fit: contain;
    opacity: 0.9;
    filter: grayscale(100%);
}

.balam-front-status-left{
    display: flex;
    align-items: center;
    gap: 10px;
}

.balam-front-status-right{
    display: flex;
    align-items: center;
    gap: 14px;
}

.balam-front-user{
    font-weight: 600;
    color: #333;
}

.balam-front-user-icon{
    width: 40px;
    height: 40px;
    object-fit: contain;
    opacity: 0.85;
    filter: grayscale(100%);
}

.balam-front-status-row {
    font-size: 14px;
    color: #555;
}

.balam-front-status-divider {
    height: 2px;
    background: #999;
    margin: 6px 0;
    width: 100%;
    opacity: 0.6;
}

/* --- BOTÓN LOGOUT ESTANDARIZADO --- */

/* ============================
   NAVEGACIÓN GENERAL
============================ */
.balam-front-nav-wrapper{
    margin: 0px 0px 30px 0px;
    border-radius: 20px;
    /* padding: 14px; */
    display: grid;
    align-items: center;
    gap: 8px;
}

/* ============================
   FLUJO PRINCIPAL (STEPS / PIPELINE)
============================ */
.balam-front-steps{
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
}

.balam-step{
    padding: 7px 15px;
    background: #FFF;
    border-radius: 30px;
    text-decoration: none;
    font-size: 14px;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 600;
    color: #999 !important;
    text-transform: uppercase;
    transition: all .2s ease;
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
}

.balam-step,
.balam-module {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* espacio entre icono y texto */
    position: relative;
}

/* Mantener efecto hover */
.balam-step:hover{
    filter: brightness(0.80);
}

.balam-step.active{
    background: #333;
    color: #fff !important;
}

/* ============================
   MÓDULOS COMPLEMENTARIOS
============================ */
.balam-front-modules{
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
}

.balam-module {
    padding: 8px 15px 6px 15px;
    background: #c5f5c5;
    border-radius: 30px;
    text-decoration: none;
    font-size: 11px;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 600;
    color: #44a620 !important;
    text-transform: uppercase;
    transition: all .2s ease;
    flex: 1 1 max-content;
    min-width: max-content;
    white-space: nowrap;
}

.balam-module:hover{
    filter: brightness(0.80);
}

.balam-module.active{
    background: #333;
    color: #fff !important;
}

/* ============================
   CONTENIDO PRINCIPAL
============================ */
.balam-front-content{
    background: #fff;
    border-radius: 22px;
    padding: 30px;
    border: 2px solid #dfdfdf;
    margin-top: 10px;
}

.balam-front-title{
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 36px;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 800;
    color: #333 !important;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.balam-front-title.has-icon{
    gap: 14px;
}

.balam-front-title-icon{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #333;
    flex: 0 0 auto;
    line-height: 1;
}

.balam-front-title-icon svg{
    width: 24px;
    height: 24px;
    display: block;
}

.balam-tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.balam-export-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.balam-logistics-modal-overlay {
    padding: 24px;
}

.balam-modal.balam-logistics-modal {
    width: min(420px, 94vw);
    max-height: min(88vh, 820px);
    overflow: auto;
    padding: 34px;
    border-radius: 12px;
}

.balam-logistics-modal-header {
    margin-bottom: 28px;
    padding-right: 44px;
    border-bottom: 2px solid #333;
    padding-bottom: 14px;
}

.balam-logistics-modal-header h2 {
    margin: 0 0 10px;
    color: #44a620;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
}

.balam-logistics-modal-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
    font-weight: 600;
}

.balam-logistics-modal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    align-items: start;
}

.balam-logistics-group:first-child {
    grid-row: auto;
}

.balam-logistics-group label {
    display: block;
    margin-bottom: 12px;
    color: #888;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .4px;
    text-transform: uppercase;
}

.balam-logistics-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
}

.balam-logistics-add-row .balam-input-lg {
    flex: 1;
    min-width: 0;
}

.balam-logistics-add {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border: 0;
    border-radius: 50%;
    background: #f1f1f1;
    color: #333;
    cursor: pointer;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    transition: all .15s ease;
}

.balam-logistics-add:hover {
    background: #333;
    color: #b4fb52;
    transform: scale(1.04);
}

.balam-logistics-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.balam-logistics-badge {
    text-transform: uppercase;
}

.balam-logistics-badge button {
    width: 16px;
    height: 16px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(46, 125, 50, .28);
    color: #2e7d32;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    line-height: 14px;
}

.balam-logistics-status {
    position: sticky;
    bottom: 0;
    display: none;
    width: max-content;
    margin: 24px 0 0 auto;
    padding: 10px 18px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 10px 25px rgba(0,0,0,.18);
}

.balam-logistics-status.is-visible {
    display: block;
}

.balam-logistics-status.is-error {
    background: #b71c1c;
}

.balam-divider {
    border: none;
    border-top: 2px solid #dfdfdf;
    margin: 30px 0;
    width: 100%;
}

/* ============================
   MINI LISTA DE PRODUCTOS (LISTADO)
============================ */
.balam-mini-products {
    list-style: none;
    padding: 0;
    margin: 0px !important;
    font-size: 11px;
    font-family: monospace;
    display: block;
    font-weight: 600;
    color: #333;
}

.balam-mini-products li {
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
}

.balam-quote-internal-note {
    margin-top: 8px;
    color: #666;
    font-size: 10px;
    line-height: 1.35;
}

.balam-quote-internal-note-label {
    display: inline-flex;
    align-items: center;
    margin-bottom: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #efefef;
    color: #555;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: normal;
}

/* ============================
   FILTROS
============================ */
.balam-front-filters{
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 300;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.balam-filters-controls {
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 100%;
}

.balam-filters-row {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    align-items: center;
}

.balam-filters-row.search-row input[name="q"]{
    width: min(360px, 100%);
    min-width: 260px;
    flex: 1 1 320px;
}

.balam-filters-row.balam-dual-search-row{
    gap: 7px;
}

.balam-filters-row.balam-dual-search-row input[name="q"],
.balam-filters-row.balam-dual-search-row input[name="product_q"]{
    width: calc((50% - 12px) / 2);
    max-width: calc((50% - 12px) / 2);
    min-width: 220px;
    flex: 0 1 calc((50% - 12px) / 2);
}

.balam-filters-row.search-row select{
    min-width: 0;
    flex: 0 1 180px;
}

.balam-filters-row.search-row .balam-btn{
    margin-left: auto;
}

.balam-projects-filters .balam-filters-row.search-row{
    width: 100% !important;
    max-width: 100% !important;
}

.balam-projects-filters .balam-filters-row.search-row input[name="q"]{
    width: var(--balam-projects-filter-width, 360px) !important;
    max-width: 100% !important;
    flex: 0 1 var(--balam-projects-filter-width, 360px) !important;
    box-sizing: border-box !important;
}

.balam-projects-filters .balam-filters-row.search-row .balam-btn{
    margin-left: auto;
    flex: 0 0 auto;
    white-space: nowrap;
}

.balam-clients-filters .balam-filters-row.search-row{
    flex-wrap: nowrap;
}

.balam-clients-filters .balam-filters-row.search-row input[name="q"]{
    width: 260px;
    min-width: 200px;
    flex: 0 1 260px;
}

.balam-clients-filters .balam-filters-row.search-row select{
    flex: 1 1 180px;
    max-width: 260px;
}

.balam-clients-filters .balam-filters-row.search-row .balam-btn{
    margin-left: 0;
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .balam-filters-row.balam-dual-search-row input[name="q"],
    .balam-filters-row.balam-dual-search-row input[name="product_q"]{
        width: 100%;
        max-width: none;
        min-width: 0;
        flex: 1 1 100%;
    }
}

.balam-date-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.balam-date-group label {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    white-space: nowrap;
}

.balam-filters-spacer {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
    flex-wrap: wrap;
}

.balam-front-filters select,
.balam-front-filters input{
    padding: 5px 10px;
    border: 2px solid #dfdfdf;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ============================
   SISTEMA DE BOTONES BALAM (VERSION 1.1)
============================ */
.balam-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    border: 2px solid transparent; /* Borde base para box-model consistente */
    cursor: pointer;
    transition: all .2s ease;
    border-radius: 50px;
    box-sizing: border-box;
    gap: 8px;
    white-space: nowrap;
    line-height: 1;
}

.balam-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.balam-btn:active {
    transform: translateY(0);
}

/* --- TAMAÑOS --- */
.balam-btn.size-micro {
    padding: 6px 10px;
    font-size: 10px;
}

.balam-btn.size-nano {
    padding: 3px 7px;
    font-size: 8px;
    font-weight: 800;
    height: auto;
    min-height: 0;
    line-height: 1;
}

.balam-btn.size-small {
    padding: 7px 16px;
    font-size: 11px;
}

.balam-btn.size-normal {
    padding: 8px 18px;
    font-size: 13px;
    height: 33px !important;
}

.balam-btn.size-large {
    padding: 12px 28px;
    font-size: 15px;
}

/* --- COLORES --- */
.balam-btn.color-black {
    background: #333;
    color: #fff !important;
    border-color: #333;
}

.balam-btn.color-green {
    background: #dfdfdf;
    color: #333 !important;
    border-color: #dfdfdf;
}

.balam-btn.color-blue {
    background: #407de4;
    color: #fff !important;
    border-color: #407de4;
}

.balam-btn.color-grey {
    background: #dfdfdf;
    color: #333 !important;
    border-color: #dfdfdf;
}

.balam-btn.color-white {
    background: #fff;
    color: #333 !important;
    border: 2px solid #333;
}

/* ============================
    TABLA
============================ */
.balam-front-table{
    width: 100%;
    margin-top: 10px;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #dfdfdf;
    margin-bottom: 25px;
}

.balam-front-table th{
    background: #333;
    color: #fff;
    padding: 15px 10px;
    border-right: 2px solid #333;
    border-bottom: 2px solid #333;
    font-size: 12px;
    text-align: left;
}

.balam-front-table th:last-child {
    border-right: none;
}

.balam-front-table td{
    padding: 15px 10px;
    border-right: 2px solid #dfdfdf;
    border-bottom: 2px solid #dfdfdf;
    font-size: 11px;
    color: #333;
}

.balam-front-table td:last-child {
    border-right: none;
}

.balam-front-table tr:last-child td {
    border-bottom: none;
}

.balam-quote-totals-table td{
    padding: 10px 15px;
    font-size: 11px;
    color: #333;
}

.balam-front-table tr:hover{
    background: #fafafa;
}

.balam-clients-actions-inline{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.balam-file-picker{
    width:100%;
    position:relative;
}

.balam-file-picker-input{
    position:absolute;
    width:1px;
    height:1px;
    padding:0;
    margin:-1px;
    overflow:hidden;
    clip:rect(0,0,0,0);
    white-space:nowrap;
    border:0;
}

.balam-file-picker-control{
    display:flex;
    align-items:center;
    gap:10px;
    width:100%;
    min-height:44px;
    padding:5px 14px;
    border:2px solid #ddd;
    border-radius:999px;
    background:#fff;
    box-sizing:border-box;
    cursor:pointer;
    transition:border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.balam-file-picker-control:hover{
    border-color:#cfcfcf;
}

.balam-file-picker-input:focus + .balam-file-picker-control,
.balam-file-picker-control:focus-within{
    border-color:#111;
    box-shadow:0 0 0 3px rgba(17,17,17,.08);
}

.balam-file-picker-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:136px;
    min-height:31px;
    padding:0 16px;
    border-radius:999px;
    background:#f3f3f3;
    color:#222;
    font-size:11px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:0;
    flex-shrink:0;
}

.balam-file-picker-name{
    min-width:0;
    color:#777;
    font-size:12px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.balam-actions-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 5px !important;
}

.balam-clients-table th:last-child,
.balam-clients-table td[data-label="Acciones"]{
    min-width: 150px;
    white-space: nowrap;
}

/* ============================
   IMÁGENES
============================ */
.balam-product-img {
  width: 65px;
  border-radius: 8px;
  border: 2px solid #dfdfdf;
  background: #fff;
  padding: 5px;
}

/* ============================
   AVISOS
============================ */
.balam-notice{
    background: #f3ffef;
    border-radius: 15px;
    padding: 10px 20px;
    margin: 0px 0px 40px 0px;
    
    border-left: 5px solid transparent;
    font-size: 14px;
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 1;
}

.balam-notice.success{ 
border-left-color: #4CAF50; 
color: #2e7d32; 
}

.balam-notice.error{ 
border-left-color: #e53935; 
color: #b71c1c; 
}

.balam-notice.balam-notice-hide {
    opacity: 0;
    transform: translateY(-4px);
}

/* ============================
   FOOTER
============================ */
.balam-front-footer{
    font-family: "Feature Mono", "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
    color: #777;
    font-weight: 700;
    letter-spacing: 0 !important;
}

.balam-front-footer a{
    color: #333;
    font-weight: 600;
    text-decoration: none;
}

/* ============================
   TABLA FILAS ALTERNADAS
============================ */
.balam-front-table tbody tr:nth-child(even) {
    background: #f7f7f7;   /* gris extra suave para reducir contraste */
}

.balam-front-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

/* Mantener efecto hover */
.balam-front-table tbody tr:hover {
    background: #c5f5c5;
}

/* ============================
   FILTROS INVENTARIO (LAYOUT)
============================ */
.balam-filters-toggle-mobile {
    display: none !important;
}

.balam-system-filters{
    display: flex;
    gap: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Empuja el boton PDF al extremo derecho */
.balam-filters-spacer{
    margin-left: auto;
}

.balam-system-table td,
.balam-system-table th {
    padding: 8px 10px;
    font-size: 12px;
}

/* ============================
   BADGES DE ESTATUS 
============================ */
.balam-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: lowercase;
    white-space: nowrap;
}

.balam-badge svg {
    width: 15px;
    height: 15px;
    stroke-width: 2.8;
    flex-shrink: 0;
}

/* PENDIENTE */
.balam-badge.status-pendiente {
    background: #f1f1f1;
    color: #7e7e7e;
}

/* LEIDO */
.balam-badge.status-leido {
    background: #e8f4ff;
    color: #0056b3;
}

/* HECHO */
.balam-badge.status-hecho {
    background: #c5f5c5;
    color: #44a620;
}

/* PEDIDO */
.balam-badge.status-pedido {
    background: #f5f3c5;
    color: #a6a420;
}

.balam-badge.status-prefactura {
    background: #ece9ff;
    color: #6250c9;
}

/* EMBARQUE */
.balam-badge.status-embarque {
    background: #e8f4ff;
    color: #0056b3;
}

.balam-stock-badge {
    width: 100%;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f0f0f0;
    color: #555;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    padding: 5px 8px;
    box-sizing: border-box;
    white-space: nowrap;
}

.balam-products-inputs #balam-stock-display {
    min-height: 42px;
    border-radius: 0;
    background: transparent;
    color: #333333;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    padding: 0;
}

.balam-products-inputs .balam-stock-add-group .balam-field > label {
    transform: translateY(8px);
}

.balam-backorder-add-toggle,
.balam-row-backorder {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    color: #555;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.balam-row-backorder {
    margin-top: 8px;
    text-transform: none;
}

.balam-quote-items-table td.balam-quote-qty-cell {
    text-align: center;
    vertical-align: middle;
}

.balam-quote-qty-cell .balam-row-backorder {
    justify-content: center;
    margin-top: 10px;
    margin-bottom: 0;
}

.balam-quote-qty-cell .balam-qty-group {
    justify-content: center;
}

.balam-row-stock-badge {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    border-radius: 999px;
    background: #f0f0f0;
    color: #666;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    padding: 4px 7px;
    white-space: nowrap;
}

.balam-quote-half-field {
    width: 50%;
    max-width: 50%;
}

.balam-quote-client-half-row {
    width: 100%;
    max-width: 100%;
}

.balam-quote-client-half-select {
    flex: 0 1 50%;
    max-width: 50%;
}

@media (max-width: 640px) {
    .balam-quote-half-field,
    .balam-quote-client-half-row,
    .balam-quote-client-half-select {
        width: 100%;
        max-width: 100%;
        flex-basis: 100%;
    }
}

.balam-quote-form .balam-front-filters.balam-quote-half-field {
    width: 50% !important;
    max-width: 50% !important;
    flex: 0 0 50% !important;
}

.balam-quote-form .balam-quote-client-half-select,
.balam-quote-form select#balam-client-select.balam-quote-client-half-select {
    width: 50% !important;
    max-width: 50% !important;
    flex: 0 0 50% !important;
}

@media (max-width: 640px) {
    .balam-quote-form .balam-front-filters.balam-quote-half-field,
    .balam-quote-form .balam-quote-client-half-select,
    .balam-quote-form select#balam-client-select.balam-quote-client-half-select {
        width: 100% !important;
        max-width: 100% !important;
        flex-basis: 100% !important;
    }
}

/* CERRADO */
.balam-badge.status-cerrado {
    background: #dfdfdf;
    color: #333;
}

button.balam-badge {
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

button.balam-badge:hover {
    filter: brightness(.96);
}

/* INCOMPLETO */
.balam-badge.status-incompleto {
    background:#ffe5e5;
    color:#c62828;
}

.balam-carrier-group{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:8px;
}

/* POR APROBAR */
.balam-badge.status-por_aprobar {
    background:#ffe5e5;
    color:#c62828;
}

/* APROBADA */
.balam-badge.status-aprobada {
    background: #e8f4ff;
    color: #0056b3;
}

/* CERRADA */
.balam-badge.status-cerrada {
    background: #dfdfdf;
    color: #333;
}

/* ENVIO LOCAL */
.balam-badge.status-local {
    background: #fde9ff;
    color: #cc6aa9;
}

.balam-badge.status-client-guide {
    background: #ffe7cc;
    color: #c46613;
}

.balam-badge.status-project {
    background: #fff1db;
    color: #c77413;
}

.balam-projects-meta{
    display:flex;
    flex-direction:column;
    gap:6px;
    font-size:12px;
    line-height:1.35;
    color:#555;
}

.balam-projects-meta strong{
    color:#333;
}

.balam-projects-stack,
.balam-project-status-stack{
    display:flex;
    flex-direction:column;
    gap:8px;
    align-items:flex-start;
}

.balam-project-close-reason{
    display:block;
    max-width:140px;
    line-height:1.25;
}

.balam-project-pdf-modal{
    width:min(58vh, 80vw);
    max-width:88vw;
    height:min(78vh, 980px);
    padding:0;
    border-radius:0;
    display:flex;
    flex-direction:column;
    overflow:hidden;
    background:transparent;
    box-shadow:none;
}

.balam-project-pdf-canvas-wrap{
    flex:1 1 auto;
    min-height:0;
    height:100%;
    overflow:hidden;
    padding:0;
    background:transparent;
}

.balam-project-pdf-pages{
    min-height:100%;
    height:100%;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:0;
    width:100%;
    padding:0;
    background:transparent;
}

.balam-project-pdf-page-canvas{
    display:block;
    width:auto;
    max-width:none;
    height:100%;
    max-height:100%;
    background:#fff;
    flex:0 0 auto;
}

.balam-project-pdf-loading{
    min-height:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
    font-size:14px;
    font-weight:700;
    color:#fff;
}

#balamProjectQuotePdfModal .balam-modal-close{
    top:12px;
    right:12px;
    background:#f0f0f0;
}

.balam-folio-preview-trigger{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:24px;
    height:24px;
    padding:0;
    margin-top:6px;
    border:none;
    background:transparent;
    color:#6e6e6e;
    cursor:pointer;
    transition:color .18s ease, transform .18s ease;
}

.balam-folio-preview-trigger svg{
    width:16px;
    height:16px;
}

.balam-folio-preview-trigger:hover{
    color:#2f2f2f;
    transform:scale(1.06);
}

.balam-quick-pdf-modal{
    width:min(58vh, 80vw);
    max-width:88vw;
    height:min(78vh, 980px);
    padding:0;
    border-radius:0;
    display:flex;
    flex-direction:column;
    overflow:hidden;
    background:transparent;
    box-shadow:none;
}

.balam-quick-pdf-canvas-wrap{
    flex:1 1 auto;
    min-height:0;
    height:100%;
    overflow:hidden;
    padding:0;
    background:transparent;
}

.balam-quick-pdf-pages{
    min-height:100%;
    height:100%;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:0;
    width:100%;
    padding:0;
    background:transparent;
}

.balam-quick-pdf-page-canvas{
    display:block;
    width:auto;
    max-width:none;
    height:100%;
    max-height:100%;
    background:#fff;
    flex:0 0 auto;
}

.balam-quick-pdf-loading{
    min-height:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
    font-size:14px;
    font-weight:700;
    color:#fff;
}

.balam-badge.status-entregado {
    background: #c5f5c5;
    color: #2e7d32;
}

.balam-badge.status-cancelado {
    background: #ffe5e5;
    color: #b71c1c;
}

.balam-shipment-cancel-note {
    margin-top: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #ffeaea;
    color: #9b2020;
    font-size: 11px;
    line-height: 1.35;
}

/* ============================
   TOGGLE ALMACÉN
============================ */
.balam-toggle-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.balam-toggle-label {
    font-size: 12px;
    font-weight: 600;
    color: #8a8a8a;
}


td[data-label="Almacén"] > .balam-toggle-label{
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #d0d0d0;
    color: #666;
    font-size: 11px;
    text-transform: uppercase;
}

td[data-label="Almacén"] > .balam-toggle-label.is-on{
    background: #c5f5c5;
    color: #2e7d32;
}

.balam-toggle {
    position: relative;
    width: 54px;
    height: 25px;
    border-radius: 999px;
    border: 2px solid #ccc;
    background: #cfd8d3;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.balam-toggle.is-on {
    background: #c5f5c5;
    border-color: #c5f5c5;
}

.balam-toggle.is-on + .balam-toggle-label,
.balam-toggle-row .balam-toggle.is-on ~ .balam-toggle-label,
.balam-toggle-label.is-on {
    color: #2e7d32;
}

.balam-toggle-meta {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

/* ============================
   RESPONSIVE
============================ */



.balam-toggle.is-off {
    background: #ccc;
}

.balam-toggle.is-disabled {
    opacity: 0.65;
    cursor: default;
}

.balam-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #fff;
    
    transition: transform 0.2s ease;
}

.balam-toggle.is-on .balam-toggle-knob {
    transform: translateX(24px);
}

/* Opcional: Hover sutil */
.balam-badge:hover {
    filter: brightness(0.80);
}

/* ============================
   INPUTS GRANDES COTIZACIONES
============================ */

.balam-input-lg {
    display: block;
    width: 100%;
    font-size: 12px !important;
    padding: 0 18px !important;
    height: 33px !important;
    font-weight: 600;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    border-radius: 50em;
    border: 2px solid #dfdfdf !important;
    background: #fff;
    box-sizing: border-box !important;
    text-overflow: ellipsis;
    transition: all .2s ease;
}

textarea.balam-input-lg {
    height: auto !important;
    border-radius: 18px !important;
    padding: 15px 18px !important;
}

/* Ocultar flechas nativas (spinners) */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type=number] {
  -moz-appearance: textfield;
}

/* Controles personalizados +/- */
.balam-custom-num-input {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #dfdfdf;
    border-radius: 50em;
    padding: 0 10px;
    height: 33px;
    box-sizing: border-box;
}

.balam-custom-num-input input {
    border: none !important;
    background: transparent !important;
    text-align: center !important;
    width: 100% !important;
    flex: 1;
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    font-family: "DM Sans", sans-serif !important;
    color: #333 !important;
    box-shadow: none !important;
}

.balam-num-btn {
    background: none !important;
    border: none !important;
    font-size: 20px !important;
    font-weight: 400 !important;
    cursor: pointer;
    padding: 0 5px;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
    user-select: none;
    height: 100%;
}

.balam-num-btn:hover {
    color: #333;
}

/* ============================
   TITULOS DE SECCION
============================ */

.balam-section-title{
    font-size: 26px;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #333 !important;
}

.balam-subsection-title{
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #333 !important;
}

/* Condensación para Cotizaciones - Ajustada para mejor respiro */
.balam-quote-form h4.balam-subsection-title {
    margin-top: 12px !important;
    margin-bottom: 7px !important;
}
.balam-quote-form .balam-front-filters {
    margin-bottom: 15px !important;
}

.balam-project-registration {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.balam-project-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    cursor: pointer;
}

.balam-project-toggle input {
    width: 18px;
    height: 18px;
}

.balam-project-fields {
    background: #fafafa;
    border: 1px solid #e4e4e4;
    border-radius: 16px;
    padding: 16px;
}

.balam-project-fields-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.balam-project-span-2 {
    grid-column: span 2;
}

.balam-project-full {
    grid-column: 1 / -1;
}

@media (max-width: 800px) {
    .balam-project-fields-grid {
        grid-template-columns: 1fr;
    }

    .balam-project-span-2,
    .balam-project-full {
        grid-column: auto;
    }
}

/* ============================
   CONTROLES DE CANTIDAD
============================ */

.balam-qty-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.balam-qty-group button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #f1f1f1;
    color: #333;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.balam-qty-group button:hover {
    background: #333;
    color: #b4fb52; /* tu verde */
}

.balam-row-qty {
    width: 42px;
    min-width: 42px;
    height: 28px;
    border: 0;
    background: transparent;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    text-align: center;
    font-weight: 400;
    padding: 0;
    color: #333;
    -moz-appearance: textfield;
}

.balam-row-qty::-webkit-outer-spin-button,
.balam-row-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.balam-quote-item-details {
    vertical-align: middle;
}

.balam-quote-item-features {
    margin-bottom: 8px;
    line-height: 1.35;
}

.balam-quote-item-details .balam-row-delivery {
    width: 100%;
    box-sizing: border-box;
}

/* ============================
   BOTÓN ELIMINAR (X)
============================ */
.balam-front-table button[onclick*="balamRemoveRow"] {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #f1f1f1;
    color: #555;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.balam-front-table button[onclick*="balamRemoveRow"]:hover {
    background: #ff4d4d;
    color: #fff;
}

/* ============================
   TAREAS
============================ */
.balam-task-card {
    background: #fff;
    border-radius: 18px;
    padding: 18px 20px;
    
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all .2s ease;
}

.balam-task-card:hover {
    transform: translateY(-2px);
    
}

.balam-task-body strong {
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.balam-task-body p {
    font-size: 12px;
    color: #666;
    margin: 0 0 6px;
}

.balam-task-date {
    font-size: 11px;
    color: #999;
}

.balam-task-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ============================
   AVISOS Y TAREAS
============================ */
.balam-top-notification {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    text-decoration: none;
}

.balam-top-notification:hover {
    opacity: .8;
}

/* ============================
   ICONO HEADER ALERTA ACTIVA (NEON BLANCO)
============================ */
.balam-front-status-row .balam-actions-row{
    gap: 8px;
}

.balam-toggle-label-prefix {
    display: none;
}

.balam-shipment-footer-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 25px;
}

.balam-shipment-footer-notes {
    flex: 1;
}

.balam-shipment-footer-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 1025px) {
    .balam-shipment-footer-layout {
        flex-direction: row;
        gap: 30px;
        align-items: stretch;
    }
    .balam-shipment-footer-actions {
        min-width: 280px;
        justify-content: flex-end;
    }
}

.balam-front-status-icon.balam-status-active {
    animation: balamStatusPulse 1.6s infinite ease-in-out;
    filter:
        drop-shadow(0 0 4px rgba(255, 255, 255, 1))
        drop-shadow(0 0 8px rgba(255, 255, 255, 0.9));
}

/* Pulso tipo neon compacto */
@keyframes balamStatusPulse {
    0% {
        transform: scale(1);
        opacity: 1;
        filter:
            drop-shadow(0 0 3px rgba(255, 255, 255, 0.8))
            drop-shadow(0 0 6px rgba(255, 255, 255, 0.7));
            
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
        filter:
            drop-shadow(0 0 6px rgba(255, 255, 255, 1))
            drop-shadow(0 0 12px rgba(255, 255, 255, 0.95));
    }
    100% {
        transform: scale(1);
        opacity: 0.9;
        filter:
            drop-shadow(0 0 3px rgba(255, 255, 255, 0.8))
            drop-shadow(0 0 6px rgba(255, 255, 255, 0.7));
    }
}

/* ============================
   TRANSICIÓN AL EDITAR CLIENTE
============================ */
#balam-client-info,
#balam-client-edit-box {
    transition: opacity .25s ease, transform .25s ease;
}

.balam-client-name {
        display:grid;
        grid-template-columns: 180px 1fr;
        row-gap:8px;
        column-gap:16px;
        font-size:12px;
        color:#333;
        max-width:100%;
}

/* ============================
   ESCONDE FIELDS DATOS FISCALES
============================ */
.balam-hidden {
    display: none;
}

/* ============================
   AVISO FIELD
============================ */
.balam-error {
    border: 2px solid #e63946 !important;
    background: #fff5f5;
}

/* ============================
   LABEL
============================ */
.balam-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
}

/* ============================
   CARD
============================ */
.balam-block-card {
    padding: 20px;
    border: 2px solid #dfdfdf;
    border-radius: 0.5em;
}

.balam-reports-wrapper > .balam-block-card + .balam-block-card,
.balam-reports-wrapper > .balam-report-sections + .balam-block-card,
.balam-reports-wrapper > .balam-block-card + .balam-report-sections {
    margin-top: 20px !important;
}

/* Evitar que el wrapper de móvil rompa la fila en desktop */
.balam-mobile-row-group,
.balam-stock-add-group {
    display: contents;
}

.balam-stock-add-group > div:last-child {
    width: 100px;
}

/* En desktop, balam-form-card no debe añadir estilos extra para evitar duplicar el borde de front-content */
@media (min-width: 1025px) {
    .balam-front-content.balam-form-card {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
    }
}

.balam-states-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    align-items: stretch;
}

.balam-states-col {
    height: 100%;
    display: flex;
}

.balam-states-col .balam-front-table {
    height: 100%;
    margin-top: 0;
}

.balam-states-chart-card {
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.balam-states-pie-wrap {
    width: 100%;
    max-width: 180px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    position: relative;
}

#balamStatesSalesChart {
    width: 100% !important;
    height: 100% !important;
}

.balam-states-legend {
    margin-top: 10px;
    font-size: 10px;
    line-height: 1.2;
    height: auto;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.balam-summary-table {
    table-layout: fixed;
}

.balam-vendor-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.balam-vendor-stat-card {
    min-height: 108px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 14px 16px;
}

.balam-vendor-stat-card-list {
    justify-content: flex-start;
    text-align: left;
}

.balam-vendor-stat-title {
    display: block;
    color: #666;
    font-size: 13px;
    line-height: 1.25;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.balam-vendor-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #777;
    line-height: 1.1;
}

.balam-vendor-stat-value-small {
    font-size: 20px;
}

.balam-vendor-stat-list {
    margin: 4px 0 0;
    padding-left: 16px;
    font-size: 11px;
    line-height: 1.2;
}

.balam-vendor-stat-empty {
    margin-top: 6px;
    color: #888;
    font-size: 12px;
}

@media (max-width: 1024px) {
    .balam-vendor-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .balam-vendor-stats-grid {
        grid-template-columns: 1fr;
    }
}

.balam-summary-table th,
.balam-summary-table td {
    vertical-align: middle;
}

.balam-performance {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.balam-performance-pct {
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    color: #3b3b3b;
}

.balam-performance-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #dfdfdf;
    overflow: hidden;
}

.balam-performance-fill {
    height: 100%;
    background: linear-gradient(90deg, #7fdc7f 0%, #38b84b 100%);
    border-radius: 999px;
}

/* ============================
   VENTANA DE CONFIRMACIÓN (ANIMACIONES MODAL)
============================ */
@keyframes balamFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes balamModalZoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.balam-modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(0,0,0,.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: balamFadeIn 0.3s ease forwards;
}

.balam-modal {
    background: #fff;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 18px;
    padding: 25px 30px 35px 25px;
    width: 420px;
    max-width: 92%;
    
    animation: balamModalZoomIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    position: relative;
}

.balam-modal-close {
    position: absolute;
    top: calc(20px + env(safe-area-inset-top));
    right: 20px;
    width: 32px;
    height: 32px;
    background: #dfdfdf;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 100;
}

.balam-modal-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

/* Imagen clickable */
.balam-zoomable {
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.balam-zoomable:hover {
    transform: scale(1.05);
}

/* MODAL */
.balam-image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(0,0,0,.35);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.balam-image-modal img {
    max-width: 50%;
    max-height: 50%;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    
}

/* BOTÓN CERRAR */
.balam-image-close {
  display: none;
  position: absolute;
  font-size: 100px;
  color: #fff;
  cursor: pointer;
}

/* ============================
   GALERIA EMBARQUES
============================ */
.balam-gallery-modal {
    max-width: 980px;
    width: 95%;
}

.balam-gallery-layout {
    display: grid;
    grid-template-columns: 0.6fr 0.8fr;
    gap: 20px;
}

.balam-gallery-title {
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 10px;
    color: #333;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.balam-gallery-guide {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
}

.balam-gallery-proof-wrap {
    position: relative;
    display: inline-block;
}

.balam-proof-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}

.balam-gallery-proof {
    width: 100%;
    max-width: 420px;
    max-height: 520px;
    object-fit: contain;
    border-radius: 12px;
    border: 2px solid #333;
    background: #dfdfdf;
    padding: 0px;
}

.balam-gallery-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.balam-gallery-photos {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.balam-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.balam-photo-thumb {
    border: 2px solid #333;
    border-radius: 10px;
    overflow: hidden;
    background: #dfdfdf;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
}

.balam-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.balam-photo-thumb img:hover {
    transform: scale(1.05);
}

.balam-photo-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 4px;
}

.balam-photo-action {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 0;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    
}

.balam-gallery-zoom {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #333;
    border-radius: 12px;
    background: #dfdfdf;
    padding: 8px;
    min-height: 220px;
}

.balam-gallery-zoom img {
    max-width: 100%;
    max-height: 520px;
    object-fit: contain;
}

.balam-gallery-upload {
    display: flex;
    justify-content: center;
}

.balam-gallery-footer {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}



/* ============================
   CALENDARIO
============================ */
.balam-calendar-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.balam-calendar-head {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
}

.balam-calendar-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.balam-calendar-month-select,
.balam-calendar-seller-select {
    width: 240px;
    max-width: 100%;
    height: 42px;
    line-height: 1.2;
    padding: 0 42px 0 18px;
}

.balam-calendar-seller-select {
    width: 260px;
}

.balam-calendar-clear {
    margin-left: auto;
    white-space: nowrap;
}

.balam-calendar-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.balam-calendar-filter {
    border: 1px solid transparent;
    cursor: pointer;
    transition: opacity .2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.balam-calendar-filter:not(.is-active) {
    opacity: .35;
}

.balam-calendar-filter-icon,
.balam-calendar-event-group-icon,
.balam-calendar-event-icon {
    display: inline-flex;
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.balam-calendar-filter-icon svg,
.balam-calendar-event-group-icon svg,
.balam-calendar-event-icon svg {
    width: 14px;
    height: 14px;
    display: block;
}

.balam-calendar-grid-wrap {
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.balam-calendar-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.balam-calendar-col-workday {
    width: 15.38%;
}

.balam-calendar-col-sunday {
    width: 7.72%;
}

.balam-calendar-grid th {
    background: #333;
    color: #fff;
    padding: 10px 6px;
    text-align: center;
    font-size: 12px;
}

.balam-calendar-grid td {
    vertical-align: top;
    border: 1px solid #efefef;
    height: 126px;
    padding: 6px;
}

.balam-calendar-grid td.is-muted {
    background: #fafafa;
}

.balam-calendar-day-num {
    font-size: 22px;
    color: #777;
    margin-bottom: 6px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
}

.balam-calendar-today-star {
    color: inherit;
    font-size: 15px;
    line-height: 1;
}

.balam-calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.balam-calendar-event-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.balam-calendar-event-group-toggle {
    border: 0;
    border-radius: 999px;
    min-height: 26px;
    padding: 5px 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    cursor: pointer;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 11px;
    font-weight: 800;
    text-align: left;
}

.balam-calendar-event-group-toggle > span:nth-child(2) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.balam-calendar-event-group-arrow {
    margin-left: auto;
    flex: 0 0 auto;
    font-size: 12px;
    line-height: 1;
    transition: transform .18s ease;
}

.balam-calendar-event-group.is-open .balam-calendar-event-group-arrow {
    transform: rotate(180deg);
}

.balam-calendar-event-group-panel {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transform: translateY(-4px);
    transition: grid-template-rows .22s ease, opacity .18s ease, transform .22s ease;
    padding-left: 4px;
    overflow: hidden;
}

.balam-calendar-event-group.is-open .balam-calendar-event-group-panel {
    grid-template-rows: 1fr;
    opacity: 1;
    transform: translateY(0);
}

.balam-calendar-event-panel-inner {
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.balam-calendar-event {
    border: 0;
    border-radius: 999px;
    text-align: left;
    background: #f2f2f2;
    color: #333;
    font-size: 11px;
    font-weight: 800;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    padding: 5px 8px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    opacity: 0;
    transform: translateY(-6px) scale(.98);
    transition:
        opacity .31s ease,
        transform .41s cubic-bezier(.2, .85, .25, 1.15),
        filter .31s ease;
}

.balam-calendar-event-group.is-open .balam-calendar-event {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: var(--balam-domino-delay, 0ms);
}

.balam-calendar-event.calendar-quote,
.balam-calendar-event-group.calendar-quote .balam-calendar-event-group-toggle {
    background: #fff7dc;
    color: #9a6a00;
}

.balam-calendar-event.calendar-preinvoice,
.balam-calendar-event-group.calendar-preinvoice .balam-calendar-event-group-toggle {
    background: #ebf4ff;
    color: #1759b8;
}

.balam-calendar-event.calendar-shipment,
.balam-calendar-event-group.calendar-shipment .balam-calendar-event-group-toggle {
    background: #fff0e8;
    color: #ba4e12;
}

.balam-calendar-event.calendar-delivered,
.balam-calendar-event-group.calendar-delivered .balam-calendar-event-group-toggle {
    background: #e9f9ec;
    color: #237c35;
}

.balam-badge.balam-calendar-filter.calendar-quote {
    background: #fff7dc;
    color: #9a6a00;
}

.balam-badge.balam-calendar-filter.calendar-preinvoice {
    background: #ebf4ff;
    color: #1759b8;
}

.balam-badge.balam-calendar-filter.calendar-shipment {
    background: #fff0e8;
    color: #ba4e12;
}

.balam-badge.balam-calendar-filter.calendar-delivered {
    background: #e9f9ec;
    color: #237c35;
}

.balam-calendar-modal {
    width: 460px;
    max-width: 94%;
}

.balam-calendar-modal-body p {
    margin: 0 0 7px;
    font-size: 13px;
}


/* ============================
   PUBLICIDAD
============================ */
.balam-publicity-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.balam-publicity-topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
    margin-bottom:12px;
}

.balam-publicity-card {
    border: 1px solid #dfdfdf;
    border-radius: 14px;
    padding: 14px;
    background: #fff;
}

.balam-publicity-card-body {
    display: none;
    padding-top: 6px;
}

.balam-publicity-card.is-open .balam-publicity-card-body {
    display: block;
}

.balam-publicity-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.balam-publicity-card.is-open .balam-publicity-head {
    margin-bottom: 12px;
}

.balam-publicity-accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex: 1 1 auto;
    min-width: 260px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.balam-publicity-accordion-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #f1f1f1;
    color: #3b3b3b;
    font-size: 20px;
    line-height: 1;
    transition: transform .2s ease, background .2s ease;
    flex: 0 0 auto;
}

.balam-publicity-card.is-open .balam-publicity-accordion-icon {
    transform: rotate(180deg);
    background: #e8f6df;
}

.balam-publicity-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.balam-publicity-toggle-label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

.balam-publicity-head-actions{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
    justify-content:flex-end;
    flex: 0 0 auto;
}

.balam-publicity-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #dedede;
}

.balam-publicity-title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
}

.balam-publicity-meta {
    font-size: 12px;
    color: #666;
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.balam-publicity-sections {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.balam-publicity-section {
    border: 1px solid #efefef;
    border-radius: 12px;
    padding: 10px;
    background: #fafafa;
}

.balam-publicity-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.balam-publicity-empty {
    font-size: 12px;
    color: #888;
}

.balam-publicity-assets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}

.balam-publicity-section--photo .balam-publicity-assets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.balam-publicity-section--photo {
    grid-column: span 2;
}

.balam-publicity-section--video_reel {
    grid-column: 1 / -1;
}

.balam-publicity-asset-item {
    position: relative;
    width: 100%;
    max-width: 110px;
}

.balam-publicity-asset-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #dfdfdf;
    background: #fff;
    display: block;
}

.balam-publicity-ies-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: linear-gradient(180deg, #f5f8ff 0%, #e7eefb 100%);
    color: #2f4a7f;
}

.balam-publicity-ies-icon {
    font-size: 22px;
    line-height: 1;
}

.balam-publicity-ies-text {
    font-size: 12px;
    font-weight: 700;
}

.balam-publicity-asset-download {
    display: block;
    text-decoration: none;
}

.balam-publicity-asset-name {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.2;
    color: #333;
    word-break: break-word;
    max-width: 80px;
}

.balam-publicity-product-modal{
    width:760px;
    max-width:96%;
}

.balam-publicity-product-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
}

.balam-publicity-col-name{grid-column:span 3;}
.balam-publicity-col-type{grid-column:span 1;}
.balam-publicity-col-visible{grid-column:1 / -1;}

.balam-publicity-product-grid label > div{
    font-size:12px;
    color:#666;
    margin-bottom:4px;
    font-weight:700;
}

.balam-publicity-product-grid label{
    display:block;
    width:100%;
}

.balam-publicity-product-grid .balam-input-lg{
    width:100%;
    max-width:none;
    box-sizing:border-box;
}

.balam-publicity-modal-assets{
    grid-column:1 / -1;
    border:1px solid #e8e8e8;
    border-radius:12px;
    background:#fafafa;
    padding:10px;
}

.balam-publicity-modal-assets-head{
    font-size:13px;
    color:#666;
    font-weight:700;
    margin-bottom:8px;
}

.balam-publicity-modal-assets-grid{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
}

.balam-publicity-modal-asset-row{
    border:1px solid #ececec;
    border-radius:10px;
    background:#fff;
    padding:8px;
    display:grid;
    grid-template-columns:minmax(220px,1fr) auto;
    align-items:start;
    column-gap:10px;
    row-gap:8px;
}

.balam-publicity-modal-asset-row > strong{
    min-width:0;
    padding-top:5px;
    grid-column:1 / -1;
    grid-row:1;
}

.balam-publicity-modal-actions{
    display:inherit;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
    align-self:center;
    grid-column:2;
    grid-row:2;
}

.balam-publicity-modal-count{
    font-size:12px;
    color:#666;
    min-width:88px;
    text-align:left;
}

.balam-publicity-modal-preview{
    grid-column:1;
    grid-row:2;
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-top:2px;
    min-height:56px;
    align-items:center;
}

.balam-publicity-modal-thumb{
    width:56px;
    height:56px;
    border-radius:8px;
    border:1px solid #dfdfdf;
    background:#f5f5f5;
    overflow:hidden;
    display:flex;
    align-items:center;
    justify-content:center;
    position:relative;
}

.balam-publicity-modal-thumb img,
.balam-publicity-modal-thumb video{
    width:100%;
    height:100%;
    object-fit:cover;
}

.balam-publicity-modal-thumb-file{
    font-size:10px;
    line-height:1.2;
    text-align:center;
    color:#555;
    padding:4px;
    word-break:break-word;
}

.balam-publicity-modal-remove{
    position:absolute;
    top:3px;
    right:3px;
    width:22px;
    height:22px;
    border-radius:50%;
    border:0;
    background:#333;
    color:#fff;
    font-size:14px;
    line-height:1;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    z-index:2;
}

.balam-publicity-modal-remove:hover{
    filter:brightness(1.1);
}

.balam-publicity-save-loader{
    margin-top:12px;
    border:1px solid #dfe4e9;
    border-radius:12px;
    background:#f8fafc;
    padding:10px 12px;
}

.balam-publicity-save-loader-inner{
    display:flex;
    align-items:center;
    gap:10px;
}

.balam-publicity-save-spinner{
    width:16px;
    height:16px;
    border-radius:50%;
    border:2px solid #d0d7de;
    border-top-color:#3e77d8;
    animation:balamSupplierSpin .8s linear infinite;
}

.balam-publicity-save-text{
    display:flex;
    align-items:baseline;
    gap:8px;
    font-size:12px;
    color:#333;
}

.balam-publicity-save-note{
    margin-top:6px;
    font-size:11px;
    color:#6b7280;
}



/* ============================
   LOADER GLOBAL FRONT
============================ */
.balam-loader-overlay{
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
}

.balam-loader-overlay.is-visible{
    display: flex;
}

.balam-loader {
  --hue: 100;
  --size: 200px;
  --border: 25px;
  --speed: 1.2s;
  --blur: var(--border);
}

.balam-loader {
  width: var(--border);
  aspect-ratio: 1;
  background: white;
  border-radius: 50%;
  position: relative;
  --y: calc((var(--size) * -0.5) + (var(--border) * 0.5));
  transform: rotate(0deg) translateY(var(--y));
  animation: balamLoaderSpin var(--speed) infinite linear;
}

.balam-loader::before {
  content: "";
  position: absolute;
  inset: calc(var(--border) * -0.5);
  border-radius: 50%;
  background: white;
  filter: blur(var(--blur));
  z-index: -1;
}

.balam-loader::after {
  content: "";
  width: var(--size);
  aspect-ratio: 1;
  position: absolute;
  top: 0%;
  left: 50%;
  translate: -50% 0;
  background: conic-gradient(
    white,
    hsl(var(--hue), 100%, 70%),
    hsl(var(--hue), 100%, 10%),
    transparent 65%
  );
  border-radius: 50%;
  mask: radial-gradient(
    transparent calc(((var(--size) * 0.5) - var(--border)) - 1px),
    white calc((var(--size) * 0.5) - var(--border))
  );
}

@keyframes balamLoaderSpin {
  to {
    transform: rotate(-360deg) translateY(var(--y));
  }
}

/* ============================
   SHIPMENT NOTIFICATIONS PANEL
============================ */
.balam-ship-notif-panel {
    position: fixed;
    right: 14px;
    bottom: 14px;
    width: min(300px, calc(100vw - 24px));
    max-height: 72vh;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    border: 1px solid #cfd6d2;
    border-radius: 15px;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
    
    overflow: hidden;
}

.balam-task-notif-panel {
    z-index: 9999;
    left: 14px;
    right: auto;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
}

.balam-ship-notif-list {
    padding: 8px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: 'DM Sans';
}

.balam-ship-notif-card {
    border: 1px solid #dbe2de;
    border-radius: 10px;
    background: #fff;
    padding: 8px 10px;
    
    transition: opacity .26s ease, transform .26s ease, filter .26s ease;
    will-change: opacity, transform, filter;
}

.balam-ship-notif-card--created {
    background: #e8f4ff;
}

.balam-ship-notif-card--delivered {
    background: #c5f5c5;
}

.balam-ship-notif-card--task {
    background: #f7f7f7;
}

.balam-ship-notif-card--leaving {
    opacity: 0;
    filter: blur(4px);
    transform: translateX(16px) scale(.98);
}

.balam-ship-notif-title {
    font-size: 12px;
    font-weight: 800;
    color: #333;
    margin-bottom: 6px;
}

.balam-ship-notif-msg {
    font-size: 12px;
    line-height: 1.35;
    color: #333;
    margin-bottom: 2px;
}

.balam-ship-notif-time {
    font-size: 10px;
    color: #6a6a6a;
    margin: 5px 0 7px;
}

.balam-ship-notif-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.balam-btn.balam-btn-notif-view {
    font-size: 9px;
}

.balam-btn.balam-btn-notif-read {
    font-size: 9px;
}


.balam-shipment-row-highlight {
    animation: balamShipmentRowPulse 1.2s ease-in-out 0s 3;
    background: #fff6d8 !important;
}

.balam-project-row-highlight {
    animation: balamProjectRowPulse 1.2s ease-in-out 0s 3;
    background: #c5f5c5 !important;
}

@keyframes balamProjectRowPulse {
    0% { background: #c5f5c5; }
    50% { background: #e8fce8; }
    100% { background: #c5f5c5; }
}

@keyframes balamShipmentRowPulse {
    0% { background: #ffefb8; }
    50% { background: #fff9e6; }
    100% { background: #fff6d8; }
}
.balam-inv-type-characteristics {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.balam-inv-type-label {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 5px 10px;
    border-radius: 999px;
    background: #e8f7e6;
    color: #2d8d21;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.balam-type-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 5px 10px;
    border-radius: 999px;
    background: #e8f7e6;
    color: #2d8d21;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.balam-inv-logistics {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
    line-height: 1.2;
    color: #333;
}

.balam-inv-logistics-row {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}

.balam-inv-logistics-label {
    color: #777;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.balam-inv-logistics-value {
    min-width: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.balam-inventory-edit-link {
    display: inline-flex;
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #2d8d21;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    text-decoration: underline;
    cursor: pointer;
}

/* ============================
   SYSTEM MAP
============================ */
.balam-system-map{
    display:flex;
    flex-direction:column;
    gap:22px;
}

.balam-system-map-toolbar{
    display:flex;
    justify-content:space-between;
    gap:18px;
    align-items:flex-end;
    border-bottom:2px solid #dfdfdf;
    padding-bottom:0;
}

.balam-system-view-tabs{
    display:flex;
    align-items:flex-end;
    gap:8px;
    flex-wrap:wrap;
}

.balam-system-view-tab{
    gap:8px;
    font-size:13px !important;
    font-weight:900 !important;
    padding-left:14px !important;
    min-height:35px;
}

.balam-system-view-num{
    width:24px;
    height:24px;
    border-radius:50%;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:#50b428;
    color:#fff;
    font-size:13px;
    font-weight:900;
    line-height:1;
    flex:0 0 auto;
}

.balam-system-search{
    min-width:260px;
    margin-bottom:8px;
}

.balam-system-search input{
    width:100%;
}

.balam-system-map-canvas{
    position:relative;
    display:grid;
    grid-template-columns:repeat(6, minmax(0, 1fr));
    grid-template-rows:repeat(5, minmax(84px, auto));
    gap:14px 14px;
    align-items:start;
    overflow:visible;
    padding:24px 0 20px;
    min-height:560px;
}

.balam-system-map-canvas[data-view="map"] .balam-system-node{
    width:100%;
    justify-self:start;
}

.balam-system-lines{
    position:absolute;
    inset:0;
    z-index:0;
    pointer-events:none;
    overflow:visible;
}

.balam-system-line{
    fill:none;
    stroke:#2f2f2f;
    stroke-width:2;
    stroke-linecap:square;
    stroke-linejoin:miter;
    opacity:.42;
}

.balam-system-line.is-active{
    stroke:#50b428;
    opacity:1;
    stroke-width:3;
}

.balam-system-node{
    position:relative;
    z-index:1;
    box-sizing:border-box;
    border:2px solid #dfdfdf;
    border-radius:8px;
    background:#fff;
    padding:10px;
    min-width:0;
    min-height:92px;
    transition:opacity .2s ease, border-color .2s ease, background .2s ease, transform .2s ease;
}

.balam-system-node::after{
    display:none;
}

.balam-system-node[data-module-id="virtual_warehouse"]{grid-column:1 / span 2;grid-row:1;}
.balam-system-node[data-module-id="publicity"]{grid-column:5 / span 1;grid-row:5;}
.balam-system-node[data-module-id="tasks"]{grid-column:6 / span 1;grid-row:5;}
.balam-system-node[data-module-id="inventory"]{grid-column:1 / span 1;grid-row:1;}
.balam-system-node[data-module-id="distributors"]{grid-column:2 / span 1;grid-row:1;}
.balam-system-node[data-module-id="purchase_orders"]{grid-column:3 / span 2;grid-row:1;}
.balam-system-node[data-module-id="suppliers"]{grid-column:6 / span 1;grid-row:1;}
.balam-system-node[data-module-id="clients"]{grid-column:2 / span 2;grid-row:2;}
.balam-system-node[data-module-id="quotes"]{grid-column:2 / span 2;grid-row:3;}
.balam-system-node[data-module-id="backorders"]{grid-column:2 / span 2;grid-row:4;}
.balam-system-node[data-module-id="projects"]{grid-column:2 / span 2;grid-row:5;}
.balam-system-node[data-module-id="warranties"]{grid-column:4 / span 2;grid-row:2;}
.balam-system-node[data-module-id="preinvoices"]{grid-column:4 / span 1;grid-row:3;}
.balam-system-node[data-module-id="shipments"]{grid-column:6 / span 1;grid-row:3;}
.balam-system-node[data-module-id="billing"]{grid-column:4 / span 1;grid-row:4;}
.balam-system-node[data-module-id="calendar"]{grid-column:6 / span 1;grid-row:4;}
.balam-system-node[data-module-id="reports"]{grid-column:4 / span 1;grid-row:5;}

.balam-system-map-canvas:not([data-view="map"]) .balam-system-node[data-module-id="virtual_warehouse"]{grid-column:1 / span 2;grid-row:1;}

.balam-system-map-canvas[data-view="detail"]{
    grid-template-columns:repeat(3, minmax(0, 1fr));
    grid-template-rows:auto;
    gap:16px;
    min-height:0;
    padding:24px 0 20px;
}

.balam-system-map-canvas[data-view="detail"] .balam-system-node{
    grid-column:auto !important;
    grid-row:auto !important;
    min-height:0;
}

.balam-system-map-canvas.is-searching{
    grid-template-columns:repeat(3, minmax(0, 1fr));
    grid-template-rows:auto;
    min-height:0;
}

.balam-system-map-canvas.is-searching .balam-system-node{
    grid-column:auto !important;
    grid-row:auto !important;
    min-height:0;
}

.balam-system-node-link{
    display:grid;
    grid-template-columns:22px minmax(0, 1fr);
    gap:8px 10px;
    align-items:center;
    color:#222;
    text-decoration:none;
}

.balam-system-node-link.is-disabled{
    cursor:not-allowed;
}

.balam-system-node-icon svg{
    width:22px;
    height:22px;
    display:block;
}

.balam-system-node-name{
    font-size:13px;
    font-weight:900;
    text-transform:uppercase;
    line-height:1.15;
    overflow-wrap:anywhere;
}

.balam-system-node-link .balam-badge{
    grid-column:2;
    justify-self:start;
}

.balam-system-node-link .balam-badge.status-leido{
    background:#c5f5c5;
    color:#44a620;
}

.balam-system-map-canvas[data-view="map"] .balam-system-node{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
}

.balam-system-map-canvas[data-view="map"] .balam-system-node-link{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:8px;
    width:100%;
}

.balam-system-map-canvas[data-view="map"] .balam-system-node-link .balam-badge{
    justify-self:center;
}

.balam-system-map-canvas[data-view="map"] .balam-system-node-summary{
    width:100%;
    text-align:center;
}

.balam-system-node-summary{
    margin:8px 0 0;
    font-size:11px;
    line-height:1.32;
    color:#555;
    overflow-wrap:anywhere;
}

.balam-system-node--proximo{
    border-color:#f3b3b3;
    background:#fff8f8;
}

.balam-system-node.is-highlighted{
    border-color:#51b327;
    background:#f7fff3;
}

.balam-system-node:hover{
    border-color:#50b428;
    background:#c5f5c5;
}

.balam-system-node.is-muted{
    opacity:.34;
}

.balam-system-node.is-hidden{
    display:none !important;
}

.balam-system-node-block{
    margin-top:12px;
}

.balam-system-node-block ul{
    margin:6px 0 0;
    padding-left:16px;
    font-size:12px;
    line-height:1.45;
    color:#444;
}

.balam-system-detail-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:0 12px;
}

.balam-system-role-badges{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    margin-top:12px;
}

.balam-system-role-badges span{
    display:inline-flex;
    align-items:center;
    min-height:20px;
    padding:0 9px;
    border-radius:999px;
    background:#f1f1f1;
    color:#777;
    font-size:10px;
    font-weight:900;
    line-height:1;
    text-transform:uppercase;
    white-space:nowrap;
}

@media (max-width: 1100px){
    .balam-system-map-canvas{
        grid-template-columns:repeat(2, minmax(180px, 1fr));
        grid-template-rows:auto;
        min-height:0;
        padding:20px 0;
    }
    .balam-system-node{
        grid-column:auto !important;
        grid-row:auto !important;
    }
}

@media (max-width: 760px){
    .balam-system-map-toolbar{
        flex-direction:column;
        align-items:stretch;
    }
    .balam-system-search{
        min-width:0;
    }
    .balam-system-map-canvas,
    .balam-system-detail-grid{
        grid-template-columns:1fr;
    }
    .balam-system-node::after{
        display:none;
    }
}

.balam-inventory-view-tabs {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    border-bottom: 2px solid #dfdfdf;
    margin: 0 0 24px;
    padding: 0 0 0 10px;
    overflow: visible;
}

.balam-inventory-view-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 35px;
    padding: 0 35px 0 20px;
    border: 0;
    border-radius: 8px 8px 0 0;
    background: #f7f7f7;
    color: #323232 !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 100%, 0 100%);
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.08);
}

.balam-inventory-view-tab::after {
    content: "";
    position: absolute;
    left: 0;
    right: -18px;
    bottom: -1px;
    height: 1px;
    background: #fff;
    opacity: 0;
}

.balam-inventory-view-tab span,
.balam-inventory-view-tab {
    white-space: nowrap;
}

.balam-inventory-view-tab {
    color: #fff;
}

.balam-inventory-view-tab.is-active {
    background: #c5f5c5;
    color: #44a620 !important;
    z-index: 2;
    box-shadow: 0 -1px 0 rgba(0,0,0,.04), 1px 0 0 rgba(0,0,0,.04), -1px 0 0 rgba(0,0,0,.04);
}

.balam-inventory-view-tab.is-active::after {
    opacity: 1;
}

.balam-front-product-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.balam-front-product-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.balam-front-product-dialog {
    position: relative;
    width: min(1040px, 92vw);
    height: min(680px, 84vh);
    overflow: hidden;
    padding: 34px;
    border: 2px solid #dfdfdf;
    border-radius: 30px;
    background: #fff;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.18);
    transform: translateY(18px) scale(0.985);
    transition: transform 0.22s ease;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.balam-front-product-modal.is-open .balam-front-product-dialog {
    transform: translateY(0) scale(1);
}

.balam-front-product-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: #f0f0f0;
    color: #111;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.balam-front-product-dialog h3 {
    margin: 0 0 24px;
    color: #111;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    text-transform: uppercase;
}

.balam-front-product-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    flex: 1;
}

.balam-front-product-tabs {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    border-bottom: 2px solid #dfdfdf;
    margin: -8px 0 6px;
}

.balam-front-product-tab {
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #777;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    padding: 0 0 12px;
    cursor: pointer;
}

.balam-front-product-tab.is-active {
    border-bottom-color: #111;
    color: #111;
}

.balam-front-product-panel {
    display: none;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    overflow: auto;
    padding-right: 6px;
}

.balam-front-product-panel.is-active {
    display: flex;
    flex: 1 1 auto;
}

.balam-front-product-grid {
    display: grid;
    gap: 14px;
}

.balam-front-product-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.balam-front-product-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.balam-front-product-grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.balam-front-product-grid.five {
    grid-template-columns: 0.75fr repeat(3, 1fr) 0.95fr;
}

.balam-front-product-grid.stock {
    grid-template-columns: 0.72fr 0.72fr 0.72fr 1.3fr 0.7fr;
    align-items: end;
}

.balam-front-product-grid.wms {
    grid-template-columns: 1.4fr 0.55fr 1fr;
    align-items: end;
}

.balam-front-product-span-1 {
    grid-column: span 1;
}

.balam-front-product-span-2 {
    grid-column: span 2;
}

.balam-front-product-supplier-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

#balamFrontPurchaseSupplierWrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
    align-items: flex-end;
    gap: 10px;
}

#balamFrontPurchaseSupplierWrap > span {
    grid-column: 1 / -1;
}

#balamFrontPurchaseSupplierWrap[hidden] {
    display: none !important;
}

#balamFrontPurchaseSupplierWrap select {
    flex: 1 1 240px;
}

#balamFrontPurchaseSupplierWrap .balam-front-product-supplier-badges {
    flex: 1 1 220px;
    margin-top: 0;
    align-items: center;
    min-height: 36px;
}

.balam-front-product-supplier-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    background: #bdf3bd;
    color: #2d7b23;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    padding: 8px 10px;
    text-transform: uppercase;
}

.balam-front-product-supplier-badge button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border: 0;
    border-radius: 999px;
    background: #76b874;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.balam-front-product-components,
.balam-parts-critical {
    border: 2px solid #e3e3e3;
    border-radius: 12px;
    padding: 14px;
    background: #fff;
}

.balam-front-product-physical {
    padding: 0;
    background: transparent;
}

.balam-front-product-physical-layout {
    display: grid;
    grid-template-columns: minmax(180px, 0.42fr) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.balam-front-product-components {
    display: none;
    min-height: 0;
    border: 0;
    padding: 0;
}

.balam-front-product-checkbox-row,
.balam-front-product-component-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

.balam-front-product-checkbox-row {
    flex-direction: column;
    align-items: flex-start;
}

.balam-front-product-form .balam-front-product-checkbox-row label {
    display: flex;
    flex-direction: row !important;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 2px 0;
    color: #25272b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.balam-front-product-form .balam-front-product-checkbox-row label span {
    color: #555;
    font-size: 11px;
    line-height: 1.1;
}

.balam-front-product-form .balam-front-product-checkbox-row input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    padding: 0 !important;
    margin: 0;
    accent-color: #333;
    flex: 0 0 16px;
}

.balam-front-product-component-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 74px auto;
    gap: 10px;
    align-items: end;
}

.balam-front-product-component-picker select {
    min-width: 0;
    max-width: none;
}

.balam-front-product-component-picker input {
    width: 74px;
    min-width: 74px;
}

.balam-front-product-component-picker .balam-btn {
    min-width: 92px;
    height: 36px !important;
}

.balam-composite-stock {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: help;
}

.balam-composite-stock-incomplete {
    color: #50b428;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}

.balam-composite-stock-tooltip {
    position: absolute;
    z-index: 20;
    left: 50%;
    bottom: calc(100% + 10px);
    width: 230px;
    transform: translateX(-50%);
    display: none;
    flex-direction: column;
    gap: 5px;
    border: 2px solid #dfdfdf;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(0,0,0,.14);
    padding: 12px;
    color: #333;
    font-size: 11px;
    font-weight: 700;
    text-align: left;
}

.balam-composite-stock:hover .balam-composite-stock-tooltip,
.balam-composite-stock:focus .balam-composite-stock-tooltip {
    display: flex;
}

.balam-composite-stock-tooltip strong,
.balam-composite-stock-tooltip em {
    font-style: normal;
    font-weight: 900;
}

.balam-parts-inventory {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.balam-parts-critical-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.balam-parts-critical-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 2px solid #ffb4b4;
    border-radius: 10px;
    background: #fff7f7;
    padding: 10px;
    font-size: 12px;
}

.balam-parts-critical-item em {
    color: #777;
    font-style: normal;
}

.balam-parts-table tr.is-critical td {
    background: #fff7f7;
}

.balam-parts-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.balam-front-product-form label,
.balam-front-product-image-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.balam-front-product-form label > span,
.balam-front-product-image-field > span,
.balam-front-product-section-label,
.balam-front-product-stock h4 {
    color: #777;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
}

.balam-front-product-form input,
.balam-front-product-form select,
.balam-front-product-form textarea {
    width: 100%;
    min-height: 36px;
    border: 2px solid #dfdfdf;
    border-radius: 999px;
    background: #fff;
    color: #25272b;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
    outline: none;
    padding: 0 14px;
    box-sizing: border-box;
}

.balam-front-product-form textarea {
    min-height: 76px;
    padding: 12px 16px;
    border-radius: 24px;
    line-height: 1.35;
    resize: vertical;
}

.balam-front-product-image-row {
    display: grid;
    grid-template-columns: minmax(0, 240px) 92px;
    gap: 12px;
    align-items: start;
}

.balam-front-product-image-row #balamInventoryImageButton {
    width: 100%;
    min-height: 36px;
}

.balam-front-product-image-preview {
    width: 92px;
    height: 92px;
    border: 2px solid #dfdfdf;
    border-radius: 14px;
    background: #fafafa;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c8c8c8;
}

.balam-front-product-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.balam-front-product-stock {
    padding-top: 8px;
}

.balam-front-product-stock h4 {
    margin: 0 0 12px;
    color: #111;
}

.balam-front-product-stock-note {
    margin-top: 8px;
    color: #777;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
}

.balam-front-product-batches {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.balam-front-product-wms {
    border-top: 2px solid #eeeeee;
    padding-top: 16px;
}

.balam-front-product-location-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.balam-front-product-location-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 9px 12px;
    border: 1px solid #e3e3e3;
    border-radius: 12px;
    background: #fafafa;
    color: #444;
    font-size: 11px;
    font-weight: 800;
}

.balam-front-product-location-row span,
.balam-front-product-location-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.balam-front-product-location-row em {
    font-style: normal;
    color: #50b428;
}

.balam-front-product-batches-title,
.balam-front-product-batches-empty,
.balam-front-product-batch-row {
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 11px;
    font-weight: 800;
}

.balam-front-product-batches-title {
    color: #111;
    text-transform: uppercase;
}

.balam-front-product-batches-empty {
    color: #999;
}

.balam-front-product-batch-row {
    display: grid;
    grid-template-columns: 0.75fr minmax(0, 1.4fr) repeat(3, 0.8fr);
    gap: 8px;
    align-items: center;
    padding: 9px 12px;
    border: 1px solid #e3e3e3;
    border-radius: 12px;
    color: #444;
    background: #fafafa;
}

.balam-front-product-batch-row span,
.balam-front-product-batch-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .balam-front-product-grid.stock,
    .balam-front-product-grid.wms,
    .balam-front-product-physical-layout,
    .balam-front-product-location-row,
    .balam-front-product-batch-row {
        grid-template-columns: 1fr;
    }

    #balamFrontPurchaseSupplierWrap {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    #balamFrontPurchaseSupplierWrap > span {
        grid-column: auto;
    }
}

.balam-front-product-checkbox {
    min-height: 36px;
    border: 2px solid #dfdfdf;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    flex-direction: row !important;
    gap: 8px !important;
    padding: 0 14px;
}

.balam-front-product-checkbox input {
    width: 16px;
    min-height: 16px;
    height: 16px;
    padding: 0;
    accent-color: #111;
}

.balam-front-product-feedback {
    min-height: 18px;
    color: #2d8d21;
    font-size: 12px;
    font-weight: 800;
}

.balam-front-product-feedback.is-error {
    color: #d32f2f;
}

.balam-front-product-actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    padding-top: 8px;
}
