/* =====================================================
   LAPROWORLD — GERENCIAL DASHBOARD
   CSS fresco, moderno, ejecutivo premium
   ===================================================== */

:root {
  --primary:   #2563eb;
  --primary-d: #1d4ed8;
  --emerald:   #10b981;
  --violet:    #8b5cf6;
  --amber:     #f59e0b;
  --rose:      #f43f5e;
  --cyan:      #06b6d4;
  --gray-50:   #f8fafc;
  --gray-100:  #f1f5f9;
  --gray-200:  #e2e8f0;
  --gray-300:  #cbd5e1;
  --gray-400:  #94a3b8;
  --gray-500:  #64748b;
  --gray-600:  #475569;
  --gray-700:  #334155;
  --gray-800:  #1e293b;
  --gray-900:  #0f172a;
  --sidebar-w: 240px;
  --header-h:  64px;
  --radius:    12px;
  --shadow:    0 4px 16px rgba(0,0,0,.08);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.06);
  --tr:        .2s ease;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{font-size:14px;scroll-behavior:smooth}
body{font-family:'Inter',system-ui,sans-serif;background:var(--gray-50);color:var(--gray-800);display:flex;min-height:100vh}
a{text-decoration:none;color:inherit}
button{cursor:pointer;border:none;background:none;font-family:inherit}
input,select,textarea{font-family:inherit}
::-webkit-scrollbar{width:5px}
::-webkit-scrollbar-thumb{background:var(--gray-300);border-radius:99px}

/* ── SIDEBAR ── */
.sidebar{
  width:var(--sidebar-w);min-height:100vh;background:var(--gray-900);
  display:flex;flex-direction:column;position:fixed;left:0;top:0;z-index:100;
  transition:width var(--tr);overflow:hidden;
}
.sidebar-brand{
  display:flex;align-items:center;gap:10px;padding:20px 18px;
  border-bottom:1px solid rgba(255,255,255,.07);
}
.brand-ico{
  width:36px;height:36px;border-radius:10px;
  background:transparent;
  display:flex;align-items:center;justify-content:center;
  color:#fff;font-size:16px;flex-shrink:0;
}
.brand-name{font-size:15px;font-weight:700;color:#fff;display:block}
.brand-sub{font-size:10px;color:var(--gray-500);display:block;margin-top:1px}
.brand-ico img{width:32px;height:32px;object-fit:contain;display:block;filter:none}

.nav-section{font-size:9.5px;font-weight:700;letter-spacing:1.2px;color:var(--gray-600);padding:14px 18px 4px;text-transform:uppercase}
.sidebar-nav{flex:1;padding:6px 10px;display:flex;flex-direction:column;gap:2px;overflow-y:auto}
.nav-link{
  display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:9px;
  color:var(--gray-400);font-size:12.5px;font-weight:500;transition:all var(--tr);cursor:pointer;
}
.nav-link:hover{background:rgba(255,255,255,.06);color:#fff}
.nav-link.active{
  background:linear-gradient(135deg,rgba(37,99,235,.3),rgba(37,99,235,.15));
  color:#fff;box-shadow:inset 3px 0 0 var(--primary);
}
.nav-link.active .nav-ico{color:#60a5fa}
.nav-ico{width:18px;text-align:center;font-size:13px;flex-shrink:0}
.nav-badge{
  margin-left:auto;font-size:10px;font-weight:700;padding:1px 7px;
  border-radius:99px;background:rgba(244,63,94,.2);color:var(--rose);
}
.nav-badge.blue{background:rgba(37,99,235,.2);color:#60a5fa}
.nav-badge.green{background:rgba(16,185,129,.2);color:var(--emerald)}

.sidebar-footer{padding:12px 10px;border-top:1px solid rgba(255,255,255,.07)}
.user-card{
  display:flex;align-items:center;gap:10px;padding:8px 10px;
  background:rgba(255,255,255,.04);border-radius:9px;cursor:pointer;
}
.user-avatar{
  width:32px;height:32px;border-radius:50%;
  background:transparent;
  color:#fff;font-size:11px;font-weight:700;
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
}
.user-name{font-size:12px;color:#e2e8f0;font-weight:600;display:block}
.user-role{font-size:10px;color:var(--gray-500);display:block}
.logout-btn{margin-left:auto;color:var(--gray-500);font-size:14px;padding:4px;border-radius:4px;transition:color var(--tr)}
.logout-btn:hover{color:var(--rose)}

/* ── MAIN ── */
.main{margin-left:var(--sidebar-w);flex:1;display:flex;flex-direction:column;min-height:100vh}

/* ── HEADER ── */
.header{
  height:var(--header-h);background:#fff;border-bottom:1px solid var(--gray-200);
  display:flex;align-items:center;gap:14px;padding:0 24px;
  position:sticky;top:0;z-index:90;box-shadow:var(--shadow-sm);
}
.header-left{display:flex;align-items:center;gap:10px;flex:1}
.breadcrumb{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--gray-400)}
.breadcrumb-current{color:var(--gray-700);font-weight:600}

.global-search{
  display:flex;align-items:center;gap:8px;
  background:var(--gray-50);border:1.5px solid var(--gray-200);border-radius:10px;
  padding:0 12px;width:340px;height:38px;transition:all var(--tr);
}
.global-search:focus-within{border-color:var(--primary);background:#fff;box-shadow:0 0 0 3px rgba(37,99,235,.1)}
.search-inp{flex:1;border:none;background:none;outline:none;font-size:12.5px;color:var(--gray-700)}

.header-right{display:flex;align-items:center;gap:8px}
.hdr-btn{
  width:36px;height:36px;border-radius:9px;color:var(--gray-500);font-size:15px;
  display:flex;align-items:center;justify-content:center;position:relative;transition:all var(--tr);
}
.hdr-btn:hover{background:var(--gray-100);color:var(--gray-800)}
.notif-dot{position:absolute;top:7px;right:7px;width:7px;height:7px;background:var(--rose);border:2px solid #fff;border-radius:50%}

.btn-new{
  display:flex;align-items:center;gap:7px;padding:8px 16px;border-radius:9px;
  background:linear-gradient(135deg,var(--primary),var(--primary-d));
  color:#fff;font-size:12.5px;font-weight:600;
  box-shadow:0 4px 12px rgba(37,99,235,.35);transition:all var(--tr);
}
.btn-new:hover{transform:translateY(-1px);box-shadow:0 6px 18px rgba(37,99,235,.45)}

.hdr-profile{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:9px;cursor:pointer;transition:all var(--tr)}
.hdr-profile:hover{background:var(--gray-100)}
.hdr-profile-name{font-size:12px;font-weight:600;display:block}
.hdr-profile-role{font-size:10px;color:var(--gray-400);display:block}

/* ── CONTENT ── */
.content{flex:1;padding:28px;overflow-y:auto}
.page{display:none}
.page.active{display:block}

.page-header{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:26px;gap:14px;flex-wrap:wrap}
.page-title{font-size:22px;font-weight:800;color:var(--gray-900);letter-spacing:-.4px}
.page-sub{font-size:12.5px;color:var(--gray-400);margin-top:3px}
.page-actions{display:flex;align-items:center;gap:8px}

/* ── BUTTONS ── */
.btn-primary{
  display:inline-flex;align-items:center;gap:7px;padding:9px 18px;border-radius:9px;
  background:linear-gradient(135deg,var(--primary),var(--primary-d));color:#fff;
  font-size:12.5px;font-weight:600;box-shadow:0 4px 12px rgba(37,99,235,.3);transition:all var(--tr);
}
.btn-primary:hover{transform:translateY(-1px)}
.btn-outline{
  display:inline-flex;align-items:center;gap:7px;padding:8px 14px;border-radius:9px;
  background:#fff;color:var(--gray-600);font-size:12px;font-weight:500;
  border:1.5px solid var(--gray-200);transition:all var(--tr);
}
.btn-outline:hover{border-color:var(--primary);color:var(--primary)}
.btn-sm{
  padding:6px 12px;border-radius:7px;font-size:11.5px;font-weight:500;
  background:#fff;color:var(--gray-600);border:1.5px solid var(--gray-200);transition:all var(--tr);
}
.btn-sm:hover{border-color:var(--gray-300);background:var(--gray-50)}
.btn-success{background:linear-gradient(135deg,var(--emerald),#059669);color:#fff;display:inline-flex;align-items:center;gap:7px;padding:9px 18px;border-radius:9px;font-size:12.5px;font-weight:600;transition:all var(--tr)}
.btn-danger{background:linear-gradient(135deg,var(--rose),#dc2626);color:#fff;display:inline-flex;align-items:center;gap:7px;padding:9px 18px;border-radius:9px;font-size:12.5px;font-weight:600;transition:all var(--tr)}

/* ── KPI CARDS ── */
.kpi-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:14px;margin-bottom:24px}
@media(max-width:1400px){.kpi-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:900px){.kpi-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:560px){.kpi-grid{grid-template-columns:1fr}}

.kpi-card{
  background:#fff;border-radius:var(--radius);padding:18px 20px;
  border:1.5px solid var(--gray-100);box-shadow:var(--shadow-sm);
  position:relative;overflow:hidden;transition:all var(--tr);cursor:pointer;
}
.kpi-card:hover{transform:translateY(-2px);box-shadow:var(--shadow)}
.kpi-card::before{content:'';position:absolute;top:0;left:0;right:0;height:3px}
.kpi-card.blue::before{background:linear-gradient(90deg,var(--primary),#60a5fa)}
.kpi-card.green::before{background:linear-gradient(90deg,var(--emerald),#34d399)}
.kpi-card.violet::before{background:linear-gradient(90deg,var(--violet),#a78bfa)}
.kpi-card.amber::before{background:linear-gradient(90deg,var(--amber),#fcd34d)}
.kpi-card.rose::before{background:linear-gradient(90deg,var(--rose),#fb7185)}
.kpi-card.cyan::before{background:linear-gradient(90deg,var(--cyan),#67e8f9)}

.kpi-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.kpi-ico{
  width:38px;height:38px;border-radius:9px;display:flex;align-items:center;justify-content:center;font-size:16px;
}
.kpi-ico.blue{background:#dbeafe;color:var(--primary)}
.kpi-ico.green{background:#d1fae5;color:var(--emerald)}
.kpi-ico.violet{background:#ede9fe;color:var(--violet)}
.kpi-ico.amber{background:#fef3c7;color:var(--amber)}
.kpi-ico.rose{background:#ffe4e6;color:var(--rose)}
.kpi-ico.cyan{background:#cffafe;color:var(--cyan)}

.kpi-trend{font-size:10.5px;font-weight:600;padding:2px 8px;border-radius:6px;display:flex;align-items:center;gap:3px}
.kpi-trend.up{background:#d1fae5;color:#059669}
.kpi-trend.down{background:#ffe4e6;color:#dc2626}
.kpi-trend.neutral{background:var(--gray-100);color:var(--gray-500)}

.kpi-value{font-size:26px;font-weight:800;color:var(--gray-900);letter-spacing:-.5px;margin-bottom:2px}
.kpi-label{font-size:11.5px;font-weight:600;color:var(--gray-500)}
.kpi-sub{font-size:10.5px;color:var(--gray-400);margin-top:3px}
.kpi-sparkline{margin-top:12px}
.kpi-sparkline canvas{width:100%!important}

/* ── CHARTS GRID ── */
.charts-row{display:grid;grid-template-columns:2fr 1fr;gap:16px;margin-bottom:20px}
.charts-row-3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px;margin-bottom:20px}
@media(max-width:1100px){.charts-row{grid-template-columns:1fr}.charts-row-3{grid-template-columns:1fr 1fr}}
@media(max-width:720px){.charts-row-3{grid-template-columns:1fr}}

.chart-card{
  background:#fff;border-radius:var(--radius);padding:20px;
  border:1.5px solid var(--gray-100);box-shadow:var(--shadow-sm);
}
.chart-title{font-size:13.5px;font-weight:700;color:var(--gray-800);margin-bottom:4px}
.chart-sub{font-size:11px;color:var(--gray-400);margin-bottom:14px}
.chart-header{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:14px}
.chart-legend{display:flex;align-items:center;gap:12px;font-size:11px;color:var(--gray-500)}
.leg-dot{width:9px;height:9px;border-radius:50%;display:inline-block;margin-right:4px}

/* Donut */
.donut-wrap{position:relative;display:flex;justify-content:center}
.donut-center{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;pointer-events:none}
.donut-total{font-size:28px;font-weight:800;color:var(--gray-900);display:block}
.donut-lbl{font-size:10.5px;color:var(--gray-400)}
.donut-legend{margin-top:14px;display:flex;flex-direction:column;gap:7px}
.dl-item{display:flex;align-items:center;gap:8px;font-size:11.5px}
.dl-dot{width:9px;height:9px;border-radius:2px;flex-shrink:0}
.dl-label{flex:1;color:var(--gray-600)}
.dl-val{font-weight:600;color:var(--gray-700)}

/* ── AI INSIGHTS ── */
.insights-row{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-bottom:20px}
@media(max-width:900px){.insights-row{grid-template-columns:1fr}}
.insight-card{
  border-radius:var(--radius);padding:16px;display:flex;align-items:flex-start;gap:12px;
  border:1.5px solid;
}
.insight-card.blue{background:linear-gradient(135deg,#f0f7ff,#fff);border-color:#bfdbfe}
.insight-card.green{background:linear-gradient(135deg,#f0fdf4,#fff);border-color:#bbf7d0}
.insight-card.amber{background:linear-gradient(135deg,#fffbeb,#fff);border-color:#fde68a}
.insight-ico{width:38px;height:38px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0}
.insight-ico.blue{background:var(--primary);color:#fff}
.insight-ico.green{background:var(--emerald);color:#fff}
.insight-ico.amber{background:var(--amber);color:#fff}
.insight-tag{font-size:9.5px;font-weight:700;letter-spacing:.8px;text-transform:uppercase;display:block;margin-bottom:4px}
.insight-tag.blue{color:var(--primary)}
.insight-tag.green{color:var(--emerald)}
.insight-tag.amber{color:#d97706}
.insight-text{font-size:12px;color:var(--gray-600);line-height:1.5}
.insight-text strong{color:var(--gray-900)}

/* ── EXEC RANKING ── */
.exec-list{display:flex;flex-direction:column;gap:12px}
.exec-item{display:flex;align-items:center;gap:10px}
.exec-rank{width:22px;height:22px;border-radius:50%;font-size:10px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0;background:var(--gray-100);color:var(--gray-400)}
.exec-rank.gold{background:#fef3c7;color:#d97706}
.exec-rank.silver{background:var(--gray-200);color:var(--gray-600)}
.exec-rank.bronze{background:#fde8d8;color:#c2410c}
.exec-avatar{width:30px;height:30px;border-radius:50%;background:linear-gradient(135deg,var(--primary-d),var(--primary));color:#fff;font-size:10px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.exec-info{flex:1;min-width:0}
.exec-name{font-size:12px;font-weight:600;color:var(--gray-700);display:block;margin-bottom:4px}
.exec-bar-wrap{height:5px;background:var(--gray-100);border-radius:99px;overflow:hidden}
.exec-bar{height:100%;border-radius:99px;transition:width .8s ease}
.exec-monto{font-size:11.5px;font-weight:700;color:var(--gray-800);white-space:nowrap}

/* ── TABLE CARD ── */
.table-card{
  background:#fff;border-radius:var(--radius);border:1.5px solid var(--gray-100);
  box-shadow:var(--shadow-sm);overflow:hidden;margin-bottom:20px;
}
.table-hdr{
  display:flex;align-items:center;justify-content:space-between;padding:18px 20px 14px;
  border-bottom:1px solid var(--gray-100);gap:12px;flex-wrap:wrap;
}
.table-hdr-left{}
.table-hdr-title{font-size:13.5px;font-weight:700;color:var(--gray-900)}
.table-hdr-sub{font-size:11px;color:var(--gray-400);margin-top:2px}
.table-hdr-right{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.tbl-search{
  display:flex;align-items:center;gap:7px;background:var(--gray-50);
  border:1.5px solid var(--gray-200);border-radius:8px;padding:6px 11px;transition:all var(--tr);
}
.tbl-search:focus-within{border-color:var(--primary);background:#fff}
.tbl-search i{color:var(--gray-400);font-size:11.5px}
.tbl-search input{background:none;border:none;outline:none;font-size:12px;color:var(--gray-700);width:160px}

.table-wrap{overflow-x:auto}
.data-table{width:100%;border-collapse:collapse}
.data-table thead tr{background:var(--gray-50)}
.data-table th{padding:10px 14px;text-align:left;font-size:10.5px;font-weight:700;color:var(--gray-500);text-transform:uppercase;letter-spacing:.5px;border-bottom:1px solid var(--gray-100);white-space:nowrap}
.data-table td{padding:11px 14px;font-size:12px;color:var(--gray-700);border-bottom:1px solid var(--gray-50);vertical-align:middle}
.data-table tbody tr:last-child td{border-bottom:none}
.data-table tbody tr:hover td{background:var(--gray-50)}

/* BADGES */
.badge{display:inline-flex;align-items:center;gap:4px;font-size:10.5px;font-weight:600;padding:2px 9px;border-radius:6px;white-space:nowrap}
.badge::before{content:'';width:5px;height:5px;border-radius:50%}
.badge-approved{background:#d1fae5;color:#065f46}.badge-approved::before{background:var(--emerald)}
.badge-pending{background:#fef3c7;color:#92400e}.badge-pending::before{background:var(--amber)}
.badge-rejected{background:#ffe4e6;color:#9f1239}.badge-rejected::before{background:var(--rose)}
.badge-pagado{background:#d1fae5;color:#065f46}.badge-pagado::before{background:var(--emerald)}
.badge-debe{background:#ffe4e6;color:#9f1239}.badge-debe::before{background:var(--rose)}
.badge-blue{background:#dbeafe;color:#1e40af}.badge-blue::before{background:var(--primary)}
.badge-gray{background:var(--gray-100);color:var(--gray-500)}.badge-gray::before{background:var(--gray-400)}

.cat-tag{font-size:10px;font-weight:600;padding:2px 8px;border-radius:5px;text-transform:uppercase;letter-spacing:.4px}
.cat-software{background:#ede9fe;color:#5b21b6}
.cat-hardware{background:#cffafe;color:#0e7490}

.action-btns{display:flex;gap:5px}
.act-btn{width:28px;height:28px;border-radius:7px;font-size:11.5px;display:flex;align-items:center;justify-content:center;transition:all var(--tr)}
.act-btn.view{background:#dbeafe;color:var(--primary)}
.act-btn.edit{background:#fef3c7;color:#d97706}
.act-btn.del{background:#ffe4e6;color:var(--rose)}
.act-btn.ok{background:#d1fae5;color:var(--emerald)}
.act-btn:hover{filter:brightness(.9);transform:scale(1.1)}

/* STATS STRIP */
.stats-strip{display:flex;gap:12px;margin-bottom:20px;flex-wrap:wrap}
.stat-chip{
  background:#fff;border:1.5px solid var(--gray-100);border-radius:10px;
  padding:14px 18px;display:flex;align-items:center;gap:10px;
  box-shadow:var(--shadow-sm);flex:1;min-width:130px;
}
.stat-chip i{font-size:18px}
.stat-chip span{font-size:11px;color:var(--gray-500);display:block}
.stat-chip b{font-size:20px;font-weight:800;color:var(--gray-900);margin-left:auto}

/* TABLE FOOTER */
.table-footer{display:flex;align-items:center;justify-content:space-between;padding:12px 20px;border-top:1px solid var(--gray-100);flex-wrap:wrap;gap:8px}
.table-info{font-size:11.5px;color:var(--gray-400)}
.table-info b{color:var(--gray-700)}
.pagination{display:flex;gap:3px}
.pg-btn{width:30px;height:30px;border-radius:7px;font-size:12px;font-weight:500;color:var(--gray-500);transition:all var(--tr)}
.pg-btn:hover{background:var(--gray-100);color:var(--gray-800)}
.pg-btn.active{background:var(--primary);color:#fff;font-weight:700}

/* MODAL */
.modal-overlay{position:fixed;inset:0;background:rgba(15,23,42,.6);z-index:200;display:none;align-items:center;justify-content:center;backdrop-filter:blur(4px)}
.modal-overlay.open{display:flex}
.modal-box{background:#fff;border-radius:16px;box-shadow:0 20px 40px rgba(0,0,0,.15);width:90%;max-width:500px;animation:slideUp .25s ease}
@keyframes slideUp{from{transform:translateY(30px);opacity:0}to{transform:translateY(0);opacity:1}}
.modal-hdr{display:flex;align-items:center;justify-content:space-between;padding:20px 24px;border-bottom:1.5px solid var(--gray-100);font-size:15px;font-weight:700;color:var(--gray-900)}
.modal-body{padding:20px 24px}
.modal-close{color:var(--gray-400);font-size:18px;padding:5px;border-radius:7px;transition:all var(--tr)}
.modal-close:hover{color:var(--rose);background:#ffe4e6}

/* QUICK ACTIONS */
.qa-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;padding:18px 24px}
.qa-btn{display:flex;flex-direction:column;align-items:center;gap:8px;padding:16px 10px;border-radius:10px;border:1.5px solid var(--gray-200);font-size:11.5px;font-weight:600;color:var(--gray-700);transition:all var(--tr)}
.qa-btn i{font-size:20px;color:var(--primary)}
.qa-btn:hover{border-color:var(--primary);background:#dbeafe;color:var(--primary);transform:translateY(-2px)}

/* NOTIFICATION PANEL */
.notif-panel{position:fixed;top:var(--header-h);right:14px;width:330px;background:#fff;border-radius:14px;box-shadow:0 12px 32px rgba(0,0,0,.12);border:1.5px solid var(--gray-200);z-index:150;display:none}
.notif-panel.open{display:block;animation:slideDown .2s ease}
@keyframes slideDown{from{transform:translateY(-10px);opacity:0}to{transform:translateY(0);opacity:1}}
.notif-hdr{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--gray-100);font-size:13px;font-weight:700;color:var(--gray-900)}
.notif-list{max-height:360px;overflow-y:auto}
.notif-item{display:flex;gap:10px;align-items:flex-start;padding:12px 16px;border-bottom:1px solid var(--gray-50);cursor:pointer;transition:background var(--tr)}
.notif-item:hover{background:var(--gray-50)}
.notif-item.unread{background:#f0f7ff}
.notif-ico{width:30px;height:30px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:12.5px;flex-shrink:0}
.notif-ico.warn{background:#fef3c7;color:#d97706}
.notif-ico.info{background:#dbeafe;color:var(--primary)}
.notif-ico.ok{background:#d1fae5;color:var(--emerald)}
.notif-ico.err{background:#ffe4e6;color:var(--rose)}
.notif-body p{font-size:12px;color:var(--gray-700);line-height:1.4}
.notif-body span{font-size:10.5px;color:var(--gray-400);margin-top:2px;display:block}

/* LOADING SKELETON */
.loading-overlay{display:flex;align-items:center;justify-content:center;min-height:300px}
.spinner{width:40px;height:40px;border:3px solid var(--gray-200);border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* EMPTY STATE */
.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 20px;color:var(--gray-400);text-align:center}
.empty-state i{font-size:48px;margin-bottom:16px;opacity:.3}
.empty-state h3{font-size:16px;font-weight:600;color:var(--gray-500);margin-bottom:6px}
.empty-state p{font-size:12.5px}

/* RESPONSIVE */
@media(max-width:768px){
  .sidebar{transform:translateX(-100%);transition:transform var(--tr)}
  .sidebar.open{transform:translateX(0)}
  .main{margin-left:0!important}
  .content{padding:16px}
  .header{padding:0 16px}
  .global-search{display:none}
  .hdr-profile-name,.hdr-profile-role{display:none}
  .kpi-grid{grid-template-columns:1fr 1fr}
  .btn-new span{display:none}
  .btn-new{padding:8px 10px}
}

.hidden{display:none!important}
input[type="checkbox"]{accent-color:var(--primary);width:14px;height:14px;cursor:pointer}

/* PERIOD SELECTOR */
.period-selector{display:flex;background:var(--gray-100);border-radius:8px;padding:3px}
.period-btn{padding:5px 12px;border-radius:6px;font-size:11.5px;font-weight:500;color:var(--gray-500);transition:all var(--tr)}
.period-btn.active{background:#fff;color:var(--primary);font-weight:600;box-shadow:var(--shadow-sm)}

/* DATETIME */
.hdr-date{font-size:10.5px;color:var(--gray-400);display:block}
.hdr-time{font-size:12.5px;font-weight:600;color:var(--gray-700);display:block}
.hdr-datetime{text-align:right;margin-right:4px}

/* RBAC + formularios corporativos */
.login-wall{position:fixed;inset:0;background:linear-gradient(135deg,#f8fafc,#eef6ff);z-index:9999;display:flex;align-items:center;justify-content:center;padding:20px}.login-card{width:100%;max-width:420px;background:#fff;border:1px solid #e5e7eb;border-radius:24px;box-shadow:0 24px 70px rgba(15,23,42,.14);padding:28px}.login-card h2{margin:0 0 8px;font-size:24px;color:#0f172a}.login-card p{margin:0 0 22px;color:#64748b;font-size:13px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.form-grid .full{grid-column:1/-1}.form-field label{display:block;font-size:11px;font-weight:700;color:#334155;margin-bottom:6px;text-transform:uppercase;letter-spacing:.04em}.form-field input,.form-field select,.form-field textarea{width:100%;border:1px solid #dbe3ef;border-radius:14px;padding:11px 12px;font:inherit;font-size:13px;outline:none;background:#fff}.form-field textarea{min-height:80px;resize:vertical}.form-field input:focus,.form-field select:focus,.form-field textarea:focus{border-color:#2563eb;box-shadow:0 0 0 4px rgba(37,99,235,.10)}.primary-btn{border:0;border-radius:14px;padding:12px 16px;background:#1d4ed8;color:#fff;font-weight:700;cursor:pointer;box-shadow:0 8px 20px rgba(37,99,235,.24)}.secondary-btn{border:1px solid #dbe3ef;border-radius:14px;padding:12px 16px;background:#fff;color:#334155;font-weight:700;cursor:pointer}.form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}.role-chip{font-size:10.5px;padding:3px 9px;border-radius:999px;background:#eff6ff;color:#1d4ed8;font-weight:700}.hidden-by-role{display:none!important}@media(max-width:700px){.form-grid{grid-template-columns:1fr}}


/* FIX PRODUCCIÓN: modal visible completo y cierre de sesión */
.modal-overlay{align-items:flex-start!important;justify-content:center!important;padding:24px 18px!important;overflow-y:auto!important;}
.modal-box{max-height:calc(100vh - 48px)!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;}
.modal-box-lg{width:min(96vw,980px)!important;max-width:980px!important;}
.modal-hdr{position:sticky;top:0;z-index:3;background:#fff;display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #e5e7eb;font-weight:800;color:#0f172a;}
.modal-close{width:34px;height:34px;border-radius:10px;display:flex;align-items:center;justify-content:center;color:#64748b;background:#f8fafc;border:1px solid #e5e7eb;cursor:pointer}.modal-close:hover{color:#dc2626;background:#fff1f2}
.entity-form{overflow-y:auto!important;padding:18px 20px 0!important;}
.form-section{border:1px solid #e8eef7;border-radius:18px;padding:16px;background:#fff;margin-bottom:16px;box-shadow:0 8px 22px rgba(15,23,42,.04)}
.section-title{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:800;color:#1e3a8a;text-transform:uppercase;letter-spacing:.06em;margin-bottom:14px}.section-title i{color:#2563eb}
.form-grid-2{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
.sticky-actions{position:sticky;bottom:0;background:linear-gradient(180deg,rgba(255,255,255,.86),#fff);padding:14px 0 18px;margin-top:0!important;border-top:1px solid #eef2f7;z-index:2}
.logout-btn{border:0;background:transparent;cursor:pointer}
@media(max-width:780px){.modal-overlay{padding:10px!important}.modal-box-lg{width:100%!important}.form-grid,.form-grid-2{grid-template-columns:1fr!important}.modal-box{max-height:calc(100vh - 20px)!important}.entity-form{padding:14px!important}}
.field-help{display:block;margin-top:7px;font-size:11.5px;color:#64748b;line-height:1.35}.form-field input[type=file]{padding:10px;background:#f8fafc;border-style:dashed}.form-field input[type=file]::file-selector-button{border:0;border-radius:10px;background:#1d4ed8;color:#fff;font-weight:700;padding:8px 11px;margin-right:10px;cursor:pointer}

.row-actions{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.mini-btn{border:0;border-radius:10px;padding:7px 10px;font-size:11px;font-weight:700;cursor:pointer;display:inline-flex;align-items:center;gap:5px;transition:.18s ease;white-space:nowrap}
.mini-btn.ok{background:#dcfce7;color:#166534}
.mini-btn.ok:hover{background:#bbf7d0}
.mini-btn.danger{background:#fee2e2;color:#991b1b}
.mini-btn.danger:hover{background:#fecaca}
.reject-note{display:block;color:#991b1b;font-weight:600;max-width:220px;white-space:normal;line-height:1.35}

/* Flujo de solicitudes de cotización */
.quote-observation{background:#f8fafc;border-radius:10px;padding:10px 12px;color:#334155;line-height:1.45;margin-bottom:10px}
.quote-files{display:flex;flex-direction:column;gap:8px}
.file-pill{display:flex;align-items:center;gap:9px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:8px 10px;color:#0f172a;max-width:100%}
.file-pill b{font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:260px}
.file-pill small{font-size:11px;color:#64748b;margin-right:auto}
.file-icon-btn{border:0;background:transparent;color:#0f172a;padding:5px 7px;border-radius:8px;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}
.file-icon-btn:hover{background:#e0e7ff;color:#1d4ed8}
.reject-box{margin-top:10px;background:#fff1f2;border:1px solid #fecdd3;color:#991b1b;border-radius:10px;padding:9px 10px;font-size:12px;line-height:1.4}
.ok-text{display:inline-block;color:#15803d;background:#dcfce7;border:1px solid #bbf7d0;border-radius:999px;padding:6px 10px;font-size:11.5px;font-weight:700}
.danger-text{display:inline-block;color:#b91c1c;background:#fee2e2;border:1px solid #fecaca;border-radius:999px;padding:6px 10px;font-size:11.5px;font-weight:700}
.modal-box-xl{max-width:1100px;width:92vw;max-height:92vh;overflow:auto}

/* Ajuste Cotizaciones: estructura ejecutiva sin columna Acción */
.quote-main-cell{vertical-align:middle}
.quote-observation-line{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:16px;align-items:center;margin-bottom:8px}
.quote-observation{margin-bottom:0}
.quote-status-cell{min-width:125px;vertical-align:middle;text-align:left}
.quote-status-wrap{display:flex;align-items:center;justify-content:flex-start}
.quote-actions-inline{display:flex;flex-direction:row;gap:14px;align-items:center;justify-content:flex-end;white-space:nowrap}
.quote-actions-inline .mini-btn{justify-content:center;min-width:78px;padding:8px 15px;border-radius:14px;font-size:11.5px}
.quote-files .file-pill{width:100%}
.quote-files .file-icon-btn:first-of-type{margin-left:auto}
@media (max-width:900px){.quote-observation-line{grid-template-columns:1fr}.quote-actions-inline{justify-content:flex-start;flex-wrap:wrap}.quote-main-cell{min-width:360px!important}}

/* Ajuste final cotizaciones: vista de usuario remitente */
.file-actions{display:flex;align-items:center;gap:8px;margin-left:auto}
.file-pill-compact{display:inline-flex;width:auto!important;max-width:100%;min-width:0;justify-content:flex-start}
.file-pill-compact b{max-width:360px}
.file-pill-compact small{margin-right:0}
.file-pill-compact .file-actions{margin-left:10px}
.quote-files{align-items:flex-start}
.quote-files .file-pill:not(.file-pill-compact){width:100%}
.quote-files .file-pill:not(.file-pill-compact) .file-actions{margin-left:auto}
@media (max-width:900px){.file-pill-compact{width:100%!important}.file-pill-compact .file-actions{margin-left:auto}}

/* FIX FINAL: adjuntos en usuarios con el mismo ancho que admin */
.quote-files{align-items:stretch!important;width:100%!important}
.quote-files .file-pill,
.quote-files .file-pill-compact{display:flex!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important;justify-content:flex-start!important}
.quote-files .file-pill b,
.quote-files .file-pill-compact b{max-width:none!important;min-width:0!important;flex:0 1 auto!important}
.quote-files .file-pill small,
.quote-files .file-pill-compact small{margin-right:auto!important;white-space:nowrap!important}
.quote-files .file-actions,
.quote-files .file-pill-compact .file-actions{margin-left:auto!important;display:flex!important;align-items:center!important;gap:10px!important}
.reject-box{width:100%!important;box-sizing:border-box!important}

/* RESPONSIVE GLOBAL FINAL — LAPROWORLD */
html,body{max-width:100%;overflow-x:hidden!important}
.main,.content,.page,.table-card,.chart-card,.kpi-card,.modal-box{min-width:0!important;max-width:100%!important}
.content{width:100%;overflow-x:hidden}.page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap}.page-header .primary-btn{white-space:nowrap}
.table-wrap{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:0 0 14px 14px}.data-table{min-width:860px;table-layout:auto}.data-table th,.data-table td{overflow-wrap:anywhere;word-break:normal}.tbl-search{max-width:100%;min-width:0}.tbl-search input{min-width:0;width:100%}
.action-btns,.row-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.quote-main-cell{min-width:0!important;width:auto!important;max-width:none!important}.quote-status-cell{width:128px;min-width:128px;text-align:left!important;vertical-align:middle!important}.quote-status-wrap{justify-content:flex-start!important;align-items:center!important;min-width:100px}.quote-observation-line{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:12px!important;align-items:center!important;width:100%!important}.quote-observation{min-width:0!important;overflow-wrap:anywhere!important;word-break:break-word!important}.quote-actions-inline{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:10px!important;flex-wrap:wrap!important;min-width:180px!important}.quote-actions-inline .mini-btn{min-width:88px!important;height:34px!important;padding:8px 12px!important;border-radius:12px!important}.quote-files{width:100%!important;align-items:stretch!important;min-width:0!important}.file-pill,.file-pill-compact{width:100%!important;max-width:100%!important;min-width:0!important;display:flex!important;align-items:center!important;box-sizing:border-box!important;overflow:hidden!important}.file-pill b,.file-pill-compact b{min-width:0!important;flex:1 1 auto!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;max-width:none!important}.file-pill small,.file-pill-compact small{flex:0 0 auto!important;white-space:nowrap!important;margin-right:8px!important}.file-actions{flex:0 0 auto!important;margin-left:auto!important;display:flex!important;gap:8px!important;align-items:center!important}.reject-box{max-width:100%!important;overflow-wrap:anywhere!important}
.modal-overlay{max-width:100vw!important;overflow-x:hidden!important}.modal-box,.modal-box-lg,.modal-box-xl{width:min(96vw,1100px)!important}.form-grid,.form-grid-2{min-width:0}
@media (max-width:1200px){.content{padding:18px!important}.kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.charts-grid,.report-grid{grid-template-columns:1fr!important}.data-table{min-width:780px}}
@media (max-width:900px){.header{padding:0 12px!important;gap:8px!important}.header-left{min-width:0!important;flex:1 1 auto!important}.header-right{gap:5px!important;flex-shrink:0!important}.breadcrumb{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.page-header{align-items:stretch!important}.page-header>div{min-width:0!important;flex:1 1 220px!important}.stats-strip{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}.table-hdr{align-items:stretch!important;gap:10px!important;flex-wrap:wrap!important}.table-hdr-title{width:100%}.table-hdr-right{width:100%!important}.tbl-search{width:100%!important}.quote-observation-line{grid-template-columns:1fr!important}.quote-actions-inline{justify-content:flex-start!important;min-width:0!important}.quote-status-cell{width:auto!important;min-width:110px!important}}
@media (max-width:700px){:root{--header-h:58px}body{display:block!important}.main{margin-left:0!important;width:100%!important}.content{padding:12px!important}.page-title{font-size:22px!important;line-height:1.15!important}.page-sub{font-size:12px!important}.kpi-grid{grid-template-columns:1fr!important;gap:10px!important}.stats-strip{grid-template-columns:1fr!important}.stat-chip{width:100%!important}.table-card{border-radius:16px!important;overflow:hidden!important}.table-wrap{overflow:visible!important}.data-table{min-width:0!important;width:100%!important;border-collapse:separate!important;border-spacing:0 10px!important;background:transparent!important}.data-table thead{display:none!important}.data-table tbody{display:block!important;width:100%!important}.data-table tr{display:block!important;background:#fff!important;border:1px solid #e2e8f0!important;border-radius:16px!important;margin:10px 0!important;box-shadow:0 8px 22px rgba(15,23,42,.05)!important;overflow:hidden!important}.data-table td{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:12px!important;width:100%!important;padding:11px 13px!important;border-bottom:1px solid #f1f5f9!important;text-align:right!important;max-width:none!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important}.data-table td:last-child{border-bottom:0!important}.data-table td::before{content:attr(data-label);flex:0 0 38%;max-width:38%;text-align:left!important;font-size:10.5px!important;font-weight:800!important;color:#64748b!important;text-transform:uppercase!important;letter-spacing:.04em!important;line-height:1.35!important}.data-table td>*{max-width:62%;margin-left:auto}.quote-main-cell{display:block!important;text-align:left!important}.quote-main-cell::before{display:block!important;max-width:100%!important;margin-bottom:8px!important}.quote-main-cell>*{max-width:100%!important;margin-left:0!important}.quote-status-cell{display:flex!important;align-items:center!important;justify-content:space-between!important;width:100%!important;min-width:0!important}.quote-status-wrap{max-width:62%;margin-left:auto!important;justify-content:flex-end!important}.quote-actions-inline{width:100%!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important}.quote-actions-inline .mini-btn{width:100%!important;min-width:0!important}.file-pill,.file-pill-compact{gap:7px!important;padding:8px!important}.file-pill b,.file-pill-compact b{white-space:normal!important;line-height:1.25!important}.file-pill small,.file-pill-compact small{display:none!important}.file-actions{gap:4px!important}.file-icon-btn{padding:6px!important;background:#f1f5f9!important}.table-footer{padding:12px!important}.notif-panel{left:10px!important;right:10px!important;width:auto!important}.modal-overlay{padding:8px!important}.modal-box,.modal-box-lg,.modal-box-xl{width:100%!important;max-height:calc(100vh - 16px)!important;border-radius:18px!important}.entity-form{padding:12px!important}.form-actions{flex-direction:column-reverse!important}.form-actions .primary-btn,.form-actions .secondary-btn{width:100%!important}}
@media (max-width:420px){.content{padding:10px!important}.hdr-btn{width:34px!important;height:34px!important}.primary-btn{padding:10px 12px!important;font-size:12px!important}.data-table td{gap:8px!important;padding:10px 11px!important}.data-table td::before{flex-basis:42%;max-width:42%}.data-table td>*{max-width:58%}.quote-status-wrap{max-width:58%}}

/* =========================================================
   FIX ORDENES DE COMPRA - Ocultar RUC y CATEGORIA
   + Distribución equilibrada de columnas
   Aplica para vista ADMIN y USUARIOS
   ========================================================= */
#page-ordenes .data-table th:nth-child(3),
#page-ordenes .data-table td:nth-child(3),
#page-ordenes .data-table th:nth-child(6),
#page-ordenes .data-table td:nth-child(6){
  display:none!important;
}

@media (min-width:701px){
  #page-ordenes .table-wrap{
    overflow-x:auto!important;
  }

  #page-ordenes .data-table{
    width:100%!important;
    table-layout:fixed!important;
  }

  #page-ordenes .data-table th,
  #page-ordenes .data-table td{
    vertical-align:middle!important;
  }

  #page-ordenes .data-table th:nth-child(1),
  #page-ordenes .data-table td:nth-child(1){
    width:84px!important;
    max-width:84px!important;
  }

  #page-ordenes .data-table th:nth-child(2),
  #page-ordenes .data-table td:nth-child(2){
    width:39%!important;
    max-width:39%!important;
  }

  #page-ordenes .data-table th:nth-child(4),
  #page-ordenes .data-table td:nth-child(4){
    width:24%!important;
    max-width:24%!important;
  }

  #page-ordenes .data-table th:nth-child(5),
  #page-ordenes .data-table td:nth-child(5){
    width:150px!important;
    max-width:150px!important;
  }

  #page-ordenes .data-table th:nth-child(7),
  #page-ordenes .data-table td:nth-child(7){
    width:110px!important;
    max-width:110px!important;
  }

  #page-ordenes .data-table th:nth-child(8),
  #page-ordenes .data-table td:nth-child(8){
    width:95px!important;
    max-width:95px!important;
  }

  #page-ordenes .data-table th:nth-child(9),
  #page-ordenes .data-table td:nth-child(9){
    width:84px!important;
    max-width:84px!important;
    text-align:center!important;
  }

  #page-ordenes .data-table td:nth-child(2),
  #page-ordenes .data-table td:nth-child(4){
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
  }
}

@media (min-width:1400px){
  #page-ordenes .data-table th:nth-child(2),
  #page-ordenes .data-table td:nth-child(2){
    width:41%!important;
    max-width:41%!important;
  }

  #page-ordenes .data-table th:nth-child(4),
  #page-ordenes .data-table td:nth-child(4){
    width:25%!important;
    max-width:25%!important;
  }
}


/* =========================================================
   FIX ORDENES DE COMPRA - Organización máximo 2 líneas FINAL
   Requiere app.js actualizado con clase order-org-name
   ========================================================= */
#page-ordenes .data-table td:nth-child(2){
  width:39%!important;
  max-width:39%!important;
  min-width:0!important;
  overflow:hidden!important;
  white-space:normal!important;
  line-height:1.25!important;
}

#page-ordenes .order-org-name{
  display:-webkit-box!important;
  -webkit-line-clamp:2!important;
  -webkit-box-orient:vertical!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:normal!important;
  line-height:1.25!important;
  max-height:2.5em!important;
  font-weight:700!important;
}

#page-ordenes .order-org-ruc{
  display:block!important;
  margin-top:3px!important;
  font-size:11px!important;
  color:#8aa0c2!important;
  line-height:1.1!important;
}


/* =========================================================
   FIX ORDENES DE COMPRA - Organización 2 líneas + botones en horizontal
   ========================================================= */
@media (min-width:701px){
  #page-ordenes .data-table{
    table-layout:fixed!important;
    width:100%!important;
  }

  /* Mantener ocultos RUC y CATEGORÍA */
  #page-ordenes .data-table th:nth-child(3),
  #page-ordenes .data-table td:nth-child(3),
  #page-ordenes .data-table th:nth-child(6),
  #page-ordenes .data-table td:nth-child(6){
    display:none!important;
  }

  #page-ordenes .data-table th:nth-child(1),
  #page-ordenes .data-table td:nth-child(1){
    width:82px!important;
    max-width:82px!important;
  }

  /* Organización más compacta para liberar espacio a Acciones */
  #page-ordenes .data-table th:nth-child(2),
  #page-ordenes .data-table td:nth-child(2){
    width:31%!important;
    max-width:31%!important;
    min-width:0!important;
    overflow:hidden!important;
  }

  #page-ordenes .data-table th:nth-child(4),
  #page-ordenes .data-table td:nth-child(4){
    width:29%!important;
    max-width:29%!important;
  }

  #page-ordenes .data-table th:nth-child(5),
  #page-ordenes .data-table td:nth-child(5){
    width:150px!important;
    max-width:150px!important;
  }

  #page-ordenes .data-table th:nth-child(7),
  #page-ordenes .data-table td:nth-child(7){
    width:112px!important;
    max-width:112px!important;
  }

  #page-ordenes .data-table th:nth-child(8),
  #page-ordenes .data-table td:nth-child(8){
    width:92px!important;
    max-width:92px!important;
  }

  /* Acciones con ancho suficiente */
  #page-ordenes .data-table th:nth-child(9),
  #page-ordenes .data-table td:nth-child(9){
    width:145px!important;
    max-width:145px!important;
    min-width:145px!important;
    text-align:center!important;
  }

  #page-ordenes .order-org-name{
    display:-webkit-box!important;
    -webkit-line-clamp:2!important;
    -webkit-box-orient:vertical!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:normal!important;
    line-height:1.22!important;
    max-height:2.44em!important;
    font-weight:700!important;
  }

  #page-ordenes .order-org-ruc{
    display:block!important;
    margin-top:3px!important;
    font-size:11px!important;
    color:#8aa0c2!important;
    line-height:1.1!important;
  }

  /* Botones Ver / Aprobar / Rechazar en una sola línea */
  #page-ordenes .action-btns{
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:center!important;
    gap:7px!important;
    flex-wrap:nowrap!important;
    width:100%!important;
    min-width:112px!important;
  }

  #page-ordenes .action-btns .act-btn{
    width:30px!important;
    height:30px!important;
    min-width:30px!important;
    min-height:30px!important;
    margin:0!important;
    flex:0 0 30px!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
  }
}


/* =========================================================
   FIX ORDENES DE COMPRA - Meta bajo Organización
   Cantidad + Categoría + Fecha/Hora generada
   ========================================================= */
#page-ordenes .order-org-name{
  display:-webkit-box!important;
  -webkit-line-clamp:2!important;
  -webkit-box-orient:vertical!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:normal!important;
  line-height:1.22!important;
  max-height:2.44em!important;
  font-weight:700!important;
}

#page-ordenes .order-org-meta{
  display:flex!important;
  align-items:center!important;
  flex-wrap:wrap!important;
  gap:6px 10px!important;
  margin-top:5px!important;
  font-size:10.5px!important;
  line-height:1.2!important;
  color:#64748b!important;
}

#page-ordenes .order-org-meta span{
  display:inline-flex!important;
  align-items:center!important;
  white-space:nowrap!important;
  background:#f8fafc!important;
  border:1px solid #e2e8f0!important;
  border-radius:7px!important;
  padding:2px 6px!important;
  font-weight:600!important;
}

@media (min-width:701px){
  #page-ordenes .data-table th:nth-child(2),
  #page-ordenes .data-table td:nth-child(2){
    width:34%!important;
    max-width:34%!important;
    min-width:0!important;
    overflow:hidden!important;
  }

  #page-ordenes .data-table th:nth-child(4),
  #page-ordenes .data-table td:nth-child(4){
    width:27%!important;
    max-width:27%!important;
  }

  #page-ordenes .data-table th:nth-child(9),
  #page-ordenes .data-table td:nth-child(9){
    width:145px!important;
    max-width:145px!important;
    min-width:145px!important;
  }

  #page-ordenes .action-btns{
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:center!important;
    gap:7px!important;
    flex-wrap:nowrap!important;
    width:100%!important;
  }

  #page-ordenes .action-btns .act-btn{
    width:30px!important;
    height:30px!important;
    min-width:30px!important;
    min-height:30px!important;
    margin:0!important;
    flex:0 0 30px!important;
  }
}


/* =========================================================
   FIX ORDENES DE COMPRA - Meta como texto separado por |
   RUC | Cantidad | Categoría | Fecha/Hora generada
   ========================================================= */
#page-ordenes .order-org-meta{
  display:block!important;
  margin-top:5px!important;
  font-size:10.5px!important;
  line-height:1.35!important;
  color:#64748b!important;
  font-weight:600!important;
}

#page-ordenes .order-org-meta span{
  display:inline!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  padding:0!important;
  margin:0!important;
  white-space:normal!important;
  color:#64748b!important;
  font-weight:600!important;
}

#page-ordenes .order-org-meta span + span::before{
  content:" | ";
  color:#94a3b8!important;
  font-weight:700!important;
  padding:0 4px!important;
}

#page-ordenes .order-org-name{
  display:-webkit-box!important;
  -webkit-line-clamp:2!important;
  -webkit-box-orient:vertical!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:normal!important;
  line-height:1.22!important;
  max-height:2.44em!important;
  font-weight:700!important;
}


/* =========================================================
   MODAL VER ORDEN DE COMPRA - Detalles completos BD
   ========================================================= */
.order-detail-box{
  max-width:980px!important;
  width:min(980px,96vw)!important;
  max-height:92vh!important;
  overflow:hidden!important;
}

.order-detail-hdr{
  align-items:flex-end!important;
}

.order-detail-hdr h2{
  margin:0!important;
  font-size:24px!important;
  line-height:1.15!important;
  font-weight:800!important;
  color:#0f172a!important;
}

.order-detail-hdr p{
  margin:3px 0 0!important;
  font-size:13px!important;
  color:#64748b!important;
}

.order-detail-body{
  padding:22px 26px 10px!important;
  overflow:auto!important;
  max-height:calc(92vh - 82px)!important;
}

.order-detail-grid{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:18px 70px!important;
  padding-bottom:18px!important;
  border-bottom:1px solid #e2e8f0!important;
}

.order-detail-grid div span{
  display:block!important;
  font-size:13px!important;
  color:#475569!important;
  margin-bottom:4px!important;
}

.order-detail-grid div b{
  display:block!important;
  font-size:14px!important;
  line-height:1.35!important;
  color:#0f172a!important;
  font-weight:500!important;
  word-break:break-word!important;
}

.order-detail-section{
  padding:18px 0!important;
  border-bottom:1px solid #e2e8f0!important;
}

.order-detail-section h3{
  margin:0 0 12px!important;
  font-size:16px!important;
  font-weight:700!important;
  color:#0f172a!important;
}

.order-detail-section p{
  margin:0!important;
  font-size:14px!important;
  color:#0f172a!important;
}

.order-doc-section{
  margin-bottom:10px!important;
}

.order-doc-title{
  font-size:13px!important;
  font-weight:700!important;
  color:#334155!important;
  margin-bottom:6px!important;
}

.order-doc-list .file-pill{
  width:100%!important;
  max-width:100%!important;
}

@media (max-width:700px){
  .order-detail-grid{
    grid-template-columns:1fr!important;
    gap:14px!important;
  }
  .order-detail-body{
    padding:16px!important;
  }
  .order-detail-hdr h2{
    font-size:19px!important;
  }
}


/* =========================================================
   FORMULARIO GENERAR NUEVA ORDEN - SOFTWARE / HARDWARE
   ========================================================= */
.order-form-grid{
  gap:14px!important;
}

.order-type-box{
  display:none;
  align-items:center;
  gap:12px;
  padding:13px 14px;
  border-radius:14px;
  border:1px solid #dbeafe;
  background:#eff6ff;
  color:#1e3a8a;
  grid-column:1/-1;
}

.order-type-box.active{
  display:flex!important;
}

.order-type-box i{
  width:36px;
  height:36px;
  border-radius:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#2563eb;
  color:#fff;
  flex:0 0 36px;
}

.order-type-box b{
  display:block;
  font-size:13px;
  color:#0f172a;
  margin-bottom:2px;
}

.order-type-box span{
  display:block;
  font-size:12px;
  color:#475569;
}

.hardware-box{
  border-color:#fde68a;
  background:#fffbeb;
}

.hardware-box i{
  background:#f59e0b;
}

.software-only,
.hardware-only{
  transition:all .18s ease;
}

.order-docs-field{
  border-top:1px solid #e2e8f0;
  padding-top:14px;
  margin-top:4px;
}

.muted{
  color:#94a3b8;
  font-weight:500;
}

#orderCategory{
  font-weight:700;
  color:#0f172a;
}


/* =========================================================
   FORMULARIO ORDEN - UBIGEO desde BD
   ========================================================= */
#orderRegion,
#orderProvincia,
#orderDistrito{
  background:#fff!important;
  color:#0f172a!important;
  font-weight:600!important;
}

#orderProvincia:disabled,
#orderDistrito:disabled{
  background:#f1f5f9!important;
  color:#94a3b8!important;
  cursor:not-allowed!important;
}


/* =========================================================
   MODAL ORDEN - Mostrar solo campos con datos reales
   ========================================================= */
.order-detail-body:empty{
  padding:0!important;
}

.order-detail-grid:empty,
.order-detail-section:empty{
  display:none!important;
}

.order-doc-section:empty{
  display:none!important;
}


/* =========================================================
   MODAL ORDEN - Mostrar nombre del archivo adjunto
   ========================================================= */
.order-doc-list .file-pill{
  display:flex!important;
  align-items:center!important;
  gap:9px!important;
  width:100%!important;
  max-width:100%!important;
  min-height:44px!important;
  padding:10px 12px!important;
}

.order-doc-list .file-pill b{
  display:block!important;
  flex:1 1 auto!important;
  min-width:0!important;
  max-width:none!important;
  color:#0f172a!important;
  font-size:13px!important;
  font-weight:700!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}

.order-doc-list .file-pill small{
  flex:0 0 auto!important;
  margin-left:8px!important;
  margin-right:auto!important;
  color:#64748b!important;
}

.order-doc-list .file-actions{
  margin-left:auto!important;
  display:flex!important;
  gap:10px!important;
  align-items:center!important;
}


/* =========================================================
   ADMIN ORDENES - Botón y modal Adjuntar Documentos
   ========================================================= */
#page-ordenes .action-btns{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  flex-wrap:nowrap!important;
}

#page-ordenes .act-btn.attach{
  background:#eef4ff!important;
  border:1px solid #2563eb!important;
  color:#1d4ed8!important;
}

.order-doc-admin-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  padding:4px 0 14px;
  border-bottom:1px solid #e2e8f0;
  margin-bottom:14px;
}

.order-doc-admin-head h3{
  margin:0 0 4px;
  font-size:15px;
  font-weight:800;
  color:#0f172a;
}

.order-doc-admin-head p{
  margin:0;
  font-size:12px;
  color:#64748b;
}

.order-admin-docs-grid{
  gap:14px!important;
}

.software-doc-zone{
  background:#ecfdf5;
  border:1px solid #bbf7d0;
  border-radius:12px;
  padding:10px;
}

.hardware-doc-zone{
  background:#fffbeb;
  border:1px solid #fde68a;
  border-radius:12px;
  padding:10px;
}


/* =========================================================
   COTIZACIONES - Ajuste ancho columna Organización
   Nombres largos máximo 2 líneas
   ========================================================= */
@media (min-width:701px){
  #page-cotizaciones .data-table{
    table-layout:fixed!important;
    width:100%!important;
  }

  #page-cotizaciones .data-table th:nth-child(1),
  #page-cotizaciones .data-table td:nth-child(1){
    width:86px!important;
    max-width:86px!important;
  }

  #page-cotizaciones .data-table th:nth-child(2),
  #page-cotizaciones .data-table td:nth-child(2){
    width:300px!important;
    max-width:300px!important;
    min-width:300px!important;
  }

  #page-cotizaciones .data-table th:nth-child(3),
  #page-cotizaciones .data-table td:nth-child(3){
    width:120px!important;
    max-width:120px!important;
  }

  #page-cotizaciones .data-table th:nth-child(5),
  #page-cotizaciones .data-table td:nth-child(5){
    width:120px!important;
    max-width:120px!important;
  }

  #page-cotizaciones .quote-org-cell{
    font-size:12.5px!important;
    font-weight:700!important;
    vertical-align:middle!important;
    overflow:hidden!important;
    min-width:0!important;
  }

  #page-cotizaciones .quote-org-name{
    display:-webkit-box!important;
    -webkit-line-clamp:2!important;
    -webkit-box-orient:vertical!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:normal!important;
    line-height:1.22!important;
    max-height:2.44em!important;
    word-break:normal!important;
  }

  #page-cotizaciones .quote-org-direction{
    margin-top:5px!important;
    font-size:11px!important;
    font-weight:600!important;
    line-height:1.15!important;
  }

  #page-cotizaciones .quote-main-cell{
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
  }

  #page-cotizaciones .quote-observation-line,
  #page-cotizaciones .quote-files,
  #page-cotizaciones .reject-box{
    width:100%!important;
    max-width:100%!important;
  }
}

@media (min-width:1400px){
  #page-cotizaciones .data-table th:nth-child(2),
  #page-cotizaciones .data-table td:nth-child(2){
    width:330px!important;
    max-width:330px!important;
    min-width:330px!important;
  }
}

@media (max-width:700px){
  #page-cotizaciones .quote-org-name{
    white-space:normal!important;
    overflow:visible!important;
    max-height:none!important;
  }
}


/* =========================================================
   COTIZACIONES - N° de Cotización a la derecha de Estado
   Orden: Fecha | Organización | Remitente | Observaciones | Estado | N° Cotización
   ========================================================= */
@media (min-width:701px){
  #page-cotizaciones .data-table{
    table-layout:fixed!important;
    width:100%!important;
  }

  #page-cotizaciones .data-table th:nth-child(1),
  #page-cotizaciones .data-table td:nth-child(1){
    width:82px!important;
    max-width:82px!important;
  }

  #page-cotizaciones .data-table th:nth-child(2),
  #page-cotizaciones .data-table td:nth-child(2){
    width:290px!important;
    max-width:290px!important;
    min-width:290px!important;
  }

  #page-cotizaciones .data-table th:nth-child(3),
  #page-cotizaciones .data-table td:nth-child(3){
    width:120px!important;
    max-width:120px!important;
  }

  #page-cotizaciones .data-table th:nth-child(5),
  #page-cotizaciones .data-table td:nth-child(5){
    width:115px!important;
    max-width:115px!important;
  }

  #page-cotizaciones .data-table th:nth-child(6),
  #page-cotizaciones .data-table td:nth-child(6){
    width:145px!important;
    max-width:145px!important;
    min-width:145px!important;
  }

  #page-cotizaciones .quote-number-cell{
    font-size:12px!important;
    font-weight:800!important;
    color:#0f172a!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
    text-align:left!important;
  }

  #page-cotizaciones .quote-main-cell{
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
  }
}

@media (min-width:1400px){
  #page-cotizaciones .data-table th:nth-child(2),
  #page-cotizaciones .data-table td:nth-child(2){
    width:315px!important;
    max-width:315px!important;
    min-width:315px!important;
  }

  #page-cotizaciones .data-table th:nth-child(6),
  #page-cotizaciones .data-table td:nth-child(6){
    width:160px!important;
    max-width:160px!important;
    min-width:160px!important;
  }
}


/* =========================================================
   COTIZACIONES - Motivo de rechazo mismo ancho que adjunto
   + aceptación exige N° de Cotización
   ========================================================= */
#page-cotizaciones .quote-main-cell{
  min-width:0!important;
}

#page-cotizaciones .quote-files,
#page-cotizaciones .quote-files .file-pill,
#page-cotizaciones .quote-files .file-pill-compact,
#page-cotizaciones .reject-box{
  width:100%!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}

#page-cotizaciones .reject-box{
  display:block!important;
  margin-top:8px!important;
  padding:10px 12px!important;
  border-radius:10px!important;
  border:1px solid #fecaca!important;
  background:#fff1f2!important;
  color:#b91c1c!important;
  overflow-wrap:anywhere!important;
  word-break:break-word!important;
}

#page-cotizaciones .quote-observation-line{
  width:100%!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}


/* =========================================================
   ACTUALIZACIÓN AUTOMÁTICA - Toast de cambios en vivo
   ========================================================= */
.live-update-toast{
  position:fixed!important;
  right:22px!important;
  bottom:22px!important;
  z-index:99999!important;
  display:flex!important;
  align-items:center!important;
  gap:9px!important;
  padding:12px 15px!important;
  border-radius:14px!important;
  background:#0f172a!important;
  color:#fff!important;
  font-size:12.5px!important;
  font-weight:700!important;
  box-shadow:0 18px 45px rgba(15,23,42,.25)!important;
  opacity:0!important;
  transform:translateY(14px)!important;
  pointer-events:none!important;
  transition:all .22s ease!important;
}

.live-update-toast.show{
  opacity:1!important;
  transform:translateY(0)!important;
}

.live-update-toast i{
  color:#93c5fd!important;
}

@media (max-width:700px){
  .live-update-toast{
    left:12px!important;
    right:12px!important;
    bottom:14px!important;
    justify-content:center!important;
  }
}



/* =========================================================
   ESTADOS DE PAGO - Detalles + Pagar con comprobante
   ========================================================= */
.pay-org-name{
  font-weight:800!important;
  font-size:12.5px!important;
  color:#0f172a!important;
  line-height:1.25!important;
}

.pay-org-meta{
  margin-top:3px!important;
  font-size:10.5px!important;
  color:#64748b!important;
  font-weight:600!important;
  line-height:1.25!important;
}

.payment-actions{
  display:flex!important;
  align-items:center!important;
  gap:7px!important;
  flex-wrap:wrap!important;
}

.payment-register-head{
  padding:4px 0 14px!important;
  border-bottom:1px solid #e2e8f0!important;
  margin-bottom:14px!important;
}

.payment-register-head h3{
  margin:0 0 4px!important;
  font-size:16px!important;
  font-weight:800!important;
  color:#0f172a!important;
}

.payment-register-head p{
  margin:0!important;
  font-size:12px!important;
  color:#64748b!important;
}



/* =========================================================
   ESTADOS DE PAGO - Misma infraestructura de Ordenes
   Solo Ver Detalles + Pagar
   ========================================================= */
#page-pagos .data-table{
  table-layout:fixed!important;
  width:100%!important;
}

#page-pagos .data-table th:nth-child(1),
#page-pagos .data-table td:nth-child(1){
  width:82px!important;
  max-width:82px!important;
}

#page-pagos .data-table th:nth-child(2),
#page-pagos .data-table td:nth-child(2){
  width:38%!important;
  max-width:38%!important;
}

#page-pagos .data-table th:nth-child(3),
#page-pagos .data-table td:nth-child(3){
  width:24%!important;
  max-width:24%!important;
}

#page-pagos .data-table th:nth-child(4),
#page-pagos .data-table td:nth-child(4){
  width:145px!important;
  max-width:145px!important;
}

#page-pagos .data-table th:nth-child(5),
#page-pagos .data-table td:nth-child(5){
  width:110px!important;
  max-width:110px!important;
}

#page-pagos .data-table th:nth-child(6),
#page-pagos .data-table td:nth-child(6){
  width:180px!important;
  max-width:180px!important;
}

#page-pagos .data-table th:nth-child(7),
#page-pagos .data-table td:nth-child(7){
  width:120px!important;
  max-width:120px!important;
  text-align:center!important;
}

#page-pagos .payment-actions-only{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  flex-wrap:nowrap!important;
}

#page-pagos .payment-actions-only .act-btn{
  width:30px!important;
  height:30px!important;
  min-width:30px!important;
  min-height:30px!important;
  margin:0!important;
  flex:0 0 30px!important;
}

#page-pagos .payment-actions-only .badge{
  white-space:nowrap!important;
}

#page-pagos .order-org-name{
  display:-webkit-box!important;
  -webkit-line-clamp:2!important;
  -webkit-box-orient:vertical!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:normal!important;
  line-height:1.22!important;
  max-height:2.44em!important;
  font-weight:800!important;
  color:#0f172a!important;
}

#page-pagos .order-org-meta{
  display:block!important;
  margin-top:4px!important;
  font-size:10.5px!important;
  color:#64748b!important;
  font-weight:600!important;
  line-height:1.35!important;
}

#page-pagos .order-org-meta span{
  display:inline!important;
  background:transparent!important;
  border:0!important;
  padding:0!important;
  margin:0!important;
}

#page-pagos .order-org-meta span + span::before{
  content:" | ";
  color:#94a3b8!important;
  font-weight:700!important;
  padding:0 4px!important;
}



/* =========================================================
   FIX DEFINITIVO ESTADOS DE PAGO - Layout correcto
   ========================================================= */
@media (min-width:701px){
  #page-pagos .data-table{
    table-layout:fixed!important;
    width:100%!important;
  }

  #page-pagos .data-table th:nth-child(1),
  #page-pagos .data-table td:nth-child(1){
    width:82px!important;
    max-width:82px!important;
  }

  #page-pagos .data-table th:nth-child(2),
  #page-pagos .data-table td:nth-child(2){
    width:39%!important;
    max-width:39%!important;
    min-width:0!important;
  }

  #page-pagos .data-table th:nth-child(3),
  #page-pagos .data-table td:nth-child(3){
    width:23%!important;
    max-width:23%!important;
  }

  #page-pagos .data-table th:nth-child(4),
  #page-pagos .data-table td:nth-child(4){
    width:145px!important;
    max-width:145px!important;
  }

  #page-pagos .data-table th:nth-child(5),
  #page-pagos .data-table td:nth-child(5){
    width:105px!important;
    max-width:105px!important;
  }

  #page-pagos .data-table th:nth-child(6),
  #page-pagos .data-table td:nth-child(6){
    width:185px!important;
    max-width:185px!important;
  }

  #page-pagos .data-table th:nth-child(7),
  #page-pagos .data-table td:nth-child(7){
    width:105px!important;
    max-width:105px!important;
    text-align:center!important;
  }
}

#page-pagos .payment-date-cell{
  font-size:11px!important;
  color:#8aa0c2!important;
  line-height:1.15!important;
  white-space:normal!important;
}

#page-pagos .payment-org-cell{
  overflow:hidden!important;
  min-width:0!important;
  white-space:normal!important;
}

#page-pagos .payment-org-name{
  display:-webkit-box!important;
  -webkit-line-clamp:2!important;
  -webkit-box-orient:vertical!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:normal!important;
  line-height:1.22!important;
  max-height:2.44em!important;
  font-weight:800!important;
  color:#0f172a!important;
  word-break:normal!important;
}

#page-pagos .payment-org-meta{
  display:block!important;
  margin-top:5px!important;
  font-size:10.5px!important;
  color:#64748b!important;
  font-weight:600!important;
  line-height:1.35!important;
  white-space:normal!important;
}

#page-pagos .payment-org-meta span{
  display:inline!important;
}

#page-pagos .payment-org-meta span + span::before{
  content:" | ";
  color:#94a3b8!important;
  font-weight:700!important;
  padding:0 4px!important;
}

#page-pagos .payment-product-cell{
  font-size:12px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}

#page-pagos .payment-executive-cell{
  font-size:12px!important;
}

#page-pagos .payment-receipt-cell .file-pill,
#page-pagos .payment-receipt-cell .file-pill-compact{
  width:100%!important;
  max-width:100%!important;
}

#page-pagos .payment-actions-only{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  flex-wrap:nowrap!important;
}

#page-pagos .payment-actions-only .act-btn{
  width:30px!important;
  height:30px!important;
  min-width:30px!important;
  min-height:30px!important;
  margin:0!important;
  flex:0 0 30px!important;
}

#page-pagos .payment-actions-only .badge{
  white-space:nowrap!important;
}



/* =========================================================
   FIRMAS ELECTRÓNICAS - Flujo final sin Documento/Destinatario
   ========================================================= */
@media (min-width:701px){
  #page-firmas .data-table{table-layout:fixed!important;width:100%!important;}
  #page-firmas .data-table th:nth-child(1),#page-firmas .data-table td:nth-child(1){width:82px!important;max-width:82px!important;}
  #page-firmas .data-table th:nth-child(2),#page-firmas .data-table td:nth-child(2){width:32%!important;max-width:32%!important;min-width:0!important;}
  #page-firmas .data-table th:nth-child(3),#page-firmas .data-table td:nth-child(3){width:145px!important;max-width:145px!important;}
  #page-firmas .data-table th:nth-child(4),#page-firmas .data-table td:nth-child(4){width:110px!important;max-width:110px!important;}
  #page-firmas .data-table th:nth-child(5),#page-firmas .data-table td:nth-child(5){width:auto!important;min-width:0!important;}
  #page-firmas .data-table th:nth-child(6),#page-firmas .data-table td:nth-child(6){width:105px!important;max-width:105px!important;text-align:center!important;}
}
#page-firmas .signature-date-cell{font-size:11px!important;color:#8aa0c2!important;line-height:1.15!important;}
#page-firmas .signature-org-cell{overflow:hidden!important;min-width:0!important;}
#page-firmas .signature-org-name{display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:normal!important;line-height:1.22!important;max-height:2.44em!important;font-weight:800!important;color:#0f172a!important;}
#page-firmas .signature-org-meta{display:block!important;margin-top:5px!important;font-size:10.5px!important;color:#64748b!important;font-weight:600!important;line-height:1.35!important;}
#page-firmas .signature-org-meta span{display:inline!important;}
#page-firmas .signature-org-meta span + span::before{content:" | ";color:#94a3b8!important;font-weight:700!important;padding:0 4px!important;}
#page-firmas .signature-flow-block{padding:8px 10px!important;border:1px solid #dbeafe!important;background:#f8fbff!important;border-radius:12px!important;margin-bottom:7px!important;}
#page-firmas .signature-flow-block.signed{border-color:#bbf7d0!important;background:#f0fdf4!important;}
#page-firmas .signature-flow-title{font-size:11px!important;font-weight:800!important;color:#334155!important;margin-bottom:6px!important;}
#page-firmas .signature-flow-cell .file-pill,#page-firmas .signature-flow-cell .file-pill-compact{width:100%!important;max-width:100%!important;}
#page-firmas .signature-person-cell{font-size:12px!important;overflow:hidden!important;text-overflow:ellipsis!important;}
#page-firmas .signature-actions-only{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;gap:7px!important;flex-wrap:nowrap!important;}
#page-firmas .signature-actions-only .act-btn{width:30px!important;height:30px!important;min-width:30px!important;min-height:30px!important;margin:0!important;flex:0 0 30px!important;}
.signature-complete-head{padding:4px 0 14px!important;border-bottom:1px solid #e2e8f0!important;margin-bottom:14px!important;}
.signature-complete-head h3{margin:0 0 4px!important;font-size:16px!important;font-weight:800!important;color:#0f172a!important;}
.signature-complete-head p{margin:0!important;font-size:12px!important;color:#64748b!important;}
.signature-detail-hdr h2{margin:0!important;font-size:24px!important;line-height:1.15!important;font-weight:800!important;color:#0f172a!important;}
.signature-detail-hdr p{margin:3px 0 0!important;font-size:13px!important;color:#64748b!important;}


/* Firmas: modal nueva solicitud */
.signature-request-head{padding:2px 0 10px;border-bottom:1px solid #e2e8f0;margin-bottom:14px}
.signature-request-head h3{margin:0 0 4px;font-size:15px;font-weight:800;color:#0f172a}
.signature-request-head p{margin:0;font-size:12px;color:#64748b}



/* =========================================================
   LISTA DE PRECIO / COTIZADOR
   ========================================================= */
.price-shell .table-hdr{display:none!important;}
.price-host-table{display:table!important;width:100%!important;border-collapse:collapse!important;}
.price-host-table > tbody{display:table-row-group!important;width:100%!important;}
.price-host-table > tbody > tr{display:table-row!important;width:100%!important;}
.price-host-table > tbody > tr > td{
  display:table-cell!important;
  width:100%!important;
  border:0!important;
  padding:0!important;
}
.price-list-host{
  padding:0!important;
  background:transparent!important;
}
.price-module{
  padding:24px 28px!important;
  background:#f3f7fc!important;
  border-radius:18px!important;
}
.price-module-head{
  display:flex!important;
  align-items:flex-end!important;
  justify-content:space-between!important;
  gap:18px!important;
  margin-bottom:18px!important;
}
.price-module-head h2{
  font-size:24px!important;
  margin:0!important;
  font-weight:800!important;
  color:#0f172a!important;
}
.price-module-head p{
  margin:4px 0 0!important;
  color:#64748b!important;
  font-size:12px!important;
}
.price-tabs{
  display:flex!important;
  gap:8px!important;
  flex-wrap:wrap!important;
}
.price-tab.active{
  background:#2563eb!important;
  color:#fff!important;
}
.price-panel{display:none!important;}
.price-panel.active{display:block!important;}
.price-grid{
  display:grid!important;
  grid-template-columns:minmax(0,1.4fr) minmax(300px,.9fr)!important;
  gap:18px!important;
}
.price-card{
  background:#fff!important;
  border:1px solid #dbe3ef!important;
  border-radius:18px!important;
  padding:18px!important;
  box-shadow:0 8px 22px rgba(15,23,42,.05)!important;
}
.price-card h3{
  margin:0 0 14px!important;
  font-size:18px!important;
  font-weight:800!important;
  color:#0f172a!important;
}
.price-quote-row{
  display:grid!important;
  grid-template-columns:1.5fr .7fr .55fr auto!important;
  gap:10px!important;
  align-items:end!important;
  border:1px solid #d9e3f2!important;
  border-radius:14px!important;
  padding:12px!important;
  margin-bottom:10px!important;
}
.price-actions-row{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:12px!important;
  margin-top:10px!important;
}
.primary-btn.green{background:#16a34a!important;}
.danger-btn{
  background:#ef4444!important;
  color:#fff!important;
  border:0!important;
  border-radius:12px!important;
  padding:10px 13px!important;
  font-weight:700!important;
  cursor:pointer!important;
}
.price-table-wrap{
  width:100%!important;
  overflow:auto!important;
}
.price-table{
  width:100%!important;
  border-collapse:collapse!important;
}
.price-table,
.price-table thead,
.price-table tbody{display:table!important;width:100%!important;}
.price-table thead{display:table-header-group!important;}
.price-table tbody{display:table-row-group!important;}
.price-table tr{display:table-row!important;background:transparent!important;border:0!important;box-shadow:none!important;margin:0!important;}
.price-table th,
.price-table td{display:table-cell!important;width:auto!important;text-align:left!important;white-space:normal!important;}
.price-table td::before,
.price-table th::before{display:none!important;content:none!important;}
.price-table td>*{max-width:none!important;margin-left:0!important;}
.price-table th{
  background:#eaf1fb!important;
  color:#0f172a!important;
  font-size:12px!important;
  text-align:left!important;
  padding:10px!important;
}
.price-table td{
  border-bottom:1px solid #dbe3ef!important;
  padding:10px!important;
  font-size:12px!important;
  vertical-align:top!important;
}
.price-cat{
  display:inline-flex!important;
  padding:4px 10px!important;
  border-radius:999px!important;
  background:#eef2ff!important;
  color:#3730a3!important;
  font-weight:800!important;
  font-size:10px!important;
}
.price-sub{
  margin-top:4px!important;
  color:#64748b!important;
  font-size:11px!important;
}
.price-stat-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:14px!important;
  margin-bottom:16px!important;
}
.price-mini-card{
  background:#fff!important;
  border:1px solid #dbe3ef!important;
  border-radius:14px!important;
  padding:14px!important;
}
.price-mini-card span{
  display:block!important;
  color:#64748b!important;
  font-size:11px!important;
}
.price-mini-card b{
  display:block!important;
  font-size:22px!important;
  margin-top:3px!important;
  color:#0f172a!important;
}
.price-products-layout{
  display:grid!important;
  grid-template-columns:minmax(0,1.35fr) minmax(320px,.75fr)!important;
  gap:18px!important;
}
.price-filter-row{
  display:grid!important;
  grid-template-columns:180px 1fr 140px!important;
  gap:10px!important;
  margin-bottom:12px!important;
}
.link-btn{
  border:0!important;
  background:transparent!important;
  color:#2563eb!important;
  font-weight:700!important;
  cursor:pointer!important;
}
@media(max-width:900px){
  .price-grid,.price-products-layout,.price-stat-grid{grid-template-columns:1fr!important;}
  .price-quote-row{grid-template-columns:1fr!important;}
  .price-actions-row{grid-template-columns:1fr!important;}
  .price-filter-row{grid-template-columns:1fr!important;}
}


.price-card .price-table th:nth-child(1), .price-card .price-table td:nth-child(1){width:120px!important;}
.price-card .price-table th:nth-child(2), .price-card .price-table td:nth-child(2){width:160px!important;}
.price-card .price-table th:nth-child(4), .price-card .price-table td:nth-child(4){width:120px!important;}
.price-card .price-table th:nth-child(5), .price-card .price-table td:nth-child(5){width:150px!important;}
.price-products-layout .price-table th:nth-child(1), .price-products-layout .price-table td:nth-child(1){width:120px!important;}
.price-products-layout .price-table th:nth-child(3), .price-products-layout .price-table td:nth-child(3){width:120px!important;}
.price-products-layout .price-table th:nth-child(4), .price-products-layout .price-table td:nth-child(4){width:140px!important;}




/* =========================================================
   LISTA DE PRECIO - Corrección final de tablas y productos
   ========================================================= */
#page-leads .price-table-wrap{
  width:100%!important;
  overflow-x:auto!important;
}

#page-leads .price-table{
  width:100%!important;
  border-collapse:collapse!important;
  table-layout:fixed!important;
}

#page-leads .price-table thead{
  display:table-header-group!important;
}

#page-leads .price-table tbody{
  display:table-row-group!important;
}

#page-leads .price-table tr{
  display:table-row!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  margin:0!important;
}

#page-leads .price-table th,
#page-leads .price-table td{
  display:table-cell!important;
  width:auto!important;
  max-width:none!important;
  padding:10px 12px!important;
  border-bottom:1px solid #dbe3ef!important;
  text-align:left!important;
  vertical-align:middle!important;
  white-space:normal!important;
  word-break:normal!important;
  overflow-wrap:normal!important;
}

#page-leads .price-table td::before,
#page-leads .price-table th::before{
  display:none!important;
  content:none!important;
}

#page-leads .price-table td>*{
  max-width:none!important;
  margin-left:0!important;
}

#page-leads .price-quotes-table th:nth-child(1),
#page-leads .price-quotes-table td:nth-child(1){width:115px!important;}

#page-leads .price-quotes-table th:nth-child(2),
#page-leads .price-quotes-table td:nth-child(2){width:145px!important;}

#page-leads .price-quotes-table th:nth-child(3),
#page-leads .price-quotes-table td:nth-child(3){width:auto!important;min-width:260px!important;}

#page-leads .price-quotes-table th:nth-child(4),
#page-leads .price-quotes-table td:nth-child(4){width:120px!important;}

#page-leads .price-quotes-table th:nth-child(5),
#page-leads .price-quotes-table td:nth-child(5){width:160px!important;}

#page-leads .quote-client{
  white-space:normal!important;
  line-height:1.25!important;
  word-break:normal!important;
  overflow-wrap:break-word!important;
}

#page-leads .price-products-table th:nth-child(1),
#page-leads .price-products-table td:nth-child(1){width:115px!important;}

#page-leads .price-products-table th:nth-child(3),
#page-leads .price-products-table td:nth-child(3){width:110px!important;}

#page-leads .price-products-table th:nth-child(4),
#page-leads .price-products-table td:nth-child(4){width:140px!important;}

#page-leads .price-products-table th:nth-child(5),
#page-leads .price-products-table td:nth-child(5){width:130px!important;}

.price-product-actions{
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-end!important;
  gap:6px!important;
}

.danger-btn.small{
  padding:7px 12px!important;
  border-radius:10px!important;
  font-size:12px!important;
}

.price-product-form{
  grid-template-columns:1fr 1fr!important;
}

.price-product-form .full{
  grid-column:1 / -1!important;
}

.full-width-btn{
  width:100%!important;
}

@media(max-width:900px){
  .price-product-form{grid-template-columns:1fr!important;}
}



/* =========================================================
   ÚLTIMAS COTIZACIONES - Columnas solicitadas + detalle por cliente
   ========================================================= */
#page-leads .price-quotes-latest{
  table-layout:fixed!important;
  width:100%!important;
}

#page-leads .price-quotes-latest th:nth-child(1),
#page-leads .price-quotes-latest td:nth-child(1){
  width:auto!important;
  min-width:210px!important;
}

#page-leads .price-quotes-latest th:nth-child(2),
#page-leads .price-quotes-latest td:nth-child(2){
  width:130px!important;
}

#page-leads .price-quotes-latest th:nth-child(3),
#page-leads .price-quotes-latest td:nth-child(3){
  width:105px!important;
  text-align:right!important;
}

#page-leads .price-quotes-latest th:nth-child(4),
#page-leads .price-quotes-latest td:nth-child(4){
  width:135px!important;
}

#page-leads .quote-client-link{
  border:0!important;
  background:transparent!important;
  padding:0!important;
  margin:0!important;
  color:#1d4ed8!important;
  font-weight:800!important;
  text-align:left!important;
  cursor:pointer!important;
  white-space:normal!important;
  line-height:1.22!important;
}

#page-leads .quote-client-link:hover{
  text-decoration:underline!important;
}

.price-quote-detail-modal{
  max-width:980px!important;
}

.price-quote-detail-hdr h2{
  margin:0!important;
  font-size:22px!important;
  font-weight:800!important;
  color:#0f172a!important;
}

.price-quote-detail-hdr p{
  margin:3px 0 0!important;
  color:#64748b!important;
  font-size:12px!important;
}

.price-detail-card{
  background:#fff!important;
  border:1px solid #dbe3ef!important;
  border-radius:16px!important;
  padding:16px!important;
  margin:14px!important;
}

.price-detail-meta{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:12px!important;
  margin-bottom:14px!important;
}

.price-detail-meta span{
  display:block!important;
  font-size:11px!important;
  color:#64748b!important;
  font-weight:700!important;
}

.price-detail-meta b{
  display:block!important;
  font-size:12px!important;
  color:#0f172a!important;
  line-height:1.25!important;
}

.price-detail-table tfoot td{
  background:#eaf1fb!important;
}

.special-box{
  border:1px solid #dbe3ef!important;
  border-radius:14px!important;
  padding:14px!important;
}

.special-totals{
  margin-top:14px!important;
  padding:12px!important;
  border-radius:12px!important;
  background:#f8fafc!important;
  border:1px solid #e2e8f0!important;
}

.special-totals div{
  display:flex!important;
  justify-content:space-between!important;
  gap:10px!important;
  padding:4px 0!important;
  font-size:12px!important;
}

.special-totals b{
  color:#0f172a!important;
}

@media(max-width:800px){
  .price-detail-meta{
    grid-template-columns:1fr 1fr!important;
  }
}



/* =========================================================
   ÚLTIMAS COTIZACIONES - Ajuste final cliente/ancho/total
   ========================================================= */
#page-leads .price-grid{
  grid-template-columns:minmax(430px,.85fr) minmax(620px,1.15fr)!important;
  gap:18px!important;
}

#page-leads .price-quotes-latest{
  table-layout:auto!important;
  width:100%!important;
}

#page-leads .price-quotes-latest th:nth-child(1),
#page-leads .price-quotes-latest td:nth-child(1){
  width:42%!important;
  min-width:260px!important;
}

#page-leads .price-quotes-latest th:nth-child(2),
#page-leads .price-quotes-latest td:nth-child(2){
  width:18%!important;
  min-width:115px!important;
}

#page-leads .price-quotes-latest th:nth-child(3),
#page-leads .price-quotes-latest td:nth-child(3){
  width:17%!important;
  min-width:110px!important;
  text-align:right!important;
}

#page-leads .price-quotes-latest th:nth-child(4),
#page-leads .price-quotes-latest td:nth-child(4){
  width:23%!important;
  min-width:135px!important;
}

#page-leads .quote-client-link{
  font-weight:500!important;
  color:#1d4ed8!important;
  white-space:normal!important;
  word-break:normal!important;
  overflow-wrap:break-word!important;
  line-height:1.22!important;
}

#page-leads .quote-total{
  text-align:right!important;
  white-space:nowrap!important;
  font-weight:700!important;
}

@media(max-width:1250px){
  #page-leads .price-grid{
    grid-template-columns:1fr!important;
  }
}



/* Cálculo especial editable */
.special-box input:not([readonly]){
  background:#ffffff!important;
  border-color:#2563eb33!important;
}
.special-box input:not([readonly]):focus{
  border-color:#2563eb!important;
  box-shadow:0 0 0 3px rgba(37,99,235,.12)!important;
}



/* Resultado Precio 01 Año Calculado */
#specialUnitResult{
  color:#0f172a!important;
  font-size:14px!important;
  font-weight:900!important;
}
.special-totals div:first-child{
  background:#eef6ff!important;
  border-radius:10px!important;
  padding:8px 10px!important;
  margin-bottom:4px!important;
}



/* Cotizador: categorías permitidas y precio por rango/año */
.price-quote-row{
  grid-template-columns:1.45fr .7fr .55fr auto!important;
}
.price-quote-row .price-row-preview{
  grid-column:1 / -1!important;
  display:flex!important;
  gap:14px!important;
  flex-wrap:wrap!important;
  padding:8px 10px!important;
  background:#f8fafc!important;
  border:1px solid #e2e8f0!important;
  border-radius:10px!important;
  color:#475569!important;
  font-size:12px!important;
}
.price-quote-row .price-row-preview b{
  color:#0f172a!important;
}
.priceProduct optgroup{
  font-weight:800!important;
  color:#0f172a!important;
}
.priceProduct option{
  font-weight:400!important;
  color:#0f172a!important;
  padding-left:12px!important;
}



/* Acople de lógica precios.zip: grupo/año/rango/cantidad */
.price-row-preview .price-error{
  color:#dc2626!important;
  font-weight:800!important;
}
.price-row-preview .price-note{
  color:#2563eb!important;
  font-weight:700!important;
}
.priceProduct optgroup{
  font-weight:900!important;
  color:#0f172a!important;
}
.priceProduct option{
  font-weight:400!important;
  color:#0f172a!important;
}



/* Corrección: autoselección de año/rango en cotizador */
.price-row-preview .price-note{
  color:#2563eb!important;
  font-weight:800!important;
}
.price-row-preview .price-error{
  color:#dc2626!important;
  font-weight:800!important;
}



/* Ocultar caja de comentario/precio debajo del producto */
#page-leads .price-row-preview{
  display:none!important;
  visibility:hidden!important;
  height:0!important;
  min-height:0!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  overflow:hidden!important;
}



/* =========================================================
   CHAT INTERACTIVO TIPO MESSENGER
   ========================================================= */
.chat-fab{position:fixed!important;right:22px!important;bottom:22px!important;width:58px!important;height:58px!important;border-radius:50%!important;border:0!important;background:linear-gradient(135deg,#2563eb,#7c3aed)!important;color:#fff!important;box-shadow:0 18px 35px rgba(37,99,235,.35)!important;display:flex!important;align-items:center!important;justify-content:center!important;font-size:25px!important;cursor:pointer!important;z-index:9998!important}
.chat-badge{position:absolute!important;top:-4px!important;right:-4px!important;min-width:22px!important;height:22px!important;padding:0 6px!important;border-radius:999px!important;background:#ef4444!important;color:#fff!important;font-size:11px!important;font-weight:900!important;align-items:center!important;justify-content:center!important;border:2px solid #fff!important}
.chat-panel{position:fixed!important;right:92px!important;bottom:22px!important;width:360px!important;max-width:calc(100vw - 120px)!important;height:560px!important;max-height:calc(100vh - 44px)!important;background:#fff!important;border:1px solid #dbe3ef!important;border-radius:22px!important;box-shadow:0 24px 70px rgba(15,23,42,.28)!important;display:none!important;flex-direction:column!important;overflow:hidden!important;z-index:9999!important}
.chat-panel.open{display:flex!important}
.chat-panel-head{padding:16px 18px!important;background:linear-gradient(135deg,#2563eb,#7c3aed)!important;color:#fff!important;display:flex!important;align-items:center!important;justify-content:space-between!important}
.chat-panel-head h3{margin:0!important;font-size:16px!important;font-weight:900!important}
.chat-panel-head p{margin:2px 0 0!important;font-size:12px!important;opacity:.85!important}
.chat-close{width:34px!important;height:34px!important;border:0!important;border-radius:12px!important;background:rgba(255,255,255,.18)!important;color:#fff!important;cursor:pointer!important}
.chat-body{flex:1!important;min-height:0!important;display:grid!important;grid-template-columns:255px minmax(0,1fr)!important}
.chat-users{border-right:1px solid #e2e8f0!important;background:#f8fafc!important;min-width:0!important;display:flex!important;flex-direction:column!important}
.chat-search{margin:12px!important;height:38px!important;display:flex!important;align-items:center!important;gap:8px!important;padding:0 12px!important;border:1px solid #dbe3ef!important;border-radius:999px!important;background:#fff!important;color:#64748b!important}
.chat-search input{border:0!important;outline:0!important;background:transparent!important;width:100%!important;font-size:12px!important}
.chat-conversation-list{overflow:auto!important;padding:0 8px 10px!important}
.chat-user{width:100%!important;border:0!important;background:transparent!important;display:flex!important;gap:10px!important;align-items:center!important;padding:10px!important;border-radius:14px!important;cursor:pointer!important;text-align:left!important;color:#0f172a!important}
.chat-user:hover,.chat-user.active{background:#eaf1ff!important}
.chat-avatar{width:36px!important;height:36px!important;border-radius:50%!important;background:#2563eb!important;color:#fff!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;font-size:12px!important;font-weight:900!important;flex:0 0 36px!important}
.chat-user-main{min-width:0!important;flex:1!important}
.chat-user-main b{display:block!important;font-size:12.5px!important;line-height:1.2!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.chat-user-main small{display:block!important;margin-top:2px!important;font-size:11px!important;color:#64748b!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.chat-user-unread{min-width:20px!important;height:20px!important;padding:0 6px!important;border-radius:999px!important;background:#ef4444!important;color:#fff!important;font-size:11px!important;font-weight:900!important;display:inline-flex!important;align-items:center!important;justify-content:center!important}
.chat-room{display:flex!important;flex-direction:column!important;min-width:0!important;min-height:0!important;background:#fff!important}
.chat-room-head{height:62px!important;flex:0 0 62px!important;border-bottom:1px solid #e2e8f0!important;display:flex!important;align-items:center!important;gap:10px!important;padding:0 16px!important}
.chat-room-head b{display:block!important;font-size:13px!important;color:#0f172a!important}
.chat-room-head small{display:block!important;font-size:11px!important;color:#64748b!important;margin-top:2px!important}
.chat-empty-head{color:#64748b!important;font-size:13px!important}
.chat-messages{flex:1!important;min-height:0!important;overflow:auto!important;padding:16px!important;background:#f8fafc!important}
.chat-msg{display:flex!important;margin:8px 0!important}.chat-msg.mine{justify-content:flex-end!important}.chat-msg.theirs{justify-content:flex-start!important}
.chat-bubble{max-width:78%!important;padding:10px 12px!important;border-radius:18px!important;box-shadow:0 2px 8px rgba(15,23,42,.06)!important}
.chat-msg.mine .chat-bubble{background:#2563eb!important;color:#fff!important;border-bottom-right-radius:6px!important}
.chat-msg.theirs .chat-bubble{background:#fff!important;color:#0f172a!important;border:1px solid #e2e8f0!important;border-bottom-left-radius:6px!important}
.chat-bubble p{margin:0!important;font-size:13px!important;line-height:1.35!important;white-space:pre-wrap!important;word-break:break-word!important}
.chat-bubble span{display:block!important;margin-top:5px!important;font-size:10px!important;opacity:.7!important}
.chat-input-row{height:62px!important;flex:0 0 62px!important;display:flex!important;gap:10px!important;align-items:center!important;padding:10px 14px!important;border-top:1px solid #e2e8f0!important;background:#fff!important}
.chat-input-row input{flex:1!important;height:42px!important;border:1px solid #dbe3ef!important;border-radius:999px!important;padding:0 14px!important;outline:0!important}
.chat-input-row input:focus{border-color:#2563eb!important;box-shadow:0 0 0 3px rgba(37,99,235,.12)!important}
.chat-input-row button{width:42px!important;height:42px!important;border-radius:50%!important;border:0!important;background:#2563eb!important;color:#fff!important;cursor:pointer!important}
.chat-input-row button:disabled,.chat-input-row input:disabled{opacity:.55!important;cursor:not-allowed!important}
.chat-empty,.chat-list-empty{height:100%!important;min-height:160px!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:8px!important;color:#64748b!important;text-align:center!important;font-size:12px!important}
.chat-empty i{font-size:28px!important;color:#2563eb!important}.chat-empty b{color:#0f172a!important;font-size:14px!important}
@media(max-width:780px){.chat-panel{right:8px!important;left:auto!important;width:min(360px,calc(100vw - 16px))!important;max-width:calc(100vw - 16px)!important;height:78vh!important;bottom:84px!important}.chat-body{grid-template-columns:1fr!important}.chat-users{max-height:190px!important;border-right:0!important;border-bottom:1px solid #e2e8f0!important}}



/* Evitar doble envío en formularios */
.entity-form button[disabled]{
  opacity:.65!important;
  cursor:not-allowed!important;
  pointer-events:none!important;
}



/* Bloqueo visual al subir archivos en formularios */
.entity-form button[disabled],
.entity-form .is-uploading{
  opacity:.65!important;
  cursor:not-allowed!important;
  pointer-events:none!important;
}
.entity-form .is-uploading{
  background:#64748b!important;
}



/* =========================================================
   USUARIOS - EDICIÓN, RANGOS Y BLOQUEO ADMIN SISTEMA
   ========================================================= */
.users-card-host{
  padding:0!important;
  background:transparent!important;
}
.users-card-list{
  display:flex!important;
  flex-direction:column!important;
  gap:14px!important;
  padding:8px!important;
}
.user-manage-card{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:18px!important;
  padding:18px 22px!important;
  background:#fff!important;
  border:1px solid #dbe3ef!important;
  border-radius:16px!important;
  box-shadow:0 8px 20px rgba(15,23,42,.04)!important;
}
.user-left{
  display:flex!important;
  align-items:center!important;
  gap:16px!important;
  min-width:0!important;
}
.user-avatar{
  width:48px!important;
  height:48px!important;
  border-radius:50%!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-weight:900!important;
  font-size:14px!important;
  flex:0 0 48px!important;
}
.user-title{
  font-size:16px!important;
  font-weight:800!important;
  color:#0f172a!important;
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  flex-wrap:wrap!important;
}
.user-email{
  font-size:13px!important;
  color:#1d4ed8!important;
  margin-top:2px!important;
}
.user-dni{
  font-size:12px!important;
  color:#64748b!important;
  margin-top:2px!important;
}
.user-lock-badge{
  display:inline-flex!important;
  align-items:center!important;
  gap:5px!important;
  padding:4px 10px!important;
  border:1px solid #93c5fd!important;
  color:#2563eb!important;
  background:#eff6ff!important;
  border-radius:999px!important;
  font-size:12px!important;
  font-weight:800!important;
}
.user-actions{
  display:flex!important;
  align-items:center!important;
  gap:16px!important;
  flex-wrap:wrap!important;
  justify-content:flex-end!important;
}
.user-switch{
  width:54px!important;
  height:30px!important;
  border:0!important;
  border-radius:999px!important;
  padding:3px!important;
  background:#cbd5e1!important;
  cursor:pointer!important;
  position:relative!important;
}
.user-switch span{
  width:24px!important;
  height:24px!important;
  border-radius:50%!important;
  background:#fff!important;
  display:block!important;
  transition:.2s!important;
}
.user-switch.on{
  background:#2563eb!important;
}
.user-switch.on span{
  transform:translateX(24px)!important;
}
.user-switch:disabled{
  opacity:.45!important;
  cursor:not-allowed!important;
}
.user-switch-label{
  font-size:12px!important;
  color:#64748b!important;
  margin-left:-12px!important;
}
.user-role-pill{
  min-width:120px!important;
  text-align:center!important;
  border:1px solid #cbd5e1!important;
  border-radius:999px!important;
  padding:7px 14px!important;
  font-size:13px!important;
  font-weight:800!important;
  background:#fff!important;
}
.icon-action{
  width:34px!important;
  height:34px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border:0!important;
  background:transparent!important;
  color:#0f172a!important;
  font-size:17px!important;
  cursor:pointer!important;
  border-radius:10px!important;
}
.icon-action:hover{
  background:#f1f5f9!important;
}
.icon-action.danger{
  color:#ef4444!important;
}
.icon-action:disabled{
  color:#94a3b8!important;
  cursor:not-allowed!important;
}
.user-form-grid{
  grid-template-columns:1fr 1fr!important;
}
.user-form-grid .full{
  grid-column:1 / -1!important;
}
@media(max-width:900px){
  .user-manage-card{
    align-items:flex-end!important;
    flex-direction:column!important;
  }
  .user-actions{
    width:100%!important;
    justify-content:flex-start!important;
  }
  .user-form-grid{
    grid-template-columns:1fr!important;
  }
}



/* Evita doble creación en solicitudes de firma con adjuntos */
.entity-form button[disabled],
.entity-form .is-uploading{
  opacity:.65!important;
  cursor:not-allowed!important;
  pointer-events:none!important;
}



/* =========================================================
   LOGIN PREMIUM LAPROWORLD - Estilo Microsoft Corporate
   ========================================================= */
.login-wall.login-ms-wall{
  position:fixed!important;
  inset:0!important;
  z-index:99999!important;
  min-height:100vh!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  background:
    radial-gradient(circle at 14% 82%, rgba(66,153,225,.34) 0, rgba(66,153,225,.14) 24%, transparent 46%),
    radial-gradient(circle at 78% 18%, rgba(37,99,235,.16) 0, transparent 38%),
    linear-gradient(135deg,#f8fbff 0%,#eef5ff 42%,#f9fbff 100%)!important;
  font-family:Inter, Segoe UI, system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif!important;
}

.login-ms-bg{
  position:absolute!important;
  inset:0!important;
  pointer-events:none!important;
  overflow:hidden!important;
}

.login-ms-orb{
  position:absolute!important;
  border-radius:36px!important;
  border:1px solid rgba(255,255,255,.72)!important;
  background:linear-gradient(145deg,rgba(255,255,255,.58),rgba(219,234,254,.18))!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 20px 80px rgba(37,99,235,.12)!important;
  backdrop-filter:blur(12px)!important;
  transform:rotate(-28deg)!important;
}

.login-ms-orb.orb-one{
  width:620px!important;
  height:420px!important;
  left:-170px!important;
  bottom:-95px!important;
}

.login-ms-orb.orb-two{
  width:520px!important;
  height:340px!important;
  left:160px!important;
  top:70px!important;
  opacity:.62!important;
}

.login-ms-orb.orb-three{
  width:380px!important;
  height:260px!important;
  right:-120px!important;
  top:-60px!important;
  opacity:.55!important;
}

.login-ms-line{
  position:absolute!important;
  width:850px!important;
  height:2px!important;
  background:linear-gradient(90deg,transparent,rgba(59,130,246,.24),rgba(255,255,255,.9),transparent)!important;
  transform:rotate(-31deg)!important;
  filter:blur(.2px)!important;
}

.login-ms-line.line-one{
  left:-170px!important;
  bottom:205px!important;
}

.login-ms-line.line-two{
  left:80px!important;
  top:205px!important;
  opacity:.65!important;
}

.login-ms-shell{
  width:min(96vw,1280px)!important;
  min-height:760px!important;
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  padding:40px 120px!important;
}

.login-ms-card{
  width:560px!important;
  max-width:92vw!important;
  background:rgba(255,255,255,.84)!important;
  border:1px solid rgba(203,213,225,.74)!important;
  border-radius:24px!important;
  box-shadow:0 32px 90px rgba(15,23,42,.18),0 8px 24px rgba(37,99,235,.08)!important;
  padding:52px 58px 42px!important;
  backdrop-filter:blur(18px)!important;
  animation:loginCardIn .32s ease-out both!important;
}

@keyframes loginCardIn{
  from{opacity:0; transform:translateY(14px) scale(.985);}
  to{opacity:1; transform:translateY(0) scale(1);}
}

.login-success .login-ms-card{
  animation:loginCardOut .18s ease-in both!important;
}

@keyframes loginCardOut{
  to{opacity:0; transform:translateY(-8px) scale(.985);}
}

.login-brand-wrap{
  display:flex!important;
  justify-content:center!important;
  margin-bottom:34px!important;
}

.login-brand-logo{
  width:430px!important;
  max-width:100%!important;
  height:auto!important;
  object-fit:contain!important;
  filter:contrast(1.05)!important;
}

.login-heading{
  text-align:center!important;
  margin-bottom:28px!important;
}

.login-heading h1{
  margin:0!important;
  font-size:32px!important;
  line-height:1.15!important;
  color:#14213d!important;
  letter-spacing:-.025em!important;
  font-weight:850!important;
}

.login-heading p{
  margin:12px 0 0!important;
  color:#6b7280!important;
  font-size:15px!important;
  font-weight:500!important;
}

.login-ms-form{
  display:flex!important;
  flex-direction:column!important;
  gap:18px!important;
}

.login-ms-field label{
  display:block!important;
  margin:0 0 8px!important;
  color:#111827!important;
  font-size:14px!important;
  font-weight:800!important;
}

.login-ms-input{
  height:56px!important;
  display:flex!important;
  align-items:center!important;
  gap:12px!important;
  border:1px solid #cbd5e1!important;
  border-radius:10px!important;
  background:rgba(255,255,255,.78)!important;
  padding:0 16px!important;
  transition:.18s ease!important;
}

.login-ms-input:focus-within{
  border-color:#2563eb!important;
  box-shadow:0 0 0 4px rgba(37,99,235,.12)!important;
  background:#fff!important;
}

.login-ms-input i{
  color:#94a3b8!important;
  font-size:18px!important;
}

.login-ms-input input{
  flex:1!important;
  height:100%!important;
  border:0!important;
  outline:0!important;
  background:transparent!important;
  color:#0f172a!important;
  font-size:15px!important;
  font-weight:600!important;
  min-width:0!important;
}

.login-ms-input input::placeholder{
  color:#9ca3af!important;
  font-weight:500!important;
}

.login-eye{
  width:34px!important;
  height:34px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border:0!important;
  border-radius:9px!important;
  background:transparent!important;
  cursor:pointer!important;
}

.login-eye:hover{
  background:#f1f5f9!important;
}

.login-ms-msg{
  min-height:18px!important;
  font-size:12px!important;
  font-weight:700!important;
  margin-top:-4px!important;
}

.login-ms-msg.error{color:#dc2626!important;}
.login-ms-msg.info{color:#2563eb!important;}

.login-ms-btn{
  margin-top:4px!important;
  width:100%!important;
  height:58px!important;
  border:0!important;
  border-radius:10px!important;
  background:linear-gradient(180deg,#2f6fed,#185bdc)!important;
  color:#fff!important;
  font-size:18px!important;
  font-weight:850!important;
  cursor:pointer!important;
  box-shadow:0 14px 28px rgba(37,99,235,.24)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:12px!important;
  transition:.18s ease!important;
}

.login-ms-btn:hover{
  transform:translateY(-1px)!important;
  box-shadow:0 18px 34px rgba(37,99,235,.28)!important;
}

.login-ms-btn:disabled{
  opacity:.72!important;
  cursor:not-allowed!important;
  transform:none!important;
}

.login-forgot{
  border:0!important;
  background:transparent!important;
  color:#0b63ce!important;
  cursor:pointer!important;
  font-size:15px!important;
  font-weight:700!important;
  text-align:center!important;
  padding:2px!important;
}

.login-forgot:hover{
  text-decoration:underline!important;
}

.login-ms-info{
  margin-top:18px!important;
  padding-top:24px!important;
  border-top:1px solid #dbe3ef!important;
  display:flex!important;
  align-items:flex-end!important;
  gap:14px!important;
  color:#667085!important;
  font-size:14px!important;
  line-height:1.35!important;
}

.login-ms-info i{
  color:#2563eb!important;
  font-size:22px!important;
  margin-top:1px!important;
}

.login-ms-info b{
  color:#344054!important;
}

@media(max-width:980px){
  .login-ms-shell{
    min-height:100vh!important;
    justify-content:center!important;
    padding:28px!important;
  }
  .login-ms-card{
    width:520px!important;
    padding:42px 34px 34px!important;
  }
  .login-brand-logo{
    width:360px!important;
  }
}

@media(max-width:560px){
  .login-ms-card{
    padding:34px 22px 28px!important;
    border-radius:20px!important;
  }
  .login-heading h1{
    font-size:25px!important;
  }
  .login-brand-logo{
    width:300px!important;
  }
  .login-ms-input,
  .login-ms-btn{
    height:52px!important;
  }
}



/* =========================================================
   EVITAR PARPADEO DASHBOARD → LOGIN AL ACTUALIZAR
   ========================================================= */
body.auth-checking .sidebar,
body.auth-checking .topbar,
body.auth-checking .page,
body:not(.app-authenticated) .sidebar,
body:not(.app-authenticated) .topbar,
body:not(.app-authenticated) .page{
  visibility:hidden!important;
  pointer-events:none!important;
}

body.app-authenticated .sidebar,
body.app-authenticated .topbar,
body.app-authenticated .page{
  visibility:visible!important;
}



/* =========================================================
   BOTÓN HEADER - CLIENTES GEOLOCALIZADOS
   ========================================================= */
.btn-map-clientes{
  height:40px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  padding:0 14px!important;
  border-radius:12px!important;
  border:1px solid #0ea5e9!important;
  background:linear-gradient(180deg,#0ea5e9,#0284c7)!important;
  color:#fff!important;
  text-decoration:none!important;
  font-size:13px!important;
  font-weight:850!important;
  white-space:nowrap!important;
  box-shadow:0 10px 22px rgba(14,165,233,.22)!important;
  transition:.18s ease!important;
}
.btn-map-clientes:hover{
  transform:translateY(-1px)!important;
  background:linear-gradient(180deg,#0284c7,#0369a1)!important;
  box-shadow:0 14px 28px rgba(14,165,233,.28)!important;
}
.btn-map-clientes i{
  font-size:14px!important;
}
@media(max-width:1280px){
  .btn-map-clientes span{display:none!important;}
  .btn-map-clientes{
    width:40px!important;
    padding:0!important;
    min-width:40px!important;
  }
}



/* Botón global visible en todas las hojas */
.header-right #btnClientesGeo.btn-map-clientes{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  visibility:visible!important;
  opacity:1!important;
  flex:0 0 auto!important;
}
body.app-authenticated .header-right #btnClientesGeo{
  display:inline-flex!important;
}



/* =========================================================
   FIX DEFINITIVO - BOTÓN CLIENTES GEOLOCALIZADOS VISIBLE
   ========================================================= */
.header,
.header-right{
  overflow:visible!important;
}

#btnClientesGeo.btn-map-clientes,
.header-right #btnClientesGeo.btn-map-clientes,
a#btnClientesGeo{
  display:inline-flex!important;
  visibility:visible!important;
  opacity:1!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  height:40px!important;
  min-width:max-content!important;
  width:auto!important;
  padding:0 14px!important;
  border-radius:12px!important;
  border:1px solid #0ea5e9!important;
  background:linear-gradient(180deg,#0ea5e9,#0284c7)!important;
  color:#fff!important;
  text-decoration:none!important;
  font-size:13px!important;
  font-weight:850!important;
  white-space:nowrap!important;
  box-shadow:0 10px 22px rgba(14,165,233,.22)!important;
  flex:0 0 auto!important;
  order:20!important;
  position:relative!important;
  z-index:999!important;
}

#btnClientesGeo.btn-map-clientes:hover{
  transform:translateY(-1px)!important;
  background:linear-gradient(180deg,#0284c7,#0369a1)!important;
}

#btnClientesGeo.btn-map-clientes i{
  display:inline-block!important;
  font-size:14px!important;
}

#btnClientesGeo.btn-map-clientes span{
  display:inline!important;
}

#btnNew{
  order:30!important;
  flex:0 0 auto!important;
}

.hdr-profile{
  order:40!important;
  flex:0 0 auto!important;
}

@media(max-width:1280px){
  #btnClientesGeo.btn-map-clientes span{
    display:none!important;
  }
  #btnClientesGeo.btn-map-clientes{
    min-width:40px!important;
    width:40px!important;
    padding:0!important;
  }
}


/* ═════════ CLIENTES GEOLOCALIZADOS EN VISTA INTERNA ═════════ */
.btn-map-clientes.active{
  box-shadow: 0 10px 24px rgba(14,165,233,.24);
  transform: translateY(-1px);
  filter: saturate(1.05);
}

#page-clientesgeo .page-header{
  margin-bottom: 18px;
}

.geo-map-card{
  background: #fff;
  border: 1px solid #e7edf5;
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(15,23,42,.06);
  overflow: hidden;
  min-height: 680px;
}

.geo-map-frame-wrap{
  width: 100%;
  height: calc(100vh - 235px);
  min-height: 680px;
  background: #f8fbff;
}

.geo-map-frame{
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}

@media (max-width: 1200px){
  .geo-map-frame-wrap{
    height: calc(100vh - 220px);
    min-height: 620px;
  }
}

@media (max-width: 768px){
  .geo-map-card{
    border-radius: 16px;
    min-height: 540px;
  }
  .geo-map-frame-wrap{
    height: calc(100vh - 180px);
    min-height: 540px;
  }
}


/* =========================================================
   OVERRIDE FINAL - CLIENTES GEOLOCALIZADOS IGUAL A NUEVO REGISTRO
   ========================================================= */
#btnClientesGeo.btn-map-clientes,
.header-right #btnClientesGeo.btn-map-clientes,
a#btnClientesGeo.btn-map-clientes{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  padding:8px 16px!important;
  height:auto!important;
  min-width:max-content!important;
  width:auto!important;
  border-radius:9px!important;
  border:0!important;
  background:linear-gradient(135deg,var(--primary),var(--primary-d))!important;
  color:#fff!important;
  font-size:12.5px!important;
  font-weight:600!important;
  text-decoration:none!important;
  white-space:nowrap!important;
  box-shadow:0 4px 12px rgba(37,99,235,.35)!important;
  transition:all var(--tr)!important;
}
#btnClientesGeo.btn-map-clientes:hover,
.header-right #btnClientesGeo.btn-map-clientes:hover,
a#btnClientesGeo.btn-map-clientes:hover{
  transform:translateY(-1px)!important;
  background:linear-gradient(135deg,var(--primary),var(--primary-d))!important;
  box-shadow:0 6px 18px rgba(37,99,235,.45)!important;
}
#btnClientesGeo.btn-map-clientes i{
  font-size:12px!important;
}
#btnClientesGeo.btn-map-clientes.active{
  filter:none!important;
  box-shadow:0 6px 18px rgba(37,99,235,.45)!important;
}
@media(max-width:1280px){
  #btnClientesGeo.btn-map-clientes span{display:none!important;}
  #btnClientesGeo.btn-map-clientes{
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    padding:0!important;
    border-radius:9px!important;
  }
}


/* =========================================================
   AJUSTE FINAL - MISMO TAMAÑO VISUAL QUE NUEVO REGISTRO
   ========================================================= */
#btnClientesGeo.btn-map-clientes,
.header-right #btnClientesGeo.btn-map-clientes,
a#btnClientesGeo.btn-map-clientes{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  height:39px!important;
  min-height:39px!important;
  width:136px!important;
  min-width:136px!important;
  max-width:136px!important;
  padding:0 10px!important;
  overflow:hidden!important;
  border-radius:9px!important;
  border:0!important;
  background:linear-gradient(135deg,var(--primary),var(--primary-d))!important;
  color:#fff!important;
  font-size:10.7px!important;
  line-height:1!important;
  font-weight:600!important;
  text-decoration:none!important;
  white-space:nowrap!important;
  text-overflow:ellipsis!important;
  box-shadow:0 4px 12px rgba(37,99,235,.35)!important;
  transition:all var(--tr)!important;
}
#btnClientesGeo.btn-map-clientes i{
  font-size:11px!important;
  flex:0 0 auto!important;
}
#btnClientesGeo.btn-map-clientes span{
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
#btnClientesGeo.btn-map-clientes:hover,
.header-right #btnClientesGeo.btn-map-clientes:hover,
a#btnClientesGeo.btn-map-clientes:hover{
  transform:translateY(-1px)!important;
  box-shadow:0 6px 18px rgba(37,99,235,.45)!important;
}
@media(max-width:1280px){
  #btnClientesGeo.btn-map-clientes{
    width:38px!important;
    min-width:38px!important;
    max-width:38px!important;
    height:38px!important;
    padding:0!important;
  }
  #btnClientesGeo.btn-map-clientes span{display:none!important;}
}


/* =========================================================
   AJUSTE EXACTO - CLIENTES GEOLOCALIZADOS = NUEVO REGISTRO
   ========================================================= */
#btnClientesGeo.btn-map-clientes,
.header-right #btnClientesGeo.btn-map-clientes,
a#btnClientesGeo.btn-map-clientes{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  padding:8px 10px!important;
  border-radius:9px!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  background:linear-gradient(135deg,var(--primary),var(--primary-d))!important;
  color:#fff!important;
  box-shadow:0 4px 12px rgba(37,99,235,.35)!important;
  text-decoration:none!important;
}
#btnClientesGeo.btn-map-clientes i{
  font-size:11px!important;
  line-height:1!important;
  flex:0 0 auto!important;
}
#btnClientesGeo.btn-map-clientes span{
  display:block!important;
  font-size:10px!important;
  font-weight:600!important;
  line-height:1!important;
  letter-spacing:-0.15px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
#btnClientesGeo.btn-map-clientes:hover,
.header-right #btnClientesGeo.btn-map-clientes:hover,
a#btnClientesGeo.btn-map-clientes:hover{
  transform:translateY(-1px)!important;
  box-shadow:0 6px 18px rgba(37,99,235,.45)!important;
}
@media (max-width: 1280px){
  #btnClientesGeo.btn-map-clientes,
  .header-right #btnClientesGeo.btn-map-clientes,
  a#btnClientesGeo.btn-map-clientes{
    width:38px!important;
    min-width:38px!important;
    max-width:38px!important;
    padding:0!important;
  }
  #btnClientesGeo.btn-map-clientes span{display:none!important;}
}



/* =========================================================
   BOTÓN MAPA DIGITAL - MISMO ANCHO Y ALTO QUE NUEVO REGISTRO
   ========================================================= */
#btnClientesGeo.btn-map-clientes,
.header-right #btnClientesGeo.btn-map-clientes,
a#btnClientesGeo.btn-map-clientes{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  padding:8px 16px!important;
  border-radius:9px!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  background:linear-gradient(135deg,var(--primary),var(--primary-d))!important;
  color:#fff!important;
  box-shadow:0 4px 12px rgba(37,99,235,.35)!important;
  text-decoration:none!important;
  font-size:12.5px!important;
  font-weight:600!important;
  line-height:1!important;
}
#btnClientesGeo.btn-map-clientes i{
  font-size:12px!important;
  line-height:1!important;
  flex:0 0 auto!important;
}
#btnClientesGeo.btn-map-clientes span{
  display:block!important;
  font-size:12.5px!important;
  font-weight:600!important;
  line-height:1!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
#btnClientesGeo.btn-map-clientes:hover,
.header-right #btnClientesGeo.btn-map-clientes:hover,
a#btnClientesGeo.btn-map-clientes:hover{
  transform:translateY(-1px)!important;
  box-shadow:0 6px 18px rgba(37,99,235,.45)!important;
}
@media (max-width:1280px){
  #btnClientesGeo.btn-map-clientes span{
    display:none!important;
  }
}



/* =========================================================
   MODAL GLOBAL NUEVO REGISTRO - OPERACIONES DEL SISTEMA
   ========================================================= */
.global-new-overlay{
  z-index:10050!important;
}
.global-new-box{
  width:min(980px,calc(100vw - 32px))!important;
  max-width:980px!important;
  border-radius:18px!important;
  overflow:hidden!important;
}
.global-new-body{
  padding:22px!important;
  max-height:calc(100vh - 140px)!important;
  overflow:auto!important;
}
.global-new-sub{
  margin:0 0 16px!important;
  color:var(--gray-500)!important;
  font-size:12.5px!important;
}
.global-new-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:14px!important;
}
.global-new-card{
  border:1.5px solid var(--gray-100)!important;
  background:#fff!important;
  border-radius:16px!important;
  padding:18px 16px!important;
  min-height:142px!important;
  text-align:left!important;
  display:flex!important;
  flex-direction:column!important;
  gap:10px!important;
  box-shadow:0 8px 22px rgba(15,23,42,.06)!important;
  transition:all .18s ease!important;
  font-family:inherit!important;
}
.global-new-card:hover{
  transform:translateY(-2px)!important;
  box-shadow:0 14px 30px rgba(15,23,42,.10)!important;
  border-color:#bfdbfe!important;
}
.global-new-ico{
  width:42px!important;
  height:42px!important;
  border-radius:12px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  color:#fff!important;
  font-size:17px!important;
}
.global-new-card.blue .global-new-ico{background:linear-gradient(135deg,#2563eb,#1d4ed8)!important;}
.global-new-card.green .global-new-ico{background:linear-gradient(135deg,#10b981,#059669)!important;}
.global-new-card.violet .global-new-ico{background:linear-gradient(135deg,#8b5cf6,#6d28d9)!important;}
.global-new-card.emerald .global-new-ico{background:linear-gradient(135deg,#059669,#047857)!important;}
.global-new-card.orange .global-new-ico{background:linear-gradient(135deg,#f97316,#ea580c)!important;}
.global-new-card.amber .global-new-ico{background:linear-gradient(135deg,#f59e0b,#d97706)!important;}
.global-new-card.indigo .global-new-ico{background:linear-gradient(135deg,#6366f1,#4338ca)!important;}
.global-new-card.slate .global-new-ico{background:linear-gradient(135deg,#64748b,#334155)!important;}
.global-new-title{
  font-size:14px!important;
  font-weight:800!important;
  color:var(--gray-900)!important;
  line-height:1.25!important;
}
.global-new-text{
  font-size:12px!important;
  color:var(--gray-500)!important;
  line-height:1.45!important;
}
@media(max-width:760px){
  .global-new-grid{grid-template-columns:1fr!important;}
  .global-new-card{min-height:auto!important;}
}



/* =========================================================
   GESTIÓN COMERCIAL
   ========================================================= */
.commercial-kpi-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin-bottom:18px;
}
.comm-kpi{
  background:#fff;
  border:1px solid var(--gray-100);
  border-radius:14px;
  padding:16px;
  display:flex;
  align-items:center;
  gap:12px;
  box-shadow:var(--shadow-sm);
}
.comm-kpi-icon{
  width:42px;height:42px;border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  color:#fff;
}
.comm-kpi.blue .comm-kpi-icon{background:#2563eb}
.comm-kpi.green .comm-kpi-icon{background:#10b981}
.comm-kpi.violet .comm-kpi-icon{background:#8b5cf6}
.comm-kpi.orange .comm-kpi-icon{background:#f59e0b}
.comm-kpi.rose .comm-kpi-icon{background:#f43f5e}
.comm-kpi.red .comm-kpi-icon{background:#ef4444}
.comm-kpi.cyan .comm-kpi-icon{background:#06b6d4}
.comm-kpi strong{display:block;font-size:22px;font-weight:800;color:var(--gray-900);line-height:1}
.comm-kpi small{display:block;font-size:11.5px;color:var(--gray-400);margin-top:4px}
.commercial-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:16px}
.commercial-side{display:flex;flex-direction:column;gap:16px}
.commercial-card{background:#fff;border:1px solid var(--gray-100);border-radius:14px;padding:16px;box-shadow:var(--shadow-sm)}
.commercial-card-title{font-weight:800;color:var(--gray-900);margin-bottom:12px}
.commercial-filters{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.commercial-filters input,.commercial-filters select{height:36px;border:1px solid var(--gray-100);border-radius:9px;padding:0 10px;font-size:12px}
.commercial-filters input{min-width:260px}
.comm-org b{display:block;color:var(--gray-900);font-size:12.5px}
.comm-org small,.muted-line{display:block;color:var(--gray-400);font-size:11px;margin-top:3px}
.comm-badge{display:inline-flex;align-items:center;border-radius:999px;padding:4px 9px;font-size:11px;font-weight:800}
.comm-badge.ok{background:#d1fae5;color:#047857}
.comm-badge.bad{background:#fee2e2;color:#b91c1c}
.comm-badge.info{background:#dbeafe;color:#1d4ed8}
.comm-badge.warn{background:#fef3c7;color:#b45309}
.comm-badge.muted{background:#f1f5f9;color:#475569}
.comm-danger{color:#dc2626;font-size:11px;font-weight:800;margin-top:6px}
.comm-overdue{background:#fff7ed!important}
.avatar-line{display:flex;align-items:center;gap:8px;font-size:12px}
.avatar-sm{width:26px;height:26px;border-radius:999px;background:#2563eb;color:#fff;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:800}
.row-actions{display:flex;gap:6px}
.mini-btn{width:31px;height:31px;border-radius:9px;border:1px solid var(--gray-100);background:#fff;color:var(--gray-600);display:inline-flex;align-items:center;justify-content:center}
.mini-btn:hover{background:#eff6ff;color:#2563eb}
.comm-ranking-row{display:flex;align-items:center;gap:10px;border-bottom:1px solid var(--gray-100);padding:9px 0}
.comm-ranking-row:last-child{border-bottom:0}
.comm-ranking-row .rank{width:24px;height:24px;border-radius:999px;background:#eff6ff;color:#2563eb;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:11px}
.comm-ranking-row b{display:block;font-size:12px}
.comm-ranking-row small{display:block;color:var(--gray-400);font-size:10.5px}
.comm-ranking-row strong{margin-left:auto;color:var(--gray-900)}
.comm-alert{width:100%;border:1px solid #fed7aa;background:#fff7ed;border-radius:11px;padding:10px;text-align:left;margin-bottom:8px}
.comm-alert b{display:block;color:#9a3412;font-size:12px}
.comm-alert span{display:block;color:#c2410c;font-size:11px;margin-top:3px}
.empty-mini{padding:16px;text-align:center;color:var(--gray-400);font-size:12px}
.empty-mini.ok{color:#047857;background:#ecfdf5;border-radius:10px}
.commercial-timeline-head h3{margin:0;color:var(--gray-900)}
.commercial-timeline-head p{margin:4px 0 12px;color:var(--gray-400)}
.commercial-timeline{display:flex;flex-direction:column;gap:12px;max-height:520px;overflow:auto;padding-right:4px}
.timeline-item{display:flex;gap:10px}
.timeline-dot{width:10px;height:10px;border-radius:50%;background:#2563eb;margin-top:7px;flex:0 0 10px}
.timeline-content{border:1px solid var(--gray-100);border-radius:12px;padding:10px;background:#fff;flex:1}
.timeline-content b{display:block;color:var(--gray-900);font-size:12.5px}
.timeline-content small{display:block;color:var(--gray-400);font-size:11px;margin:3px 0}
.timeline-content p{margin:6px 0;color:var(--gray-600);font-size:12px}
.timeline-content span{display:block;color:#2563eb;font-size:11px}
@media(max-width:1200px){
  .commercial-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .commercial-layout{grid-template-columns:1fr}
}
@media(max-width:680px){
  .commercial-kpi-grid{grid-template-columns:1fr}
  .commercial-filters input{min-width:100%}
}



/* =========================================================
   LOGIN - SIN TÍTULO Y COPYRIGHT CORPORATIVO
   ========================================================= */
.compact-login-heading{
  margin-top:-12px!important;
  margin-bottom:24px!important;
}
.compact-login-heading p{
  margin:0!important;
  font-size:14px!important;
  color:#64748b!important;
  text-align:center!important;
}
.login-copyright{
  justify-content:center!important;
  align-items:center!important;
  text-align:center!important;
}
.login-copyright i{
  font-size:18px!important;
}
.login-copyright span{
  font-size:13px!important;
  color:#475569!important;
}
.login-copyright b{
  font-weight:900!important;
  color:#0f172a!important;
}



/* =========================================================
   LISTA DE PRECIO - ALERTA DE RANGO MÍNIMO
   ========================================================= */
.price-range-warning{
  margin-top:8px;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid #fed7aa;
  background:#fff7ed;
  color:#c2410c;
  font-size:11.5px;
  font-weight:700;
  display:flex;
  align-items:center;
  gap:7px;
}
.price-range-warning i{
  color:#f97316;
}


/* =========================================================
   GESTIÓN COMERCIAL - OPORTUNIDADES NEGOCIADAS
   ========================================================= */
.negotiated-card .table-wrap{overflow:auto}.negotiated-table th,.negotiated-table td{vertical-align:top}.negotiated-table th:nth-child(1){min-width:260px}.negotiated-table th:nth-child(2){min-width:220px}.negotiated-table th:nth-child(8){min-width:280px}.neg-details{font-size:11.5px;color:var(--gray-600);line-height:1.45}.hidden-by-role{display:none!important}



/* =========================================================
   GESTIÓN COMERCIAL - CHECKS GANADO / PAGADO
   ========================================================= */
.negotiated-table th,
.negotiated-table td{
  vertical-align:middle;
}
.neg-check-cell{
  text-align:center;
}
.neg-check{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:24px;
  height:24px;
  border-radius:6px;
  cursor:pointer;
}
.neg-check input{
  display:none;
}
.neg-check span{
  width:18px;
  height:18px;
  border-radius:4px;
  border:2px solid #22c55e;
  background:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.neg-check.checked span{
  background:#22c55e;
  border-color:#22c55e;
}
.neg-check.checked span::after{
  content:'✓';
  color:#fff;
  font-weight:900;
  font-size:13px;
  line-height:1;
}
.neg-details{
  min-width:220px;
  line-height:1.35;
}



/* =========================================================
   GESTIÓN COMERCIAL - IMPORTACIÓN EXCEL
   ========================================================= */
.import-excel-box{
  display:grid;
  gap:14px;
}
.import-note{
  border:1px solid #bfdbfe;
  background:#eff6ff;
  color:#1e40af;
  border-radius:12px;
  padding:12px 14px;
  font-size:12.5px;
  line-height:1.45;
}
.import-preview{
  min-height:82px;
  border:1px dashed #cbd5e1;
  background:#f8fafc;
  border-radius:12px;
  padding:12px;
  color:#475569;
  font-size:12.5px;
}
.import-row{
  padding:6px 0;
  border-bottom:1px solid #e2e8f0;
}
.import-row:last-child{
  border-bottom:0;
}
.import-more{
  margin-top:8px;
  font-weight:800;
  color:#2563eb;
}
.field-help{
  display:block;
  margin-top:6px;
  color:#64748b;
  font-size:11.5px;
}



/* =========================================================
   SIDEBAR PLEGABLE
   ========================================================= */
.sidebar-toggle{
  margin-left:auto;
  width:30px;
  height:30px;
  border-radius:8px;
  color:#cbd5e1;
  background:rgba(255,255,255,.06);
  display:flex;
  align-items:center;
  justify-content:center;
  transition:all .18s ease;
}
.sidebar-toggle:hover{
  color:#fff;
  background:rgba(255,255,255,.12);
}
body.sidebar-collapsed .sidebar{
  width:68px!important;
}
body.sidebar-collapsed .main{
  margin-left:68px!important;
}
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-section,
body.sidebar-collapsed .nav-link span:not(.nav-ico):not(.nav-badge),
body.sidebar-collapsed .user-info{
  display:none!important;
}
body.sidebar-collapsed .sidebar-brand{
  justify-content:center;
  padding:18px 10px;
}
body.sidebar-collapsed .sidebar-toggle{
  position:absolute;
  right:8px;
  top:56px;
  width:26px;
  height:26px;
  z-index:2;
}
body.sidebar-collapsed .sidebar-nav{
  padding:42px 8px 8px;
}
body.sidebar-collapsed .nav-link{
  justify-content:center;
  padding:11px 0;
  gap:0;
}
body.sidebar-collapsed .nav-ico{
  width:auto;
  font-size:15px;
}
body.sidebar-collapsed .nav-badge{
  position:absolute;
  right:6px;
  top:5px;
  min-width:16px;
  height:16px;
  padding:0 4px;
  font-size:9px;
  display:flex;
  align-items:center;
  justify-content:center;
}
body.sidebar-collapsed .sidebar-footer{
  padding:10px 8px;
}
body.sidebar-collapsed .user-card{
  justify-content:center;
  padding:8px 0;
}
body.sidebar-collapsed .logout-btn{
  display:none;
}
@media(max-width:760px){
  body.sidebar-collapsed .sidebar{
    width:0!important;
  }
  body.sidebar-collapsed .main{
    margin-left:0!important;
  }
}



/* =========================================================
   AJUSTE FINAL - SIDEBAR PLEGABLE + TOOLTIPS + TABLA COMPACTA
   ========================================================= */

/* Sidebar plegado limpio */
body.sidebar-collapsed .sidebar{
  width:64px!important;
  overflow:visible!important;
}
body.sidebar-collapsed .main{
  margin-left:64px!important;
}
body.sidebar-collapsed .sidebar-brand{
  height:76px!important;
  padding:12px 8px!important;
  flex-direction:column!important;
  justify-content:flex-start!important;
  align-items:center!important;
  gap:6px!important;
  position:relative!important;
}
body.sidebar-collapsed .brand-ico{
  width:36px!important;
  height:36px!important;
  margin:0!important;
}
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-section,
body.sidebar-collapsed .nav-link span:not(.nav-ico):not(.nav-badge),
body.sidebar-collapsed .user-card > div:not(.user-avatar){
  display:none!important;
}
body.sidebar-collapsed .sidebar-toggle{
  position:static!important;
  width:30px!important;
  height:28px!important;
  margin:0!important;
  background:rgba(255,255,255,.08)!important;
}
body.sidebar-collapsed .sidebar-nav{
  padding:12px 8px 8px!important;
  gap:6px!important;
  overflow:visible!important;
}
body.sidebar-collapsed .nav-link{
  height:42px!important;
  min-height:42px!important;
  padding:0!important;
  justify-content:center!important;
  align-items:center!important;
  border-radius:11px!important;
  position:relative!important;
  overflow:visible!important;
}
body.sidebar-collapsed .nav-ico{
  width:100%!important;
  text-align:center!important;
  font-size:15px!important;
  line-height:1!important;
}
body.sidebar-collapsed .nav-badge{
  position:absolute!important;
  right:4px!important;
  top:-4px!important;
  min-width:17px!important;
  height:17px!important;
  padding:0 5px!important;
  font-size:9px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}
body.sidebar-collapsed .sidebar-footer{
  padding:10px 8px!important;
  overflow:visible!important;
}
body.sidebar-collapsed .user-card{
  width:48px!important;
  height:48px!important;
  padding:0!important;
  justify-content:center!important;
  align-items:center!important;
  position:relative!important;
  overflow:visible!important;
}
body.sidebar-collapsed .user-avatar{
  width:36px!important;
  height:36px!important;
}
body.sidebar-collapsed .logout-btn{
  display:none!important;
}

/* Tooltips corporativos al pasar mouse */
body.sidebar-collapsed .nav-link::after,
body.sidebar-collapsed .sidebar-brand::after,
body.sidebar-collapsed .user-card::after{
  content:attr(data-tooltip);
  position:absolute;
  left:72px;
  top:50%;
  transform:translateY(-50%);
  background:#0f172a;
  color:#fff;
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
  padding:8px 10px;
  border-radius:9px;
  box-shadow:0 10px 22px rgba(15,23,42,.25);
  opacity:0;
  pointer-events:none;
  z-index:9999;
  transition:opacity .12s ease, transform .12s ease;
}
body.sidebar-collapsed .nav-link::before,
body.sidebar-collapsed .sidebar-brand::before,
body.sidebar-collapsed .user-card::before{
  content:'';
  position:absolute;
  left:65px;
  top:50%;
  transform:translateY(-50%);
  border-top:6px solid transparent;
  border-bottom:6px solid transparent;
  border-right:7px solid #0f172a;
  opacity:0;
  z-index:9999;
  transition:opacity .12s ease;
}
body.sidebar-collapsed .nav-link:hover::after,
body.sidebar-collapsed .nav-link:hover::before,
body.sidebar-collapsed .sidebar-brand:hover::after,
body.sidebar-collapsed .sidebar-brand:hover::before,
body.sidebar-collapsed .user-card:hover::after,
body.sidebar-collapsed .user-card:hover::before{
  opacity:1;
}
body.sidebar-collapsed .nav-link:hover::after,
body.sidebar-collapsed .sidebar-brand:hover::after,
body.sidebar-collapsed .user-card:hover::after{
  transform:translateY(-50%) translateX(2px);
}

/* Tabla Gestión Comercial compacta y ordenada */
.negotiated-card .table-wrap{
  overflow:auto!important;
}
.negotiated-table{
  min-width:1420px!important;
  table-layout:fixed!important;
}
.negotiated-table th,
.negotiated-table td{
  padding:10px 12px!important;
  vertical-align:middle!important;
  line-height:1.22!important;
}
.negotiated-table td{
  font-size:11.5px!important;
}
.negotiated-table th:nth-child(1),
.negotiated-table td:nth-child(1){width:245px!important;}
.negotiated-table th:nth-child(2),
.negotiated-table td:nth-child(2){width:250px!important;}
.negotiated-table th:nth-child(3),
.negotiated-table td:nth-child(3){width:105px!important;}
.negotiated-table th:nth-child(4),
.negotiated-table td:nth-child(4){width:72px!important;text-align:center!important;}
.negotiated-table th:nth-child(5),
.negotiated-table td:nth-child(5){width:72px!important;text-align:center!important;}
.negotiated-table th:nth-child(6),
.negotiated-table td:nth-child(6){
  width:115px!important;
  white-space:nowrap!important;
  font-weight:800!important;
}
.negotiated-table th:nth-child(7),
.negotiated-table td:nth-child(7){width:110px!important;}
.negotiated-table th:nth-child(8),
.negotiated-table td:nth-child(8){width:125px!important;}
.negotiated-table th:nth-child(9),
.negotiated-table td:nth-child(9){width:95px!important;}
.negotiated-table th:nth-child(10),
.negotiated-table td:nth-child(10){width:260px!important;}
.negotiated-table th:nth-child(11),
.negotiated-table td:nth-child(11){width:105px!important;}
.negotiated-table .comm-org b,
.negotiated-table td b{
  font-size:11.7px!important;
  line-height:1.2!important;
}
.negotiated-table .comm-org small,
.negotiated-table .muted-line{
  font-size:10.5px!important;
  line-height:1.15!important;
}
.neg-details{
  max-height:54px!important;
  overflow:auto!important;
  font-size:11px!important;
  line-height:1.25!important;
}
.neg-check{
  width:20px!important;
  height:20px!important;
}
.neg-check span{
  width:17px!important;
  height:17px!important;
}
.row-actions{
  justify-content:flex-start!important;
}



/* =========================================================
   GESTIÓN COMERCIAL - TABLA ULTRA COMPACTA TODO VISIBLE
   ========================================================= */
#page-gestion360 .content,
#page-gestion360{
  overflow-x:hidden!important;
}
.negotiated-card{
  width:100%!important;
  overflow:hidden!important;
}
.negotiated-card .table-wrap{
  overflow-x:hidden!important;
  width:100%!important;
}
.negotiated-table{
  width:100%!important;
  min-width:0!important;
  table-layout:fixed!important;
  border-collapse:collapse!important;
}
.negotiated-table th,
.negotiated-table td{
  padding:7px 6px!important;
  font-size:10.2px!important;
  line-height:1.12!important;
  vertical-align:middle!important;
  word-break:normal!important;
  overflow:hidden!important;
}
.negotiated-table th{
  font-size:9.2px!important;
  letter-spacing:.25px!important;
  white-space:nowrap!important;
}
.negotiated-table td{
  height:54px!important;
  max-height:54px!important;
}
.negotiated-table th:nth-child(1),
.negotiated-table td:nth-child(1){width:19%!important;}
.negotiated-table th:nth-child(2),
.negotiated-table td:nth-child(2){width:20%!important;}
.negotiated-table th:nth-child(3),
.negotiated-table td:nth-child(3){width:8%!important;}
.negotiated-table th:nth-child(4),
.negotiated-table td:nth-child(4){width:5.5%!important;text-align:center!important;}
.negotiated-table th:nth-child(5),
.negotiated-table td:nth-child(5){width:5.5%!important;text-align:center!important;}
.negotiated-table th:nth-child(6),
.negotiated-table td:nth-child(6){width:9%!important;white-space:nowrap!important;}
.negotiated-table th:nth-child(7),
.negotiated-table td:nth-child(7){width:8%!important;}
.negotiated-table th:nth-child(8),
.negotiated-table td:nth-child(8){width:8%!important;}
.negotiated-table th:nth-child(9),
.negotiated-table td:nth-child(9){width:7%!important;}
.negotiated-table th:nth-child(10),
.negotiated-table td:nth-child(10){width:0!important;display:none!important;}
.negotiated-table th:nth-child(11),
.negotiated-table td:nth-child(11){width:10%!important;}

.negotiated-table .comm-org b,
.negotiated-table td b{
  font-size:10.5px!important;
  line-height:1.1!important;
  display:-webkit-box!important;
  -webkit-line-clamp:2!important;
  -webkit-box-orient:vertical!important;
  overflow:hidden!important;
}
.negotiated-table .comm-org small,
.negotiated-table .muted-line{
  font-size:9.5px!important;
  line-height:1!important;
  margin-top:2px!important;
}
.negotiated-table td:nth-child(2) b{
  display:-webkit-box!important;
  -webkit-line-clamp:3!important;
  -webkit-box-orient:vertical!important;
  overflow:hidden!important;
}
.negotiated-table td:nth-child(3),
.negotiated-table td:nth-child(7),
.negotiated-table td:nth-child(8),
.negotiated-table td:nth-child(9){
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
.negotiated-table td:nth-child(6) b{
  font-size:10.6px!important;
  white-space:nowrap!important;
}
.neg-check{
  width:18px!important;
  height:18px!important;
}
.neg-check span{
  width:15px!important;
  height:15px!important;
  border-width:2px!important;
}
.neg-check.checked span::after{
  font-size:11px!important;
}
.neg-details{
  display:none!important;
}
.negotiated-table .row-actions{
  gap:3px!important;
  justify-content:center!important;
}
.negotiated-table .mini-btn{
  width:25px!important;
  height:25px!important;
  border-radius:7px!important;
  font-size:10px!important;
}
@media(max-width:1366px){
  .content{padding:18px!important;}
  .negotiated-table th,
  .negotiated-table td{
    padding:6px 5px!important;
    font-size:9.8px!important;
  }
  .negotiated-table th{
    font-size:8.8px!important;
  }
}



/* =========================================================
   GESTIÓN COMERCIAL - ULTRA AJUSTADO SIN NEGRITA
   ========================================================= */
#page-gestion360 .content{
  padding:14px!important;
}
#page-gestion360 .table-card{
  border-radius:10px!important;
}
#page-gestion360 .table-hdr{
  padding:10px 12px!important;
}
.negotiated-card .table-wrap{
  overflow-x:hidden!important;
}
.negotiated-table{
  width:100%!important;
  min-width:0!important;
  table-layout:fixed!important;
}
.negotiated-table th,
.negotiated-table td{
  padding:4px 5px!important;
  font-size:9.6px!important;
  line-height:1.05!important;
  font-weight:400!important;
  vertical-align:middle!important;
  color:#0f2748!important;
}
.negotiated-table th{
  font-size:8.4px!important;
  font-weight:600!important;
  letter-spacing:.15px!important;
  height:24px!important;
  padding-top:5px!important;
  padding-bottom:5px!important;
  color:#64748b!important;
}
.negotiated-table td{
  height:38px!important;
  max-height:38px!important;
}
.negotiated-table tbody tr{
  height:38px!important;
}
.negotiated-table .comm-org b,
.negotiated-table td b,
.negotiated-table td strong,
.negotiated-table .comm-org strong{
  font-weight:400!important;
  font-size:9.7px!important;
  line-height:1.05!important;
  color:#0f2748!important;
}
.negotiated-table .comm-org small,
.negotiated-table .muted-line{
  font-weight:400!important;
  font-size:8.8px!important;
  line-height:1!important;
  margin-top:1px!important;
  color:#64748b!important;
}
.negotiated-table th:nth-child(1),
.negotiated-table td:nth-child(1){width:19%!important;}
.negotiated-table th:nth-child(2),
.negotiated-table td:nth-child(2){width:20%!important;}
.negotiated-table th:nth-child(3),
.negotiated-table td:nth-child(3){width:8.5%!important;}
.negotiated-table th:nth-child(4),
.negotiated-table td:nth-child(4){width:5.5%!important;text-align:center!important;}
.negotiated-table th:nth-child(5),
.negotiated-table td:nth-child(5){width:5.5%!important;text-align:center!important;}
.negotiated-table th:nth-child(6),
.negotiated-table td:nth-child(6){width:9%!important;white-space:nowrap!important;}
.negotiated-table th:nth-child(7),
.negotiated-table td:nth-child(7){width:8%!important;}
.negotiated-table th:nth-child(8),
.negotiated-table td:nth-child(8){width:8.5%!important;}
.negotiated-table th:nth-child(9),
.negotiated-table td:nth-child(9){width:6.5%!important;}
.negotiated-table th:nth-child(10),
.negotiated-table td:nth-child(10){display:none!important;width:0!important;}
.negotiated-table th:nth-child(11),
.negotiated-table td:nth-child(11){width:9.5%!important;}

.negotiated-table td:nth-child(1) .comm-org b,
.negotiated-table td:nth-child(2) b{
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  overflow:hidden!important;
}
.negotiated-table td:nth-child(1) .comm-org b{
  -webkit-line-clamp:2!important;
}
.negotiated-table td:nth-child(2) b{
  -webkit-line-clamp:2!important;
}
.negotiated-table td:nth-child(3),
.negotiated-table td:nth-child(7),
.negotiated-table td:nth-child(8),
.negotiated-table td:nth-child(9){
  overflow-wrap:anywhere!important;
}
.negotiated-table td:nth-child(6) b{
  font-weight:500!important;
  font-size:9.6px!important;
  white-space:nowrap!important;
}
.neg-check{
  width:16px!important;
  height:16px!important;
}
.neg-check span{
  width:14px!important;
  height:14px!important;
  border-width:1.7px!important;
  border-radius:3px!important;
}
.neg-check.checked span::after{
  font-size:10px!important;
}
.negotiated-table .row-actions{
  gap:2px!important;
  justify-content:center!important;
}
.negotiated-table .mini-btn{
  width:22px!important;
  height:22px!important;
  border-radius:6px!important;
  font-size:9px!important;
}
.negotiated-table .mini-btn i{
  font-size:9px!important;
}
.negotiated-table .neg-details{
  display:none!important;
}
@media(max-width:1366px){
  .negotiated-table th,
  .negotiated-table td{
    padding:3px 4px!important;
    font-size:9.1px!important;
  }
  .negotiated-table th{
    font-size:8px!important;
  }
  .negotiated-table td{
    height:35px!important;
    max-height:35px!important;
  }
  .negotiated-table tbody tr{
    height:35px!important;
  }
}



/* =========================================================
   GESTIÓN COMERCIAL - ASESOR DEBAJO DE ENTIDAD
   ========================================================= */
.negotiated-table .comm-org small{
  color:#64748b!important;
  font-size:8.9px!important;
  font-weight:400!important;
}



/* =========================================================
   GESTIÓN COMERCIAL - TAMAÑO DE LETRA NORMAL PLATAFORMA
   ========================================================= */
.negotiated-table th,
.negotiated-table td{
  font-size:12px!important;
  line-height:1.25!important;
  font-weight:400!important;
  padding:8px 10px!important;
  color:#0f2748!important;
}
.negotiated-table th{
  font-size:10.5px!important;
  font-weight:700!important;
  color:#64748b!important;
  letter-spacing:.35px!important;
}
.negotiated-table td{
  height:52px!important;
  max-height:52px!important;
}
.negotiated-table tbody tr{
  height:52px!important;
}
.negotiated-table .comm-org b,
.negotiated-table td b,
.negotiated-table td strong{
  font-size:12px!important;
  line-height:1.2!important;
  font-weight:400!important;
  color:#0f2748!important;
}
.negotiated-table .comm-org small,
.negotiated-table .muted-line{
  font-size:11px!important;
  line-height:1.1!important;
  font-weight:400!important;
  color:#64748b!important;
  margin-top:2px!important;
}
.negotiated-table td:nth-child(6) b{
  font-size:12px!important;
  font-weight:600!important;
  white-space:nowrap!important;
}
.neg-check{
  width:19px!important;
  height:19px!important;
}
.neg-check span{
  width:17px!important;
  height:17px!important;
}
.negotiated-table .mini-btn{
  width:28px!important;
  height:28px!important;
  font-size:11px!important;
}
.negotiated-table .mini-btn i{
  font-size:11px!important;
}

/* Mantener todo visible con fuente normal */
.negotiated-table{
  width:100%!important;
  min-width:0!important;
  table-layout:fixed!important;
}
.negotiated-table th:nth-child(1),
.negotiated-table td:nth-child(1){width:18%!important;}
.negotiated-table th:nth-child(2),
.negotiated-table td:nth-child(2){width:20%!important;}
.negotiated-table th:nth-child(3),
.negotiated-table td:nth-child(3){width:9%!important;}
.negotiated-table th:nth-child(4),
.negotiated-table td:nth-child(4){width:5.5%!important;text-align:center!important;}
.negotiated-table th:nth-child(5),
.negotiated-table td:nth-child(5){width:5.5%!important;text-align:center!important;}
.negotiated-table th:nth-child(6),
.negotiated-table td:nth-child(6){width:9.5%!important;white-space:nowrap!important;}
.negotiated-table th:nth-child(7),
.negotiated-table td:nth-child(7){width:8.5%!important;}
.negotiated-table th:nth-child(8),
.negotiated-table td:nth-child(8){width:8.5%!important;}
.negotiated-table th:nth-child(9),
.negotiated-table td:nth-child(9){width:7.5%!important;}
.negotiated-table th:nth-child(10),
.negotiated-table td:nth-child(10){display:none!important;width:0!important;}
.negotiated-table th:nth-child(11),
.negotiated-table td:nth-child(11){width:8%!important;}

@media(max-width:1366px){
  .negotiated-table th,
  .negotiated-table td{
    font-size:11.5px!important;
    padding:7px 8px!important;
  }
  .negotiated-table th{
    font-size:10px!important;
  }
  .negotiated-table .comm-org b,
  .negotiated-table td b,
  .negotiated-table td strong{
    font-size:11.5px!important;
  }
  .negotiated-table .comm-org small{
    font-size:10.5px!important;
  }
}



/* =========================================================
   GESTIÓN COMERCIAL - CONSULTOR / ASESOR EN NEGRITA
   ========================================================= */
.negotiated-table .comm-org small{
  font-weight:800!important;
  color:#2563eb!important;
  font-size:11px!important;
  line-height:1.1!important;
}
@media(max-width:1366px){
  .negotiated-table .comm-org small{
    font-size:10.5px!important;
  }
}



/* =========================================================
   GESTIÓN COMERCIAL - ESTADO ÚNICO / RUC / HISTORIAL
   ========================================================= */
.neg-status-select{
  width:100%!important;
  max-width:145px!important;
  height:28px!important;
  border:1px solid #dbe3ef!important;
  border-radius:8px!important;
  background:#fff!important;
  font-size:11px!important;
  color:#0f2748!important;
  padding:0 6px!important;
  outline:none!important;
}
.neg-status-select.cierre_negocio{border-color:#60a5fa!important;background:#eff6ff!important;}
.neg-status-select.espera_oc{border-color:#f59e0b!important;background:#fffbeb!important;}
.neg-status-select.ganado{border-color:#22c55e!important;background:#ecfdf5!important;}
.neg-status-select.perdido{border-color:#ef4444!important;background:#fef2f2!important;}

.negotiated-table th:nth-child(1),
.negotiated-table td:nth-child(1){width:17%!important;}
.negotiated-table th:nth-child(2),
.negotiated-table td:nth-child(2){width:18%!important;}
.negotiated-table th:nth-child(3),
.negotiated-table td:nth-child(3){width:8%!important;}
.negotiated-table th:nth-child(4),
.negotiated-table td:nth-child(4){width:12%!important;text-align:left!important;}
.negotiated-table th:nth-child(5),
.negotiated-table td:nth-child(5){width:8%!important;}
.negotiated-table th:nth-child(6),
.negotiated-table td:nth-child(6){width:9%!important;white-space:nowrap!important;}
.negotiated-table th:nth-child(7),
.negotiated-table td:nth-child(7){width:7.5%!important;}
.negotiated-table th:nth-child(8),
.negotiated-table td:nth-child(8){width:8%!important;}
.negotiated-table th:nth-child(9),
.negotiated-table td:nth-child(9){width:7%!important;}
.negotiated-table th:nth-child(10),
.negotiated-table td:nth-child(10){display:none!important;width:0!important;}
.negotiated-table th:nth-child(11),
.negotiated-table td:nth-child(11){width:5.5%!important;}

.ruc-history-head{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:10px 0 12px;
}
.ruc-history-head b{font-size:15px;color:#0f172a}
.ruc-history-head span{font-size:12px;color:#64748b}
.ruc-history-tabs{
  display:flex;
  gap:8px;
  margin-bottom:12px;
  flex-wrap:wrap;
}
.ruc-history-tabs button{
  border:1px solid #dbe3ef;
  background:#fff;
  border-radius:8px;
  padding:6px 10px;
  font-size:12px;
  color:#2563eb;
  font-weight:700;
}
.ruc-history-row{
  display:grid;
  grid-template-columns:130px 1fr 110px 150px 110px;
  gap:10px;
  align-items:center;
  border-bottom:1px solid #edf2f7;
  padding:9px 0;
  font-size:12px;
}
.ruc-history-row div b{display:block;color:#0f172a}
.ruc-history-row div span{display:block;color:#64748b;font-size:11px}
.ruc-history-row small{
  grid-column:1 / -1;
  color:#64748b;
}



/* =========================================================
   GESTIÓN COMERCIAL - ANIMACIÓN MOTIVACIONAL
   ========================================================= */
.form-info{
  display:flex;
  align-items:flex-start;
  gap:9px;
  border:1px solid #bfdbfe;
  background:#eff6ff;
  color:#1e40af;
  border-radius:12px;
  padding:10px 12px;
  font-size:12.5px;
  line-height:1.45;
}
.form-info i{
  margin-top:2px;
}
.motivational-modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.55);
  backdrop-filter:blur(6px);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:99999;
  animation:fadeIn .25s ease-out;
}
.motivational-modal{
  width:min(520px,92vw);
  background:#fff;
  border-radius:24px;
  padding:32px;
  text-align:center;
  box-shadow:0 30px 80px rgba(15,23,42,.35);
  position:relative;
  animation:scaleUp .35s ease-out;
  border:1px solid rgba(226,232,240,.9);
}
.motivational-icon{
  width:76px;
  height:76px;
  margin:0 auto 18px;
  border-radius:999px;
  background:linear-gradient(135deg,#eff6ff,#dbeafe);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:38px;
}
.motivational-modal h2{
  font-size:24px;
  font-weight:800;
  color:#0f172a;
  margin:0 0 12px;
}
.motivational-modal p{
  font-size:15px;
  line-height:1.7;
  color:#475569;
  margin:0 0 18px;
}
.motivational-footer{
  font-size:12px;
  color:#64748b;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.motivational-close{
  position:absolute;
  top:14px;
  right:16px;
  border:none;
  background:#f1f5f9;
  color:#334155;
  width:32px;
  height:32px;
  border-radius:999px;
  cursor:pointer;
  font-size:20px;
}
.motivational-confetti{border-top:6px solid #16a34a;}
.motivational-en_cierre{border-top:6px solid #2563eb;}
.motivational-espera_oc{border-top:6px solid #f59e0b;}
.motivational-perdido{border-top:6px solid #64748b;}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes scaleUp{from{transform:scale(.92) translateY(14px);opacity:0}to{transform:scale(1) translateY(0);opacity:1}}
@media(max-width:640px){
  .motivational-modal{padding:26px 20px;border-radius:20px}
  .motivational-modal h2{font-size:20px}
  .motivational-modal p{font-size:14px}
}



/* =========================================================
   GESTIÓN COMERCIAL - MODAL GANADO ORDEN / FACTURA
   ========================================================= */
#entityModal .form-info .fa-trophy{
  color:#16a34a;
}
#entityModal .form-field input:disabled{
  background:#f8fafc!important;
  color:#475569!important;
  cursor:not-allowed!important;
}



/* =========================================================
   GESTIÓN COMERCIAL - GANADO BLOQUEADO
   ========================================================= */
.neg-status-select.locked,
.neg-status-select:disabled{
  opacity:1!important;
  cursor:not-allowed!important;
  font-weight:800!important;
  color:#166534!important;
  border-color:#22c55e!important;
  background:#dcfce7!important;
}
.negotiated-table tr:has(.neg-status-select.locked){
  background:linear-gradient(90deg, rgba(220,252,231,.45), rgba(255,255,255,0))!important;
}



/* =========================================================
   GESTIÓN COMERCIAL - RUC OCULTO / PAGADO / FILA AZUL
   ========================================================= */

/* Ocultar columna RUC en la grilla */
.negotiated-table th:nth-child(5),
.negotiated-table td:nth-child(5),
.neg-ruc-hidden{
  display:none!important;
  width:0!important;
}

/* Redistribuir anchos al ocultar RUC */
.negotiated-table th:nth-child(1),
.negotiated-table td:nth-child(1){width:18%!important;}
.negotiated-table th:nth-child(2),
.negotiated-table td:nth-child(2){width:20%!important;}
.negotiated-table th:nth-child(3),
.negotiated-table td:nth-child(3){width:8%!important;}
.negotiated-table th:nth-child(4),
.negotiated-table td:nth-child(4){width:12%!important;}
.negotiated-table th:nth-child(6),
.negotiated-table td:nth-child(6){width:10%!important;white-space:nowrap!important;}
.negotiated-table th:nth-child(7),
.negotiated-table td:nth-child(7){width:9%!important;}
.negotiated-table th:nth-child(8),
.negotiated-table td:nth-child(8){width:9%!important;}
.negotiated-table th:nth-child(9),
.negotiated-table td:nth-child(9){width:7%!important;}
.negotiated-table th:nth-child(10),
.negotiated-table td:nth-child(10){display:none!important;width:0!important;}
.negotiated-table th:nth-child(11),
.negotiated-table td:nth-child(11){width:8%!important;}

/* Fila pendiente de pago: degradado azul suave */
.negotiated-table tbody tr.neg-unpaid-row{
  background:linear-gradient(90deg, rgba(219,234,254,.72), rgba(239,246,255,.38), rgba(255,255,255,.96))!important;
}
.negotiated-table tbody tr.neg-unpaid-row:hover{
  background:linear-gradient(90deg, rgba(191,219,254,.9), rgba(219,234,254,.55), #fff)!important;
}
.negotiated-table tbody tr.neg-paid-row{
  background:#fff!important;
}

.mini-btn.paid-action{
  color:#2563eb!important;
  border-color:#bfdbfe!important;
  background:#eff6ff!important;
}
.mini-btn.paid-action:hover{
  color:#fff!important;
  background:#2563eb!important;
}
.mini-btn.paid-done{
  color:#16a34a!important;
  border-color:#bbf7d0!important;
  background:#ecfdf5!important;
  opacity:1!important;
}
.motivational-pagado{
  border-top:6px solid #2563eb;
}



/* =========================================================
   GESTIÓN COMERCIAL - SOMBRA / DEGRADADO SOLO GANADOS
   ========================================================= */

/* El resto de estados NO debe tener degradado */
.negotiated-table tbody tr.neg-unpaid-row,
.negotiated-table tbody tr.neg-paid-row{
  background:#fff!important;
}

/* Solo las oportunidades en estado GANADO llevan degradado suave */
.negotiated-table tbody tr.neg-won-row{
  background:linear-gradient(90deg, rgba(220,252,231,.92), rgba(240,253,244,.55), rgba(255,255,255,.96))!important;
  box-shadow:inset 4px 0 0 #22c55e, 0 8px 18px rgba(34,197,94,.08)!important;
}
.negotiated-table tbody tr.neg-won-row:hover{
  background:linear-gradient(90deg, rgba(187,247,208,.95), rgba(220,252,231,.66), #fff)!important;
}



/* FIX BOTÓN PAGADO FUNCIONAL */
.mini-btn.paid-action{
  cursor:pointer!important;
  pointer-events:auto!important;
}
.mini-btn.paid-action:disabled{
  opacity:.65!important;
  cursor:wait!important;
}



/* =========================================================
   GESTIÓN COMERCIAL - PAGADO SOLO EN GANADO / EDIT ADMIN
   ========================================================= */
.negotiated-table .row-actions{
  min-width:76px;
}
.mini-btn.paid-action,
.mini-btn.paid-done{
  display:inline-flex!important;
}



/* FIX FINAL CLICK PAGADO */
.paid-action[data-paid-id],
.paid-action[data-paid-id] *{
  pointer-events:auto!important;
}
.paid-action[data-paid-id]{
  position:relative!important;
  z-index:1!important;
}



/* FIX: SOLO ESTADO BLOQUEADO EN GANADO */
.neg-status-select.locked{
  cursor:not-allowed!important;
}
.paid-action[data-paid-id]{
  cursor:pointer!important;
  pointer-events:auto!important;
  position:relative!important;
  z-index:1!important;
}



/* BOTON PAGAR DEFINITIVO */
.paid-action[data-paid-id]{
  cursor:pointer!important;
  pointer-events:auto!important;
  position:relative!important;
  z-index:1!important;
}
.paid-action[data-paid-id] i{
  pointer-events:none!important;
}



/* FIX PAGO VIA UPDATE ENDPOINT */
a.mini-btn.paid-action{
  text-decoration:none!important;
  cursor:pointer!important;
  pointer-events:auto!important;
}
a.mini-btn.paid-action.is-loading{
  opacity:.7!important;
  cursor:wait!important;
}



/* PAGO CLICK FINAL */
.paid-action[data-paid-id]{
  cursor:pointer!important;
  pointer-events:auto!important;
  position:relative!important;
  z-index:1!important;
  display:inline-flex!important;
}
.paid-action[data-paid-id] i{
  pointer-events:none!important;
}



/* FIX FINAL INDEPENDIENTE BOTÓN PAGAR */
.paid-action[data-paid-id]{
  cursor:pointer!important;
  pointer-events:auto!important;
  position:relative!important;
  z-index:1!important;
}
.paid-action[data-paid-id] i{
  pointer-events:none!important;
}



/* FIX CAPTURA ICONO PAGAR */
.paid-action[data-paid-id],
.paid-action[data-paid-id] *,
.fa-money-bill-wave{
  pointer-events:auto!important;
}
.paid-action[data-paid-id]{
  cursor:pointer!important;
  position:relative!important;
  z-index:1!important;
}
.paid-action[data-paying="1"]{
  opacity:.7!important;
}



/* FIX PAGADO YA CONFIRMADO NO DISPARA ALERTA */
.mini-btn.paid-done,
.mini-btn.paid-done *{
  pointer-events:none!important;
  cursor:default!important;
}
.mini-btn.paid-done{
  opacity:1!important;
  color:#16a34a!important;
  background:#ecfdf5!important;
  border-color:#bbf7d0!important;
}
.mini-btn.paid-action,
.mini-btn.paid-action *{
  pointer-events:auto!important;
}
.mini-btn.paid-action{
  cursor:pointer!important;
  position:relative!important;
  z-index:1!important;
}



/* =========================================================
   GESTIÓN COMERCIAL - QUITAR SOMBRA VERDE CUANDO YA ESTÁ PAGADO
   ========================================================= */

/* Si ya está pagado, la fila queda limpia, sin degradado ni sombra */
.negotiated-table tbody tr.neg-paid-clean-row{
  background:#fff!important;
  box-shadow:none!important;
}
.negotiated-table tbody tr.neg-paid-clean-row:hover{
  background:#f8fafc!important;
  box-shadow:none!important;
}

/* La sombra verde solo debe verse en ganado pendiente de pago */
.negotiated-table tbody tr.neg-won-row:not(.neg-paid-clean-row){
  background:linear-gradient(90deg, rgba(220,252,231,.92), rgba(240,253,244,.55), rgba(255,255,255,.96))!important;
  box-shadow:inset 4px 0 0 #22c55e, 0 8px 18px rgba(34,197,94,.08)!important;
}
.negotiated-table tbody tr.neg-won-row:not(.neg-paid-clean-row):hover{
  background:linear-gradient(90deg, rgba(187,247,208,.95), rgba(220,252,231,.66), #fff)!important;
}

/* Fallback defensivo: si una fila pagada conserva clases antiguas, se fuerza limpia */
.negotiated-table tbody tr.neg-paid-row,
.negotiated-table tbody tr.neg-paid-row:hover{
  background:#fff!important;
  box-shadow:none!important;
}



/* =========================================================
   FIX DEFINITIVO: SI ESTÁ PAGADO NO TIENE SOMBRA VERDE
   ========================================================= */

/* Pago confirmado: fila totalmente limpia */
#negotiatedBody tr[data-paid="1"],
.negotiated-table tbody tr[data-paid="1"],
#negotiatedBody tr.neg-paid-clean-row,
.negotiated-table tbody tr.neg-paid-clean-row{
  background:#ffffff!important;
  background-image:none!important;
  box-shadow:none!important;
  border-left:none!important;
  outline:none!important;
}

/* Incluso en hover debe seguir limpia */
#negotiatedBody tr[data-paid="1"]:hover,
.negotiated-table tbody tr[data-paid="1"]:hover,
#negotiatedBody tr.neg-paid-clean-row:hover,
.negotiated-table tbody tr.neg-paid-clean-row:hover{
  background:#f8fafc!important;
  background-image:none!important;
  box-shadow:none!important;
  border-left:none!important;
  outline:none!important;
}

/* Si por error conserva neg-won-row, se anula al estar pagado */
#negotiatedBody tr.neg-won-row[data-paid="1"],
.negotiated-table tbody tr.neg-won-row[data-paid="1"],
#negotiatedBody tr.neg-won-row.neg-paid-clean-row,
.negotiated-table tbody tr.neg-won-row.neg-paid-clean-row{
  background:#ffffff!important;
  background-image:none!important;
  box-shadow:none!important;
  border-left:none!important;
  outline:none!important;
}

/* Ganado pendiente de pago: aquí sí va la sombra */
#negotiatedBody tr.neg-won-row[data-paid="0"],
.negotiated-table tbody tr.neg-won-row[data-paid="0"]{
  background:linear-gradient(90deg, rgba(220,252,231,.92), rgba(240,253,244,.55), rgba(255,255,255,.96))!important;
  box-shadow:inset 4px 0 0 #22c55e, 0 8px 18px rgba(34,197,94,.08)!important;
}


/* =========================================================
   EFECTO SUPER ANIMADO AL MARCAR PAGADO
   ========================================================= */
body.pay-success-open{overflow:hidden;}
.pay-success-overlay{
  position:fixed; inset:0; z-index:5000;
  display:flex; align-items:center; justify-content:center;
  background:radial-gradient(circle at top, rgba(37,99,235,.18), rgba(2,6,23,.72));
  backdrop-filter:blur(8px);
  animation:payFadeIn .28s ease-out;
  padding:24px;
}
.pay-success-overlay.closing{animation:payFadeOut .35s ease forwards;}
.pay-success-modal{
  position:relative; overflow:hidden;
  width:min(760px, 96vw);
  border-radius:30px;
  padding:34px 34px 24px;
  color:#e5eefc;
  background:linear-gradient(135deg,#081225 0%, #102343 52%, #0f3b2f 100%);
  box-shadow:0 25px 80px rgba(2,6,23,.5), inset 0 1px 0 rgba(255,255,255,.15);
  border:1px solid rgba(255,255,255,.14);
  animation:payPopIn .38s cubic-bezier(.2,.9,.2,1.15);
}
.pay-success-ribbon{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 14px; border-radius:999px;
  background:linear-gradient(90deg,#22c55e,#38bdf8);
  color:#fff; font-size:12px; font-weight:800; letter-spacing:.12em;
  box-shadow:0 8px 30px rgba(56,189,248,.25);
  margin-bottom:16px;
}
.pay-success-icon-wrap{position:relative; width:116px; height:116px; margin:0 auto 16px;}
.pay-success-ring{
  position:absolute; inset:0; border-radius:50%;
  background:conic-gradient(from 0deg,#22c55e,#38bdf8,#facc15,#22c55e);
  animation:paySpin 5s linear infinite;
  filter:drop-shadow(0 0 22px rgba(34,197,94,.35));
}
.pay-success-ring::after{
  content:''; position:absolute; inset:10px; border-radius:50%;
  background:rgba(8,18,37,.92); border:1px solid rgba(255,255,255,.08);
}
.pay-success-icon{
  position:absolute; inset:18px; z-index:1; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:42px; font-weight:900; color:#fff;
  background:linear-gradient(135deg,#16a34a,#22c55e);
  box-shadow:0 10px 35px rgba(34,197,94,.35);
  animation:payPulse 1.6s ease-in-out infinite;
}
.pay-success-modal h2{
  margin:0; text-align:center; color:#fff;
  font-size:34px; line-height:1.08; font-weight:900;
}
.pay-success-amount{
  margin:10px 0 12px; text-align:center; font-size:42px; font-weight:900;
  color:#d9f99d; text-shadow:0 10px 30px rgba(34,197,94,.25);
  animation:payGlow 1.8s ease-in-out infinite alternate;
}
.pay-success-message{
  margin:0 auto 18px; max-width:640px; text-align:center; color:#dbeafe;
  font-size:15px; line-height:1.65;
}
.pay-success-grid{
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px;
  margin:18px 0 16px;
}
.pay-success-card{
  border-radius:18px; padding:14px 16px;
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.09);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
}
.pay-success-card.full{grid-column:1 / -1;}
.pay-success-card span{display:block; font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:#93c5fd; margin-bottom:6px;}
.pay-success-card strong{display:block; color:#fff; font-size:15px; line-height:1.4;}
.pay-success-progress{height:10px; background:rgba(255,255,255,.08); border-radius:999px; overflow:hidden; margin:8px 0 18px;}
.pay-success-progress-bar{
  height:100%; width:100%; transform-origin:left center;
  background:linear-gradient(90deg,#22c55e,#38bdf8,#facc15);
  animation:payBar 8s linear forwards;
}
.pay-success-footer{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
}
.pay-success-lema{font-size:13px; line-height:1.55; color:#bfdbfe; max-width:460px;}
.pay-success-btn{
  border:none; cursor:pointer; border-radius:14px; padding:14px 22px;
  color:#fff; font-weight:800; font-size:14px;
  background:linear-gradient(135deg,#2563eb,#0ea5e9);
  box-shadow:0 12px 28px rgba(37,99,235,.32);
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.pay-success-btn:hover{transform:translateY(-1px) scale(1.02); filter:brightness(1.05);}
.pay-success-close{
  position:absolute; top:14px; right:14px; z-index:2;
  width:42px; height:42px; border-radius:50%;
  border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.08);
  color:#fff; font-size:26px; cursor:pointer;
}
.pay-success-bg-orb{position:absolute; border-radius:50%; filter:blur(6px); opacity:.45; pointer-events:none;}
.pay-success-bg-orb.orb-1{width:180px;height:180px;top:-55px;left:-45px;background:radial-gradient(circle,#38bdf8,transparent 70%); animation:floatOrb 7s ease-in-out infinite;}
.pay-success-bg-orb.orb-2{width:210px;height:210px;right:-60px;bottom:-80px;background:radial-gradient(circle,#22c55e,transparent 70%); animation:floatOrb 9s ease-in-out infinite reverse;}
.pay-success-bg-orb.orb-3{width:130px;height:130px;right:14%;top:26%;background:radial-gradient(circle,#facc15,transparent 70%); animation:floatOrb 6s ease-in-out infinite;}
.pay-success-burst .coin{
  position:absolute; font-size:24px; opacity:0; z-index:1; pointer-events:none;
  animation:coinFloat 2.8s ease-in-out infinite;
}
.pay-success-burst .c1{left:11%; top:18%; animation-delay:.1s;}
.pay-success-burst .c2{right:11%; top:20%; animation-delay:.5s;}
.pay-success-burst .c3{left:18%; bottom:24%; animation-delay:.9s;}
.pay-success-burst .c4{right:20%; bottom:20%; animation-delay:1.2s;}
.pay-success-burst .c5{left:50%; top:10%; animation-delay:1.5s;}
@keyframes payFadeIn{from{opacity:0}to{opacity:1}}
@keyframes payFadeOut{to{opacity:0}}
@keyframes payPopIn{from{opacity:0;transform:translateY(18px) scale(.92)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes paySpin{to{transform:rotate(360deg)}}
@keyframes payPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.06)}}
@keyframes payGlow{from{text-shadow:0 0 0 rgba(217,249,157,0)}to{text-shadow:0 0 28px rgba(217,249,157,.28)}}
@keyframes payBar{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes floatOrb{0%,100%{transform:translateY(0) translateX(0)}50%{transform:translateY(18px) translateX(8px)}}
@keyframes coinFloat{0%{opacity:0;transform:translateY(18px) scale(.7) rotate(0deg)}18%{opacity:1}55%{opacity:1}100%{opacity:0;transform:translateY(-28px) scale(1.18) rotate(18deg)}}
@media (max-width: 768px){
  .pay-success-modal{padding:24px 18px 20px;border-radius:24px;}
  .pay-success-modal h2{font-size:26px;}
  .pay-success-amount{font-size:32px;}
  .pay-success-grid{grid-template-columns:1fr;}
  .pay-success-card.full{grid-column:auto;}
  .pay-success-footer{flex-direction:column; align-items:stretch;}
  .pay-success-btn{width:100%;}
}



/* =========================================================
   FIX MODAL PAGO: OCULTAR BOTONES LATERALES Y ACCIONES DEL FONDO
   ========================================================= */

/* Overlay por encima de toda la plataforma */
.pay-success-overlay{
  position:fixed!important;
  inset:0!important;
  z-index:2147483646!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}

/* Modal por encima del overlay */
.pay-success-modal{
  position:relative!important;
  z-index:2147483647!important;
}

/* Mientras el modal está abierto, los botones de la tabla NO deben verse */
body.pay-success-open .paid-action,
body.pay-success-open .paid-done,
body.pay-success-open .row-actions,
body.pay-success-open .mini-btn,
body.pay-success-open td:last-child button,
body.pay-success-open td:last-child a,
body.pay-success-open .negotiated-table .row-actions,
body.pay-success-open .negotiated-table td:last-child,
body.pay-success-open #negotiatedBody .row-actions,
body.pay-success-open #negotiatedBody td:last-child{
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
  z-index:0!important;
}

/* El fondo queda bloqueado, pero el modal sigue activo */
body.pay-success-open .app,
body.pay-success-open .main,
body.pay-success-open .content,
body.pay-success-open .page,
body.pay-success-open .layout,
body.pay-success-open .dashboard,
body.pay-success-open .commercial-section,
body.pay-success-open .negotiated-table{
  pointer-events:none!important;
}

/* Permitir interacción dentro del modal */
body.pay-success-open .pay-success-overlay,
body.pay-success-open .pay-success-overlay *,
body.pay-success-open .pay-success-modal,
body.pay-success-open .pay-success-modal *{
  pointer-events:auto!important;
  visibility:visible!important;
  opacity:1!important;
}

/* Baja z-index normal de botones de pago cuando NO hay modal */
.paid-action,
.paid-done,
.row-actions .mini-btn{
  z-index:1!important;
}

/* Evita que íconos flotantes de acciones queden encima del overlay */
body.pay-success-open .fa-money-bill-wave,
body.pay-success-open .fa-circle-check{
  z-index:0!important;
}

/* El contenido animado siempre visible */
.pay-success-burst,
.pay-success-burst *,
.pay-success-icon-wrap,
.pay-success-icon,
.pay-success-ring{
  visibility:visible!important;
  opacity:1!important;
}



/* =========================================================
   GESTIÓN COMERCIAL - SELECTOR DE MES PARA TODOS LOS ROLES
   ========================================================= */
.commercial-filters #negotiatedMonth.negotiated-month-select{
  min-width:180px!important;
  height:42px!important;
  border:1px solid #dbe3ef!important;
  border-radius:12px!important;
  background:#ffffff!important;
  color:#0f172a!important;
  font-size:14px!important;
  padding:0 38px 0 12px!important;
  outline:none!important;
  cursor:pointer!important;
  box-shadow:0 1px 2px rgba(15,23,42,.04)!important;
}
.commercial-filters #negotiatedMonth.negotiated-month-select:focus{
  border-color:#2563eb!important;
  box-shadow:0 0 0 3px rgba(37,99,235,.12)!important;
}
@media(max-width:900px){
  .commercial-filters #negotiatedMonth.negotiated-month-select{
    width:100%!important;
    min-width:100%!important;
  }
}



/* =========================================================
   GESTIÓN COMERCIAL - BOTÓN MOVER A MES
   ========================================================= */
.mini-btn.move-month-action{
  color:#7c3aed!important;
  background:#f5f3ff!important;
  border-color:#ddd6fe!important;
}
.mini-btn.move-month-action:hover{
  color:#fff!important;
  background:#7c3aed!important;
  border-color:#7c3aed!important;
}



/* =========================================================
   GESTIÓN COMERCIAL - EDICIÓN DE ORDEN Y FACTURA
   ========================================================= */
#entityModal input[name="order_number"],
#entityModal input[name="invoice_number"]{
  font-weight:700!important;
  letter-spacing:.01em;
}

body.sidebar-collapsed .brand-ico img{width:30px;height:30px;}



/* =========================================================
   GESTIÓN COMERCIAL - BOTÓN TRASLADAR MES ADMIN/SUPERVISOR
   ========================================================= */
.mini-btn.move-month-action{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  color:#7c3aed!important;
  background:#f5f3ff!important;
  border-color:#ddd6fe!important;
  cursor:pointer!important;
}
.mini-btn.move-month-action:hover{
  color:#fff!important;
  background:#7c3aed!important;
  border-color:#7c3aed!important;
}



/* =========================================================
   GESTIÓN COMERCIAL - COLUMNAS COMPACTAS Y ACCIONES EN UNA LÍNEA
   ========================================================= */

/* Tabla de oportunidades: evita que acciones bajen a segunda línea */
.negotiated-table{
  table-layout:fixed!important;
  width:100%!important;
}

.negotiated-table th,
.negotiated-table td{
  vertical-align:middle!important;
}

/* Anchos compactos de columnas clave */
.negotiated-table th:nth-child(6),
.negotiated-table td:nth-child(6){
  width:105px!important;
  min-width:105px!important;
  max-width:105px!important;
  white-space:nowrap!important;
  text-align:left!important;
}

.negotiated-table th:nth-child(7),
.negotiated-table td:nth-child(7){
  width:96px!important;
  min-width:96px!important;
  max-width:96px!important;
  white-space:normal!important;
  word-break:break-word!important;
}

.negotiated-table th:nth-child(8),
.negotiated-table td:nth-child(8){
  width:105px!important;
  min-width:105px!important;
  max-width:105px!important;
  white-space:normal!important;
  word-break:break-word!important;
}

.negotiated-table th:nth-child(9),
.negotiated-table td:nth-child(9){
  width:90px!important;
  min-width:90px!important;
  max-width:90px!important;
  white-space:nowrap!important;
}

/* Acciones siempre en una sola línea */
.negotiated-table th:nth-child(11),
.negotiated-table td:nth-child(11){
  width:168px!important;
  min-width:168px!important;
  max-width:168px!important;
  white-space:nowrap!important;
  text-align:center!important;
}

.negotiated-table .row-actions{
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  justify-content:center!important;
  gap:5px!important;
  min-width:0!important;
  width:auto!important;
}

.negotiated-table .row-actions .mini-btn,
.negotiated-table .row-actions button,
.negotiated-table .row-actions a{
  flex:0 0 27px!important;
  width:27px!important;
  height:27px!important;
  min-width:27px!important;
  max-width:27px!important;
  padding:0!important;
  margin:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border-radius:7px!important;
  font-size:11px!important;
  line-height:1!important;
}

/* Ajuste de columnas amplias para recuperar espacio */
.negotiated-table th:nth-child(1),
.negotiated-table td:nth-child(1){
  width:230px!important;
  max-width:230px!important;
}

.negotiated-table th:nth-child(2),
.negotiated-table td:nth-child(2){
  width:245px!important;
  max-width:245px!important;
}

.negotiated-table th:nth-child(3),
.negotiated-table td:nth-child(3){
  width:105px!important;
  max-width:105px!important;
  white-space:nowrap!important;
}

.negotiated-table th:nth-child(4),
.negotiated-table td:nth-child(4){
  width:135px!important;
  max-width:135px!important;
}

.negotiated-table th:nth-child(10),
.negotiated-table td:nth-child(10){
  width:1px!important;
  max-width:1px!important;
  padding:0!important;
  overflow:hidden!important;
}

/* Responsive: permite scroll horizontal si el navegador es estrecho */
.table-wrap{
  overflow-x:auto!important;
}

@media(max-width:1400px){
  .negotiated-table th:nth-child(1),
  .negotiated-table td:nth-child(1){width:210px!important;max-width:210px!important;}
  .negotiated-table th:nth-child(2),
  .negotiated-table td:nth-child(2){width:220px!important;max-width:220px!important;}
  .negotiated-table th:nth-child(11),
  .negotiated-table td:nth-child(11){width:160px!important;min-width:160px!important;max-width:160px!important;}
  .negotiated-table .row-actions{gap:4px!important;}
  .negotiated-table .row-actions .mini-btn,
  .negotiated-table .row-actions button,
  .negotiated-table .row-actions a{
    flex-basis:26px!important;
    width:26px!important;
    height:26px!important;
    min-width:26px!important;
  }
}



/* =========================================================
   DASHBOARD - INSIGHTS CLICKEABLES CON MODAL DE DETALLE
   ========================================================= */
.insight-clickable{
  cursor:pointer!important;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.insight-clickable:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 34px rgba(15,23,42,.10);
}
.insight-clickable:active{transform:translateY(0);}

.insight-modal-overlay{
  position:fixed;
  inset:0;
  z-index:999999;
  background:rgba(15,23,42,.55);
  backdrop-filter:blur(7px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  animation:insightFadeIn .2s ease-out;
}
.insight-modal-overlay.closing{animation:insightFadeOut .25s ease forwards;}
.insight-modal{
  width:min(820px,96vw);
  max-height:86vh;
  overflow:hidden;
  border-radius:24px;
  background:#fff;
  box-shadow:0 26px 80px rgba(15,23,42,.28);
  border:1px solid #e5e7eb;
  animation:insightPop .25s ease-out;
}
.insight-modal-head{
  display:flex;
  gap:16px;
  align-items:flex-start;
  padding:24px 26px;
  border-bottom:1px solid #eef2f7;
}
.insight-modal-icon{
  width:52px;
  height:52px;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-size:22px;
  flex:0 0 52px;
}
.insight-modal-icon.blue{background:#2563eb;}
.insight-modal-icon.green{background:#10b981;}
.insight-modal-icon.amber{background:#f59e0b;}
.insight-modal-head h2{
  margin:0 0 6px;
  font-size:22px;
  color:#0f172a;
  font-weight:800;
}
.insight-modal-head p{
  margin:0;
  color:#334155;
  font-size:14px;
  line-height:1.55;
}
.insight-modal-content{
  padding:18px 26px;
  max-height:48vh;
  overflow:auto;
  background:#f8fafc;
}
.insight-modal-row{
  display:flex;
  gap:13px;
  padding:14px;
  margin-bottom:10px;
  border-radius:16px;
  background:#fff;
  border:1px solid #e5e7eb;
}
.insight-modal-index{
  width:28px;
  height:28px;
  border-radius:9px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#eff6ff;
  color:#2563eb;
  font-weight:800;
  font-size:12px;
  flex:0 0 28px;
}
.insight-modal-row-body strong{
  display:block;
  color:#0f172a;
  font-size:14px;
  margin-bottom:4px;
}
.insight-modal-row-body span{
  display:block;
  color:#334155;
  font-size:13px;
  margin-bottom:3px;
}
.insight-modal-row-body small{
  display:block;
  color:#64748b;
  font-size:12px;
}
.insight-modal-footer{
  display:flex;
  justify-content:flex-end;
  padding:16px 26px 22px;
  border-top:1px solid #eef2f7;
}
.insight-modal-close{
  position:absolute;
  margin-left:calc(min(820px,96vw) - 54px);
  margin-top:12px;
  width:36px;
  height:36px;
  border-radius:999px;
  border:1px solid #e2e8f0;
  background:#fff;
  color:#0f172a;
  font-size:24px;
  cursor:pointer;
  z-index:2;
}
body.insight-modal-open{overflow:hidden;}
@keyframes insightFadeIn{from{opacity:0}to{opacity:1}}
@keyframes insightFadeOut{to{opacity:0}}
@keyframes insightPop{from{opacity:0;transform:translateY(12px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:700px){
  .insight-modal-head{padding:20px;}
  .insight-modal-content{padding:14px 16px;max-height:55vh;}
  .insight-modal-footer{padding:14px 16px 18px;}
  .insight-modal-close{right:18px;margin-left:0;}
}



/* =========================================================
   DASHBOARD - ALERTAS DE LICENCIAS AGRUPADAS
   ========================================================= */
.insight-modal-group{
  margin:14px 0 8px;
  padding:8px 12px;
  border-radius:12px;
  font-size:12px;
  font-weight:900;
  letter-spacing:.04em;
  text-transform:uppercase;
  background:#eef2ff;
  color:#1e40af;
}
.insight-modal-group.danger{background:#fef2f2;color:#b91c1c;}
.insight-modal-group.warning{background:#fffbeb;color:#b45309;}
.insight-modal-group.info{background:#eff6ff;color:#1d4ed8;}
.insight-modal-row.danger{border-color:#fecaca;background:#fffafa;}
.insight-modal-row.warning{border-color:#fde68a;background:#fffdf4;}
.insight-modal-row.info{border-color:#bfdbfe;background:#f8fbff;}
.insight-modal-row.danger .insight-modal-index{background:#fee2e2;color:#b91c1c;}
.insight-modal-row.warning .insight-modal-index{background:#fef3c7;color:#b45309;}
.insight-modal-row.info .insight-modal-index{background:#dbeafe;color:#1d4ed8;}



/* =========================================================
   SOPORTE TÉCNICO
   ========================================================= */
.support-table th:nth-child(1), .support-table td:nth-child(1){width:150px}
.support-table th:nth-child(2), .support-table td:nth-child(2){width:220px}
.support-table th:nth-child(3), .support-table td:nth-child(3){width:150px}
.support-table th:nth-child(5), .support-table td:nth-child(5){width:260px}
.support-files-list{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.support-file-pill{
  display:flex;
  align-items:center;
  gap:7px;
  padding:7px 9px;
  border:1px solid #dbeafe;
  background:#f8fbff;
  color:#0f172a;
  border-radius:10px;
  text-decoration:none;
  max-width:260px;
}
.support-file-pill:hover{background:#eff6ff;border-color:#93c5fd}
.support-file-pill span{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  flex:1;
  font-weight:700;
  font-size:12px;
}
.support-file-pill small{color:#64748b;font-size:11px;white-space:nowrap}
.support-form textarea{resize:vertical}
.global-new-card.cyan .global-new-ico,
.stat-icon.cyan{background:linear-gradient(135deg,#06b6d4,#2563eb)!important;color:#fff!important}



/* =========================================================
   SOPORTE TÉCNICO - REPORTE, CALIFICACIÓN Y ENVÍO
   ========================================================= */
.support-table th:nth-child(1), .support-table td:nth-child(1){width:145px!important}
.support-table th:nth-child(2), .support-table td:nth-child(2){width:190px!important}
.support-table th:nth-child(3), .support-table td:nth-child(3){width:260px!important}
.support-table th:nth-child(4), .support-table td:nth-child(4){width:230px!important}
.support-table th:nth-child(5), .support-table td:nth-child(5){width:230px!important}
.support-table th:nth-child(6), .support-table td:nth-child(6){width:230px!important;text-align:center!important}
.support-table th:nth-child(7), .support-table td:nth-child(7){width:92px!important;text-align:center!important}
.support-report-btn{display:inline-flex;align-items:center;gap:8px;border:1px solid #bfdbfe;background:#eff6ff;color:#1d4ed8;border-radius:10px;padding:8px 10px;font-weight:800;cursor:pointer}
.support-report-btn.has-report{background:#ecfdf5;border-color:#bbf7d0;color:#15803d}
.support-report-view{max-width:230px;font-size:12px;line-height:1.45;color:#334155}
.support-stars{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:2px}
.support-stars button{border:0;background:transparent;color:#cbd5e1;cursor:pointer;padding:2px;font-size:15px}
.support-stars button.active{color:#f59e0b}
.support-stars.can-rate button:hover{color:#fbbf24;transform:scale(1.1)}
.support-stars button:disabled{cursor:default}
.support-stars small{display:block;width:100%;font-size:10px;color:#64748b;margin-top:2px}
.send-report-action{color:#2563eb!important;background:#eff6ff!important;border-color:#bfdbfe!important}
.send-report-action:hover{color:#fff!important;background:#2563eb!important}



/* =========================================================
   EDITOR RICH TEXT - REPORTE DE SOPORTE
   ========================================================= */
.rich-editor-wrap{border:1px solid #cbd5e1;border-radius:14px;overflow:hidden;background:#fff}
.rich-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:2px;padding:6px;background:#f8fafc;border-bottom:1px solid #e2e8f0}
.rich-toolbar button,.rich-toolbar select,.rich-color{min-height:30px;border:1px solid transparent;background:transparent;color:#0f172a;border-radius:7px;padding:4px 8px;display:inline-flex;align-items:center;justify-content:center;gap:5px;font-size:13px;cursor:pointer}
.rich-toolbar button:hover,.rich-toolbar select:hover,.rich-color:hover{background:#e2e8f0;border-color:#cbd5e1}
.rich-toolbar select{background:#fff;border-color:#dbe3ef;min-width:95px}
.rich-color input{width:18px;height:18px;padding:0;border:0;background:transparent;cursor:pointer}
.rich-sep{width:1px;height:24px;background:#cbd5e1;margin:0 4px}
.rich-editor{min-height:190px;padding:14px;outline:none;font-family:Verdana,Arial,sans-serif;font-size:13px;line-height:1.6;color:#0f172a;background:#fff}
.rich-editor:focus{box-shadow:inset 0 0 0 2px rgba(37,99,235,.45)}
.rich-editor:empty:before{content:attr(data-placeholder);color:#94a3b8}
.rich-editor table{border-collapse:collapse;width:100%}
.rich-editor td,.rich-editor th{border:1px solid #cbd5e1;padding:6px}
@media(max-width:900px){.rich-toolbar{gap:3px}.rich-toolbar select{min-width:82px}.rich-editor{min-height:170px}}



/* =========================================================
   GESTIÓN COMERCIAL - FILTRO PENDIENTE DE PAGO
   ========================================================= */
#negotiatedStatusFilter option[value="pendiente_pago"]{
  font-weight:700;
}



/* =========================================================
   CHAT - BURBUJAS DE MENSAJES NO LEÍDOS CON FOTO Y NOMBRE
   ========================================================= */
.chat-unread-bubbles{
  position:fixed!important;
  left:auto!important;
  right:92px!important;
  bottom:24px!important;
  z-index:9997!important;
  display:none;
  flex-direction:column!important;
  align-items:flex-end!important;
  gap:10px!important;
  pointer-events:auto!important;
}
.chat-unread-person{
  position:relative!important;
  min-width:220px!important;
  max-width:290px!important;
  min-height:56px!important;
  padding:8px 12px 8px 8px!important;
  border-radius:18px!important;
  border:1px solid #dbeafe!important;
  background:#ffffff!important;
  color:#0f172a!important;
  box-shadow:0 14px 30px rgba(15,23,42,.14)!important;
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:10px!important;
  cursor:pointer!important;
  text-align:left!important;
  animation:chatUnreadPop .28s ease-out, chatUnreadPulse 1.9s ease-in-out infinite!important;
}
.chat-unread-person:hover{
  transform:translateX(3px)!important;
  box-shadow:0 18px 34px rgba(15,23,42,.18)!important;
}
.chat-unread-avatar{display:flex!important;align-items:center!important;justify-content:center!important}
.chat-unread-avatar .chat-avatar{box-shadow:0 10px 22px rgba(37,99,235,.16)!important}
.chat-unread-person-main{min-width:0!important;display:flex!important;flex-direction:column!important;gap:2px!important}
.chat-unread-person-main strong{font-size:12.5px!important;line-height:1.2!important;font-weight:900!important;color:#0f172a!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.chat-unread-person-main small{font-size:11px!important;line-height:1.3!important;color:#64748b!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.chat-unread-person em{
  position:static!important;
  min-width:22px!important;
  height:22px!important;
  padding:0 6px!important;
  border-radius:999px!important;
  background:#ef4444!important;
  color:#fff!important;
  border:2px solid #fff!important;
  font-size:10px!important;
  line-height:18px!important;
  font-style:normal!important;
  font-weight:900!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}
.chat-unread-extra{
  margin-left:14px!important;
  min-width:38px!important;
  height:34px!important;
  padding:0 10px!important;
  border-radius:999px!important;
  background:#111827!important;
  color:#fff!important;
  border:2px solid #fff!important;
  box-shadow:0 8px 20px rgba(15,23,42,.25)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:11px!important;
  font-weight:900!important;
}
.chat-panel.open ~ .chat-unread-bubbles,
body:has(.chat-panel.open) .chat-unread-bubbles{
  display:none!important;
}
@keyframes chatUnreadPop{
  from{opacity:0;transform:translateX(14px) scale(.92)}
  to{opacity:1;transform:translateX(0) scale(1)}
}
@keyframes chatUnreadPulse{
  0%,100%{box-shadow:0 14px 30px rgba(15,23,42,.14)}
  50%{box-shadow:0 16px 34px rgba(37,99,235,.18),0 0 0 6px rgba(37,99,235,.06)}
}
@media(max-width:700px){
  .chat-unread-bubbles{left:auto!important;right:78px!important;bottom:82px!important;max-width:calc(100vw - 88px)!important}
  .chat-unread-person{min-width:0!important;width:min(290px,calc(100vw - 20px))!important;max-width:calc(100vw - 20px)!important}
}



/* =========================================================
   CHAT - SONIDO Y ALERTA DE MENSAJE NUEVO
   ========================================================= */
.chat-fab.has-new-message{
  animation:chatNewMsgShake .45s ease-in-out 2!important;
}
@keyframes chatNewMsgShake{
  0%,100%{transform:translateX(0) scale(1)}
  20%{transform:translateX(-2px) scale(1.03)}
  40%{transform:translateX(2px) scale(1.03)}
  60%{transform:translateX(-2px) scale(1.03)}
  80%{transform:translateX(2px) scale(1.03)}
}

/* ================= ALERTAS GLOBALES ================= */

.btn-alertas-global{
  position:relative;
  background:linear-gradient(135deg,#dc2626,#991b1b)!important;
  box-shadow:0 4px 14px rgba(220,38,38,.35)!important;
}

.btn-alertas-global:hover{
  transform:translateY(-1px);
  box-shadow:0 7px 20px rgba(220,38,38,.45)!important;
}

.alertas-count{
  position:absolute;
  top:-7px;
  right:-7px;
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:999px;
  background:#fff;
  color:#dc2626;
  border:2px solid #dc2626;
  font-size:10.5px;
  font-weight:900;
  display:none;
  align-items:center;
  justify-content:center;
  line-height:1;
}

.alertas-count.show{
  display:inline-flex;
}

.alertas-panel{
  position:fixed;
  top:var(--header-h);
  right:14px;
  width:420px;
  max-width:calc(100vw - 24px);
  background:#fff;
  border:1.5px solid #fecaca;
  border-radius:16px;
  box-shadow:0 18px 45px rgba(127,29,29,.18);
  z-index:180;
  display:none;
  overflow:hidden;
}

.alertas-panel.open{
  display:block;
  animation:slideDown .2s ease;
}

.alertas-hdr{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  background:linear-gradient(135deg,#fff1f2,#ffffff);
  border-bottom:1px solid #fee2e2;
}

.alertas-hdr strong{
  display:block;
  color:#7f1d1d;
  font-size:14px;
  font-weight:900;
}

.alertas-hdr small{
  display:block;
  color:#991b1b;
  font-size:11px;
  margin-top:2px;
}

.alertas-hdr button{
  width:30px;
  height:30px;
  border-radius:9px;
  background:#fff;
  color:#991b1b;
  border:1px solid #fecaca;
  cursor:pointer;
}

.alertas-list{
  max-height:430px;
  overflow-y:auto;
  padding:8px;
}

.alerta-item{
  display:grid;
  grid-template-columns:34px 1fr auto;
  gap:10px;
  align-items:flex-start;
  padding:11px;
  border-radius:13px;
  border:1px solid #f1f5f9;
  background:#fff;
  margin-bottom:8px;
  cursor:pointer;
  transition:.18s ease;
}

.alerta-item:hover{
  background:#f8fafc;
  transform:translateY(-1px);
}

.alerta-ico{
  width:34px;
  height:34px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
}

.alerta-ico.red{
  background:#fee2e2;
  color:#dc2626;
}

.alerta-ico.orange{
  background:#ffedd5;
  color:#ea580c;
}

.alerta-ico.blue{
  background:#dbeafe;
  color:#2563eb;
}

.alerta-ico.green{
  background:#dcfce7;
  color:#16a34a;
}

.alerta-body strong{
  display:block;
  font-size:12.5px;
  color:#0f172a;
  line-height:1.25;
}

.alerta-body span{
  display:block;
  font-size:11.3px;
  color:#64748b;
  margin-top:3px;
  line-height:1.35;
}

.alerta-tag{
  font-size:10px;
  font-weight:800;
  padding:4px 7px;
  border-radius:999px;
  background:#f1f5f9;
  color:#475569;
  white-space:nowrap;
}

.alertas-empty{
  text-align:center;
  color:#64748b;
  font-size:12px;
  padding:28px 12px;
}

@media(max-width:700px){
  .btn-alertas-global span,
  .btn-map-clientes span,
  #btnNew span{
    display:none!important;
  }

  .alertas-panel{
    left:10px!important;
    right:10px!important;
    width:auto!important;
  }
}


/* Agrupación y enfoque para Alertas Globales */
.alertas-module-group{
  padding:6px 2px 10px;
  border-bottom:1px solid #f1f5f9;
}
.alertas-module-group:last-child{
  border-bottom:0;
}
.alertas-module-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:7px 8px 9px;
  color:#7f1d1d;
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.035em;
}
.alertas-module-title b{
  min-width:22px;
  height:22px;
  padding:0 7px;
  border-radius:999px;
  background:#fee2e2;
  color:#b91c1c;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
}
.alerta-row-focus{
  position:relative!important;
  outline:2px solid rgba(220,38,38,.38)!important;
  box-shadow:0 0 0 4px rgba(254,202,202,.44), 0 10px 24px rgba(220,38,38,.14)!important;
  border-radius:10px!important;
  animation:alertaFocusRedGradient 1s ease-in-out 3!important;
}

.alerta-row-focus td,
.alerta-row-focus th,
.alerta-row-focus > *,
.alerta-row-focus .order-org-name,
.alerta-row-focus .order-org-meta,
.alerta-row-focus .badge,
.alerta-cell-focus{
  animation:alertaCellRedGradient 1s ease-in-out 3!important;
}

@keyframes alertaFocusRedGradient{
  0%,100%{
    transform:scale(1);
    filter:none;
  }
  50%{
    transform:scale(1.006);
    filter:drop-shadow(0 0 8px rgba(220,38,38,.28));
  }
}

@keyframes alertaCellRedGradient{
  0%,100%{
    background:inherit;
    color:inherit;
  }
  50%{
    background:linear-gradient(90deg,rgba(254,226,226,.98) 0%,rgba(248,113,113,.46) 48%,rgba(255,255,255,.92) 100%)!important;
    color:#111827;
  }
}

/* Alertas por módulos principales plegables */
.alertas-module-accordion{
  border:1px solid #f1f5f9;
  border-radius:15px;
  background:#fff;
  margin:8px 2px;
  overflow:hidden;
  box-shadow:0 6px 18px rgba(15,23,42,.04);
}

.alertas-module-accordion[open]{
  border-color:#fecaca;
  box-shadow:0 10px 25px rgba(127,29,29,.08);
}

.alertas-module-summary{
  list-style:none;
  cursor:pointer;
  user-select:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 13px;
  background:linear-gradient(135deg,#ffffff,#f8fafc);
}

.alertas-module-summary::-webkit-details-marker{display:none;}

.alertas-module-left{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.alertas-module-icon{
  width:38px;
  height:38px;
  border-radius:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  font-size:15px;
}

.alertas-module-icon.red{background:#fee2e2;color:#dc2626;}
.alertas-module-icon.orange{background:#ffedd5;color:#ea580c;}
.alertas-module-icon.blue{background:#dbeafe;color:#2563eb;}
.alertas-module-icon.green{background:#dcfce7;color:#16a34a;}

.alertas-module-info{
  display:flex;
  flex-direction:column;
  min-width:0;
}

.alertas-module-info strong{
  color:#111827;
  font-size:13px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.015em;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.alertas-module-info small{
  color:#64748b;
  font-size:11px;
  margin-top:3px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.alertas-module-right{
  display:flex;
  align-items:center;
  gap:9px;
  flex:0 0 auto;
}

.alertas-module-right b{
  min-width:26px;
  height:24px;
  padding:0 8px;
  border-radius:999px;
  background:#fee2e2;
  color:#b91c1c;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  font-weight:900;
}

.alertas-chevron{
  color:#94a3b8;
  font-size:12px;
  transition:transform .2s ease;
}

.alertas-module-accordion[open] .alertas-chevron{
  transform:rotate(180deg);
  color:#dc2626;
}

.alertas-module-records{
  padding:8px;
  border-top:1px solid #f1f5f9;
  background:#fff;
}

.alertas-module-records .alerta-item:last-child{margin-bottom:0;}

/* ===== CANCELACIÓN DE PEDIDO DE COTIZACIÓN ===== */
.cancel-quote-btn{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  width:auto!important;
  min-width:max-content!important;
  max-width:none!important;
  height:auto!important;
  min-height:31px!important;
  padding:7px 14px!important;
  border-radius:999px!important;
  border:1px solid #f5b5b5!important;
  background:#fdecec!important;
  color:#c62828!important;
  font-size:12px!important;
  font-weight:800!important;
  line-height:1.1!important;
  white-space:nowrap!important;
  overflow:visible!important;
  text-overflow:clip!important;
  box-sizing:border-box!important;
}
.cancel-quote-btn i{
  flex:0 0 auto!important;
  width:auto!important;
  height:auto!important;
  font-size:11px!important;
  line-height:1!important;
}
.cancel-quote-btn span{
  display:inline-block!important;
  width:auto!important;
  max-width:none!important;
  min-width:max-content!important;
  white-space:nowrap!important;
  overflow:visible!important;
  text-overflow:clip!important;
}
.cancel-quote-btn:hover{
  background:#fbdede!important;
  border-color:#ef9a9a!important;
  color:#991b1b!important;
}
.quote-actions-inline,
.quote-status-wrap,
.quote-status-cell{
  overflow:visible!important;
}
.quote-actions-inline .cancel-quote-btn{
  width:auto!important;
  min-width:max-content!important;
  max-width:none!important;
}
.cancel-box{
  background:#fff7ed!important;
  border-color:#fed7aa!important;
  color:#9a3412!important;
}
@media(max-width:700px){
  .quote-actions-inline{
    grid-template-columns:1fr!important;
  }
  .cancel-quote-btn,
  .quote-actions-inline .cancel-quote-btn{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
}

/* ================= FILTROS ESTADOS DE PAGO ================= */
.payment-filter-bar{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin:12px 0 14px;
}
.payment-search-box{
  position:relative;
  width:min(360px,100%);
}
.payment-search-box i{
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
  color:#94a3b8;
  font-size:13px;
  pointer-events:none;
}
.payment-search-box input{
  width:100%;
  height:38px;
  border:1px solid #dbe3ef;
  background:#fff;
  border-radius:10px;
  padding:0 12px 0 36px;
  font-size:13px;
  color:#0f172a;
  outline:none;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}
.payment-search-box input:focus{
  border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(37,99,235,.12);
}
.payment-filter-buttons{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
}
.payment-filter-btn{
  height:38px;
  border:1px solid #dbe3ef;
  background:#fff;
  color:#334155;
  border-radius:10px;
  padding:0 16px;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
  transition:.18s ease;
}
.payment-filter-btn:hover{
  transform:translateY(-1px);
  border-color:#2563eb;
  color:#1d4ed8;
}
.payment-filter-btn.active{
  background:#2563eb;
  color:#fff;
  border-color:#2563eb;
  box-shadow:0 8px 18px rgba(37,99,235,.18);
}
@media(max-width:700px){
  .payment-filter-bar{align-items:stretch;}
  .payment-search-box{width:100%;}
  .payment-filter-buttons{width:100%;}
  .payment-filter-btn{flex:1; padding:0 10px;}
}


/* ===== ACCIONES DE SUSCRIPCIÓN EN ALERTAS ===== */
.alerta-item-with-action{
  grid-template-columns:34px 1fr 42px!important;
}
.alerta-subscription-wrap{
  position:relative;
  display:flex;
  align-items:flex-start;
  justify-content:flex-end;
}
.alerta-subscription-btn{
  width:34px;
  height:34px;
  border-radius:11px;
  border:1px solid #fecaca;
  background:#fff1f2;
  color:#dc2626;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:.18s ease;
}
.alerta-subscription-btn:hover{
  background:#dc2626;
  color:#fff;
  transform:translateY(-1px);
}
.alerta-subscription-menu{
  position:absolute;
  top:38px;
  right:0;
  width:170px;
  padding:6px;
  border-radius:12px;
  border:1px solid #fecaca;
  background:#fff;
  box-shadow:0 14px 34px rgba(127,29,29,.18);
  z-index:260;
  display:none;
}
.alerta-subscription-menu.open{display:block;}
.alerta-subscription-menu button{
  width:100%;
  border:0;
  background:transparent;
  color:#111827;
  font-weight:800;
  font-size:11.5px;
  padding:9px 10px;
  border-radius:9px;
  display:flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
  text-align:left;
}
.alerta-subscription-menu button:hover{background:#fef2f2;color:#991b1b;}
.subscription-detail-box{
  border-color:#fecaca!important;
  background:#fff1f2!important;
}
.subscription-detail-box h3,
.subscription-detail-box b{
  color:#b91c1c!important;
}
.subscription-detail-box p{
  color:#7f1d1d!important;
}


/* ===== ICONO DE SUSCRIPCIÓN VENCIDA EN ÓRDENES / ESTADOS DE PAGO ===== */
.order-subscription-wrap{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.order-subscription-btn{
  width:32px;
  height:32px;
  border-radius:10px;
  border:1px solid #fecaca;
  background:linear-gradient(135deg,#fff1f2,#fee2e2);
  color:#dc2626;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 4px 12px rgba(220,38,38,.12);
  transition:.18s ease;
}
.order-subscription-btn:hover{
  background:linear-gradient(135deg,#dc2626,#991b1b);
  color:#fff;
  transform:translateY(-1px);
}
.order-subscription-btn i{
  font-size:13px;
}
.order-subscription-menu{
  top:36px!important;
  right:0!important;
}
.payment-actions-only,
.action-btns{
  overflow:visible!important;
}
#pagosBody td,
#ordenesBody td{
  overflow:visible;
}

/* ================= MODAL SUSCRIPCIÓN VENCIDA ================= */
.subscription-resolution-overlay{z-index:260!important;}
.subscription-resolution-box{width:min(94vw,720px)!important;max-width:720px!important;border-radius:22px!important;overflow:hidden!important;}
.subscription-resolution-hdr{background:linear-gradient(135deg,#fff1f2,#ffffff)!important;border-bottom:1px solid #fecaca!important;}
.subscription-resolution-hdr div{display:flex;flex-direction:column;gap:3px;}
.subscription-resolution-hdr strong{font-size:15px;font-weight:900;color:#7f1d1d;}
.subscription-resolution-hdr small{font-size:11.5px;color:#991b1b;font-weight:700;}
.subscription-resolution-body{padding:18px 20px 16px;overflow:auto;}
.subscription-resolution-order{display:flex;align-items:center;gap:12px;padding:14px;border:1px solid #fecaca;background:#fff7f7;border-radius:16px;margin-bottom:14px;}
.subscription-resolution-icon{width:40px;height:40px;border-radius:13px;background:#fee2e2;color:#dc2626;display:flex;align-items:center;justify-content:center;font-size:17px;flex:0 0 auto;}
.subscription-resolution-order b{display:block;font-size:13px;color:#0f172a;font-weight:900;line-height:1.25;}
.subscription-resolution-order small{display:block;margin-top:4px;font-size:11.5px;color:#64748b;font-weight:700;line-height:1.35;}
.subscription-choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:14px;}
.subscription-choice{border:1.5px solid #dbeafe;background:#fff;border-radius:16px;padding:15px;text-align:left;cursor:pointer;transition:.18s ease;display:flex;flex-direction:column;gap:6px;min-height:118px;}
.subscription-choice i{font-size:24px;color:#16a34a;}
.subscription-choice strong{font-size:14px;color:#0f172a;font-weight:900;}
.subscription-choice span{font-size:12px;color:#64748b;font-weight:700;line-height:1.35;}
.subscription-choice:hover{transform:translateY(-1px);box-shadow:0 10px 25px rgba(15,23,42,.08);}
.subscription-choice.selected{border-color:#16a34a;background:#f0fdf4;box-shadow:0 0 0 4px rgba(34,197,94,.12);}
.subscription-choice.danger{border-color:#fecaca;}
.subscription-choice.danger i{color:#dc2626;}
.subscription-choice.danger.selected{border-color:#dc2626;background:#fff1f2;box-shadow:0 0 0 4px rgba(220,38,38,.12);}
.subscription-loss-field{padding:14px;border:1px solid #fecaca;background:#fff7f7;border-radius:16px;margin-bottom:12px;}
.subscription-loss-field label{display:block;font-size:12px;font-weight:900;color:#7f1d1d;text-transform:uppercase;letter-spacing:.03em;margin-bottom:8px;}
.subscription-loss-field label b{color:#dc2626;}
.subscription-loss-field textarea{width:100%;resize:vertical;min-height:95px;border:1.5px solid #fecaca;border-radius:12px;padding:11px 12px;font-size:13px;color:#0f172a;outline:none;}
.subscription-loss-field textarea:focus{border-color:#dc2626;box-shadow:0 0 0 4px rgba(220,38,38,.10);}
.subscription-resolution-msg{min-height:18px;color:#dc2626;font-size:12px;font-weight:800;margin:6px 0 10px;}
.subscription-submit-btn:disabled{opacity:.65;cursor:not-allowed;}
@media(max-width:700px){.subscription-choice-grid{grid-template-columns:1fr}.subscription-resolution-body{padding:14px}.subscription-resolution-order{align-items:flex-start}.subscription-resolution-box{width:100%!important}}

/* ===== SUSCRIPCIÓN RENOVADA - VINCULAR NUEVO REGISTRO ===== */
.subscription-renewed-field{
  padding:14px;
  border:1px solid #bfdbfe;
  background:#eff6ff;
  border-radius:16px;
  margin-bottom:12px;
}
.subscription-renewed-field label{
  display:block;
  font-size:12px;
  font-weight:900;
  color:#1d4ed8;
  text-transform:uppercase;
  letter-spacing:.03em;
  margin-bottom:8px;
}
.subscription-renewed-field label b{color:#dc2626;}
.subscription-renewed-search{
  position:relative;
  display:flex;
  align-items:center;
  margin-bottom:9px;
}
.subscription-renewed-search i{
  position:absolute;
  left:12px;
  color:#64748b;
  font-size:13px;
}
.subscription-renewed-search input{
  width:100%;
  border:1.5px solid #bfdbfe;
  border-radius:12px;
  padding:11px 12px 11px 34px;
  font-size:13px;
  color:#0f172a;
  outline:none;
  background:#fff;
}
.subscription-renewed-search input:focus{
  border-color:#2563eb;
  box-shadow:0 0 0 4px rgba(37,99,235,.12);
}
.subscription-renewed-selected{
  background:#fff;
  border:1px dashed #93c5fd;
  color:#1e3a8a;
  border-radius:12px;
  padding:9px 11px;
  font-size:12px;
  font-weight:800;
  margin-bottom:8px;
}
.subscription-renewed-list{
  display:flex;
  flex-direction:column;
  gap:7px;
  max-height:230px;
  overflow:auto;
}
.subscription-renewed-item{
  width:100%;
  border:1px solid #dbeafe;
  background:#fff;
  border-radius:13px;
  padding:10px 11px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  text-align:left;
  cursor:pointer;
  transition:.18s ease;
}
.subscription-renewed-item:hover,
.subscription-renewed-item.selected{
  border-color:#2563eb;
  background:#dbeafe;
}
.subscription-renewed-item b{
  display:block;
  font-size:12.5px;
  font-weight:900;
  color:#0f172a;
  line-height:1.25;
}
.subscription-renewed-item small{
  display:block;
  margin-top:3px;
  color:#475569;
  font-size:11.3px;
  font-weight:700;
  line-height:1.3;
}
.subscription-renewed-item i{color:#2563eb;}
.subscription-renewed-empty{
  color:#64748b;
  font-size:12px;
  font-weight:700;
  padding:12px;
  text-align:center;
}
.subscription-view-linked-btn{
  width:30px;
  height:30px;
  border:0;
  border-radius:10px;
  background:#dbeafe;
  color:#1d4ed8;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-left:8px;
  cursor:pointer;
  vertical-align:middle;
}
.subscription-view-linked-btn:hover{
  background:#2563eb;
  color:#fff;
}

/* ================= CHAT: EMOJIS, ADJUNTOS Y ALERTA NUEVO CHAT ================= */
.chat-new-warning{display:none!important}
@keyframes chatWarningPulse{0%,100%{transform:translateY(0);filter:brightness(1)}50%{transform:translateY(-2px);filter:brightness(1.12)}}
.chat-emoji-panel{
  display:none!important;
  position:absolute!important;
  right:70px!important;
  bottom:68px!important;
  width:258px!important;
  padding:10px!important;
  border:1px solid #dbe3ef!important;
  border-radius:16px!important;
  background:#fff!important;
  box-shadow:0 18px 40px rgba(15,23,42,.18)!important;
  z-index:10000!important;
  grid-template-columns:repeat(5,1fr)!important;
  gap:6px!important;
}
.chat-emoji-panel.open{display:grid!important}
.chat-emoji-panel button{
  height:34px!important;
  border:0!important;
  border-radius:10px!important;
  background:#f8fafc!important;
  cursor:pointer!important;
  font-size:18px!important;
}
.chat-emoji-panel button:hover{background:#eaf1ff!important;transform:translateY(-1px)!important}
.chat-tool-btn{
  width:42px!important;
  height:42px!important;
  border-radius:50%!important;
  border:1px solid #dbe3ef!important;
  background:#fff!important;
  color:#2563eb!important;
  cursor:pointer!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 42px!important;
}
.chat-tool-btn:hover{background:#eff6ff!important;border-color:#93c5fd!important}
.chat-tool-btn input{display:none!important}
.chat-tool-btn:has(input:disabled),.chat-tool-btn:disabled{opacity:.55!important;cursor:not-allowed!important}
.chat-file-preview{
  padding:8px 14px 0!important;
  gap:6px!important;
  flex-wrap:wrap!important;
  border-top:1px solid #e2e8f0!important;
  background:#fff!important;
}
.chat-file-preview span{
  display:inline-flex!important;
  align-items:center!important;
  gap:6px!important;
  max-width:260px!important;
  padding:6px 8px!important;
  border-radius:999px!important;
  background:#eff6ff!important;
  color:#1e40af!important;
  font-size:11px!important;
  font-weight:800!important;
}
.chat-file-preview button{
  border:0!important;
  background:transparent!important;
  color:#1e40af!important;
  cursor:pointer!important;
}
.chat-attachments{margin-top:8px!important;display:flex!important;flex-direction:column!important;gap:7px!important}
.chat-attach-file{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  padding:8px!important;
  border-radius:12px!important;
  background:rgba(255,255,255,.18)!important;
  border:1px solid rgba(148,163,184,.30)!important;
  color:inherit!important;
  text-decoration:none!important;
  min-width:190px!important;
}
.chat-msg.theirs .chat-attach-file{background:#f8fafc!important;color:#0f172a!important}
.chat-attach-file span{font-size:12px!important;font-weight:800!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;max-width:180px!important}
.chat-attach-file small{font-size:10px!important;opacity:.75!important;margin-left:auto!important}
.chat-attach-img{display:block!important;color:inherit!important;text-decoration:none!important}
.chat-attach-img img{display:block!important;max-width:230px!important;max-height:180px!important;border-radius:14px!important;border:1px solid rgba(148,163,184,.35)!important;object-fit:cover!important;background:#fff!important}
.chat-attach-img span{display:block!important;margin-top:4px!important;font-size:10.5px!important;opacity:.75!important;max-width:230px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.chat-input-row{position:relative!important}
@media(max-width:780px){
  .chat-new-warning{right:88px!important;left:12px!important;bottom:30px!important;justify-content:center!important}
  .chat-emoji-panel{right:12px!important;bottom:70px!important;width:240px!important}
  .chat-attach-img img{max-width:190px!important}
}

/* ================= SOPORTE TÉCNICO - DETALLE CLIENTE / MOTIVO / REPORTE ================= */
.support-table th:nth-child(1), .support-table td:nth-child(1){width:160px!important}
.support-table th:nth-child(2), .support-table td:nth-child(2){width:230px!important}
.support-table th:nth-child(3), .support-table td:nth-child(3){width:290px!important}
.support-table th:nth-child(4), .support-table td:nth-child(4){width:260px!important}
.support-table th:nth-child(5), .support-table td:nth-child(5){width:150px!important;text-align:center!important}
.support-table th:nth-child(6), .support-table td:nth-child(6){width:90px!important;text-align:center!important}
.support-created-by{display:block;margin-top:6px;color:#64748b;font-size:11px;font-weight:700;line-height:1.25}
.support-created-by i{color:#2563eb;margin-right:4px}
.support-org-link{border:0;background:transparent;color:#0f172a;text-align:left;padding:0;cursor:pointer;font:inherit;line-height:1.25}
.support-org-link:hover strong{color:#1d4ed8;text-decoration:underline}
.support-table td:nth-child(2) small{display:block;margin-top:5px;color:#64748b;font-size:11px;font-weight:700}
.support-clamp{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;color:#0f172a;font-size:12px;line-height:1.38;white-space:normal;max-width:100%}
.support-clamp-reason{-webkit-line-clamp:3;line-clamp:3}
.support-clamp-report{-webkit-line-clamp:4;line-clamp:4;color:#334155}
.support-link-btn{margin-top:7px;border:0;background:#eff6ff;color:#1d4ed8;border-radius:999px;padding:5px 9px;font-size:11px;font-weight:900;cursor:pointer;display:inline-flex;align-items:center;gap:5px}
.support-link-btn:hover{background:#dbeafe;transform:translateY(-1px)}
.support-detail-modal{padding:2px 0 8px}
.support-detail-head{display:flex;align-items:center;gap:12px;padding:14px;border:1px solid #dbeafe;background:linear-gradient(135deg,#eff6ff,#ffffff);border-radius:16px;margin-bottom:14px}
.support-detail-head i{width:38px;height:38px;border-radius:13px;background:#2563eb;color:#fff;display:flex;align-items:center;justify-content:center;font-size:16px}
.support-detail-head strong{display:block;color:#0f172a;font-size:14px;font-weight:900;line-height:1.25}
.support-detail-head small{display:block;color:#64748b;font-size:11px;margin-top:3px;font-weight:800}
.support-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:14px}
.support-detail-grid>div{border:1px solid #e2e8f0;background:#f8fafc;border-radius:13px;padding:11px}
.support-detail-grid label,.support-full-text label{display:block;color:#64748b;font-size:10.5px;font-weight:900;text-transform:uppercase;letter-spacing:.03em;margin-bottom:5px}
.support-detail-grid strong{display:block;color:#0f172a;font-size:13px;font-weight:900;overflow-wrap:anywhere}
.support-full-text{border:1px solid #e2e8f0;background:#fff;border-radius:14px;padding:13px;margin-top:10px}
.support-full-text p{margin:0;color:#0f172a;font-size:13px;line-height:1.5;white-space:pre-wrap}
.support-report-html div{font-size:13px;line-height:1.55;color:#0f172a;overflow-wrap:anywhere}
.support-stars.locked button{opacity:.85}
@media(max-width:760px){.support-detail-grid{grid-template-columns:1fr}.support-table th:nth-child(n),.support-table td:nth-child(n){width:auto!important}}

/* Soporte Técnico - envío de reporte / asistencia concluida */
.support-complete-action{
  background:#dcfce7!important;
  color:#16a34a!important;
  border:1px solid #bbf7d0!important;
}
.support-complete-action:hover{
  background:#bbf7d0!important;
  transform:translateY(-1px);
}
.support-complete-badge{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:6px 9px;
  border-radius:10px;
  background:#dcfce7;
  color:#166534;
  font-size:11px;
  font-weight:800;
  border:1px solid #bbf7d0;
  white-space:nowrap;
}


/* Corrección soporte: botones Editar / Enviar email / Concluir en Acciones */
.support-actions-stack{
  display:flex!important;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:6px;
}
.support-actions-stack .mini-btn{
  width:auto!important;
  min-width:38px;
  height:32px;
  padding:0 9px!important;
  border-radius:9px!important;
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  gap:6px;
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}
.support-edit-report-action{
  background:#ecfdf5!important;
  color:#15803d!important;
  border:1px solid #bbf7d0!important;
}
.support-edit-report-action:hover{
  background:#16a34a!important;
  color:#fff!important;
}
.support-complete-action{
  min-width:142px!important;
}
@media(max-width:900px){
  .support-actions-stack .mini-btn span{display:none}
  .support-complete-action{min-width:38px!important}
}

/* Fix solicitado: en Acciones solo botón de enviar reporte como icono */
.support-actions-stack .send-report-action.only-icon{
  width:34px!important;
  min-width:34px!important;
  height:34px!important;
  padding:0!important;
  border-radius:10px!important;
}
.support-actions-stack .send-report-action.only-icon i{
  font-size:13px;
}

/* FIX: botón para que el receptor suba/edite su reporte desde la columna Reporte del Soporte */
.support-upload-report-btn{
  background:#dcfce7!important;
  color:#166534!important;
  border:1px solid #bbf7d0!important;
  margin-left:6px;
}
.support-upload-report-btn:hover{
  background:#bbf7d0!important;
  color:#14532d!important;
}

/* ================= REPORTES EJECUTIVOS AVANZADOS ================= */
.reportes-main-header{align-items:flex-start;gap:14px;flex-wrap:wrap}
.report-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;max-width:100%}
.report-actions select,.report-actions input{height:38px;border:1px solid #dbe3ef;border-radius:10px;background:#fff;color:#0f172a;font-weight:700;font-size:12px;padding:0 12px;outline:none;box-shadow:0 1px 2px rgba(15,23,42,.04)}
.report-actions input{min-width:280px;font-weight:600}
.report-kpis-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}
.report-kpi-card{min-height:112px;position:relative;overflow:hidden}
.report-kpi-card:after{content:"";position:absolute;right:-30px;top:-30px;width:90px;height:90px;border-radius:999px;background:rgba(37,99,235,.06)}
.report-intel-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:12px 0 16px}
.report-decision-card{background:#fff;border:1px solid #e7edf6;border-radius:16px;box-shadow:0 4px 14px rgba(15,23,42,.05);padding:16px}
.report-card-title{display:flex;align-items:center;gap:9px;color:#071a3a;font-weight:900;font-size:14px}.report-card-title i{color:#2563eb}
.report-card-sub{font-size:11.5px;color:#8a97b4;margin:3px 0 12px}.report-insights-list,.report-actions-list{display:grid;gap:9px}
.report-insight{display:grid;grid-template-columns:32px 1fr;gap:10px;align-items:flex-start;padding:10px;border-radius:13px;border:1px solid #edf2f7;background:#f8fafc}
.report-insight i{width:32px;height:32px;border-radius:10px;display:flex;align-items:center;justify-content:center;background:#eaf1ff;color:#2563eb}
.report-insight b{display:block;font-size:12.5px;color:#0f172a;margin-bottom:2px}.report-insight span{display:block;font-size:11.5px;color:#64748b;line-height:1.35}
.report-insight.red i{background:#fee2e2;color:#dc2626}.report-insight.amber i{background:#fef3c7;color:#d97706}.report-insight.green i{background:#dcfce7;color:#16a34a}.report-insight.blue i{background:#dbeafe;color:#2563eb}
.report-action-line{display:grid;grid-template-columns:130px 1fr auto;gap:10px;align-items:center;padding:10px;border-radius:12px;border:1px solid #edf2f7;background:#fff}
.report-action-line span{font-size:11px;font-weight:900;color:#64748b;text-transform:uppercase}.report-action-line b{font-size:12px;color:#0f172a}.report-action-line em{font-style:normal;font-size:10.5px;font-weight:900;color:#991b1b;background:#fee2e2;border-radius:999px;padding:4px 8px;white-space:nowrap}
.reports-module-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:12px;margin:12px 0 16px}
.report-module-card{display:flex;gap:10px;align-items:center;background:#fff;border:1px solid #e7edf6;border-radius:15px;padding:13px;cursor:pointer;box-shadow:0 4px 14px rgba(15,23,42,.05);transition:.16s ease;min-height:92px}
.report-module-card:hover{transform:translateY(-2px);box-shadow:0 10px 24px rgba(15,23,42,.08)}
.report-module-card>i{width:34px;height:34px;display:flex;align-items:center;justify-content:center;border-radius:11px;background:#eff6ff;color:#2563eb;flex:0 0 auto}.report-module-card b{display:block;font-size:12px;color:#071a3a;line-height:1.2}.report-module-card strong{display:block;font-size:22px;color:#061632;line-height:1.1;margin-top:3px}.report-module-card span{display:block;font-size:10.5px;color:#71809f;line-height:1.25;margin-top:2px}
.report-module-card.green>i{background:#dcfce7;color:#16a34a}.report-module-card.red>i{background:#fee2e2;color:#dc2626}.report-module-card.amber>i{background:#fef3c7;color:#d97706}.report-module-card.violet>i{background:#ede9fe;color:#7c3aed}
.reports-chart-grid{display:grid;grid-template-columns:2fr 1fr;gap:14px;margin-bottom:16px}.report-chart-card{min-height:290px}.reports-tables-grid{display:grid;grid-template-columns:1fr 1.25fr;gap:14px;margin-bottom:20px}.compact-report-table{min-width:620px}.compact-report-table th{font-size:10.5px}.compact-report-table td{font-size:12px}.report-priority{display:inline-flex;border-radius:999px;padding:5px 9px;font-size:10.5px;font-weight:900}.report-priority.high{background:#fee2e2;color:#991b1b}.report-priority.mid{background:#fef3c7;color:#92400e}.empty-state.mini{padding:22px;color:#8a97b4;text-align:center;font-size:12px}
@media(max-width:1300px){.reports-module-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.report-kpis-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.reports-chart-grid,.reports-tables-grid,.report-intel-grid{grid-template-columns:1fr}}
@media(max-width:700px){.report-actions{justify-content:stretch;width:100%}.report-actions select,.report-actions input,.report-actions button{width:100%;min-width:0}.reports-module-grid,.report-kpis-grid{grid-template-columns:1fr}.report-action-line{grid-template-columns:1fr}.report-module-card{min-height:auto}}

/* ================= PERFIL DE USUARIO / FOTO / CONTRASEÑA ================= */
.hdr-profile{position:relative;cursor:pointer;border-radius:14px;padding:5px 8px;transition:.18s ease;}
.hdr-profile:hover{background:#f1f5f9;}
.user-avatar.has-photo,.profile-photo-avatar,.chat-avatar.has-photo{background:#fff!important;color:transparent!important;border:1px solid #e2e8f0;}
.user-avatar.has-photo img,.profile-photo-avatar img,.chat-avatar.has-photo img,.profile-big-avatar.has-photo img{width:100%;height:100%;object-fit:cover;border-radius:50%;display:block;}
.profile-dropdown{position:absolute;right:0;top:calc(100% + 8px);width:210px;background:#fff;border:1px solid #e2e8f0;border-radius:14px;box-shadow:0 18px 40px rgba(15,23,42,.16);padding:8px;z-index:300;display:none;}
.profile-dropdown.open{display:block;animation:slideDown .16s ease;}
.profile-dropdown button{width:100%;display:flex;align-items:center;gap:9px;border:0;background:#fff;color:#0f172a;font-size:12px;font-weight:700;border-radius:10px;padding:10px;cursor:pointer;text-align:left;}
.profile-dropdown button:hover{background:#f8fafc;color:#1d4ed8;}
.profile-dropdown hr{border:0;border-top:1px solid #e2e8f0;margin:6px 0;}
.profile-modal-card{width:min(940px,calc(100vw - 32px));max-height:92vh;overflow:auto;padding:0!important;}
.profile-hero{display:flex;align-items:center;gap:18px;padding:22px 24px;background:linear-gradient(135deg,#eff6ff,#ffffff);border-bottom:1px solid #dbeafe;}
.profile-big-avatar{width:92px;height:92px;border-radius:50%;background:linear-gradient(135deg,#1d4ed8,#2563eb);color:#fff;font-weight:900;font-size:28px;display:flex;align-items:center;justify-content:center;overflow:hidden;box-shadow:0 10px 24px rgba(37,99,235,.22);}
.profile-hero h2{margin:0;color:#0f172a;font-size:24px;font-weight:900;}
.profile-hero p{margin:5px 0 9px;color:#64748b;font-size:13px;font-weight:700;}
.profile-role-chip{display:inline-flex;padding:5px 10px;border-radius:999px;background:#dbeafe;color:#1d4ed8;font-size:11px;font-weight:900;text-transform:uppercase;}
.profile-tabs{display:flex;gap:8px;padding:12px 24px 0;border-bottom:1px solid #e2e8f0;}
.profile-tabs button{border:0;background:transparent;padding:11px 13px;font-size:12px;font-weight:800;color:#64748b;cursor:pointer;border-bottom:3px solid transparent;}
.profile-tabs button.active{color:#1d4ed8;border-bottom-color:#2563eb;}
.profile-tab{display:none;padding:22px 24px 24px;}
.profile-tab.active{display:block;}
.profile-grid-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;}
.profile-grid-form label,.profile-password-form label,.profile-photo-field label{display:flex;flex-direction:column;gap:6px;font-size:11px;font-weight:900;color:#334155;text-transform:uppercase;letter-spacing:.02em;}
.profile-grid-form input,.profile-password-form input{height:42px;border:1px solid #cbd5e1;border-radius:12px;padding:0 12px;font-size:13px;color:#0f172a;background:#fff;outline:none;}
.profile-grid-form input:focus,.profile-password-form input:focus{border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.12);}
.profile-photo-field{grid-column:1/-1;padding:13px;border:1px dashed #93c5fd;border-radius:14px;background:#eff6ff;}
.profile-photo-field input{height:auto;padding:8px;background:#fff;border-radius:10px;border:1px solid #dbeafe;}
.profile-photo-field small{font-size:11px;color:#64748b;text-transform:none;font-weight:600;}
.profile-readonly-card{grid-column:1/-1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px;padding:12px;}
.profile-readonly-card b{grid-column:1/-1;color:#0f172a;font-size:12px;}
.profile-readonly-card span{font-size:11.5px;color:#475569;}
.profile-actions-row{grid-column:1/-1;display:flex;justify-content:flex-end;gap:10px;padding-top:8px;border-top:1px solid #e2e8f0;}
.profile-password-form{display:grid;grid-template-columns:1fr;gap:14px;max-width:520px;}
@media(max-width:780px){.profile-grid-form{grid-template-columns:1fr}.profile-readonly-card{grid-template-columns:1fr}.profile-hero{align-items:flex-start}.profile-big-avatar{width:72px;height:72px}.profile-modal-card{width:calc(100vw - 18px)}}

/* ================= PERFIL USUARIO - FIX VISUAL Y CLICK ================= */
.hdr-profile-pro{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  gap:9px!important;
  min-width:148px!important;
  max-width:240px!important;
  padding:6px 10px 6px 6px!important;
  border:1px solid #e2e8f0!important;
  border-radius:16px!important;
  background:linear-gradient(135deg,#ffffff,#f8fbff)!important;
  box-shadow:0 8px 20px rgba(15,23,42,.08)!important;
  cursor:pointer!important;
  user-select:none!important;
  z-index:260!important;
}
.hdr-profile-pro:hover{
  border-color:#bfdbfe!important;
  background:linear-gradient(135deg,#eff6ff,#ffffff)!important;
  box-shadow:0 12px 28px rgba(37,99,235,.14)!important;
  transform:translateY(-1px);
}
.hdr-avatar-pro{
  width:34px!important;
  height:34px!important;
  min-width:34px!important;
  border-radius:50%!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:11px!important;
  font-weight:900!important;
  background:linear-gradient(135deg,#2563eb,#1d4ed8)!important;
  color:#fff!important;
  overflow:hidden!important;
}
.hdr-avatar-pro img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  border-radius:50%!important;
}
.hdr-profile-info{
  display:flex!important;
  flex-direction:column!important;
  min-width:0!important;
  line-height:1.1!important;
}
.hdr-profile-name{
  display:block!important;
  max-width:145px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  color:#0f172a!important;
  font-size:12px!important;
  font-weight:900!important;
  text-decoration:none!important;
}
.hdr-profile-role{
  display:block!important;
  margin-top:2px!important;
  color:#2563eb!important;
  font-size:10.5px!important;
  font-weight:800!important;
}
.hdr-profile-role .role-chip{
  display:inline-flex!important;
  align-items:center!important;
  max-width:95px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  padding:2px 7px!important;
  border-radius:999px!important;
  background:#eaf2ff!important;
  color:#1d4ed8!important;
  font-size:10px!important;
  font-weight:900!important;
  text-transform:uppercase!important;
}
.hdr-profile-caret{
  margin-left:auto!important;
  color:#64748b!important;
  font-size:10px!important;
  transition:.18s ease!important;
}
.hdr-profile-pro:has(.profile-dropdown.open) .hdr-profile-caret{
  transform:rotate(180deg);
  color:#2563eb!important;
}
.profile-dropdown-pro,
.profile-dropdown{
  position:absolute!important;
  top:calc(100% + 10px)!important;
  right:0!important;
  width:245px!important;
  background:#fff!important;
  border:1px solid #dbeafe!important;
  border-radius:18px!important;
  box-shadow:0 22px 55px rgba(15,23,42,.22)!important;
  padding:8px!important;
  z-index:9999!important;
  display:none;
  overflow:hidden!important;
}
.profile-dropdown.open{display:block!important;animation:slideDown .16s ease;}
.profile-dropdown-head{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  padding:10px!important;
  margin-bottom:5px!important;
  border-radius:14px!important;
  background:linear-gradient(135deg,#eff6ff,#ffffff)!important;
  border:1px solid #dbeafe!important;
}
.mini-profile-avatar{
  width:38px!important;
  height:38px!important;
  min-width:38px!important;
  border-radius:50%!important;
  background:linear-gradient(135deg,#2563eb,#1d4ed8)!important;
  color:#fff!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:11px!important;
  font-weight:900!important;
  overflow:hidden!important;
}
.profile-dropdown-head strong{
  display:block!important;
  max-width:165px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  color:#0f172a!important;
  font-size:12px!important;
  font-weight:900!important;
}
.profile-dropdown-head small{
  display:block!important;
  color:#64748b!important;
  font-size:10px!important;
  font-weight:800!important;
  margin-top:2px!important;
}
.profile-dropdown button{
  width:100%!important;
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  border:0!important;
  background:#fff!important;
  color:#0f172a!important;
  font-size:12px!important;
  font-weight:800!important;
  border-radius:12px!important;
  padding:11px 10px!important;
  cursor:pointer!important;
  text-align:left!important;
}
.profile-dropdown button i{
  width:24px!important;
  height:24px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border-radius:9px!important;
  background:#eef2ff!important;
  color:#2563eb!important;
  font-size:12px!important;
}
.profile-dropdown button:hover{
  background:#f8fafc!important;
  color:#1d4ed8!important;
}
.profile-dropdown hr{
  border:0!important;
  border-top:1px solid #e2e8f0!important;
  margin:6px 0!important;
}
@media(max-width:760px){
  .hdr-profile-pro{min-width:auto!important;padding:5px!important;}
  .hdr-profile-info,.hdr-profile-caret{display:none!important;}
  .profile-dropdown{right:-4px!important;width:230px!important;}
}

/* ===== FIX PERFIL USUARIO: DROPDOWN VISIBLE Y PROFESIONAL ===== */
.hdr-profile-pro{
  position:relative!important;
  display:inline-flex!important;
  align-items:center!important;
  gap:8px!important;
  min-width:134px!important;
  max-width:190px!important;
  height:42px!important;
  padding:5px 10px!important;
  border:1px solid #dbeafe!important;
  background:linear-gradient(135deg,#ffffff,#f8fbff)!important;
  box-shadow:0 6px 18px rgba(37,99,235,.08)!important;
  border-radius:16px!important;
  cursor:pointer!important;
  user-select:none!important;
  z-index:20!important;
}
.hdr-profile-pro:hover{
  background:#eff6ff!important;
  border-color:#bfdbfe!important;
  transform:translateY(-1px)!important;
}
.hdr-avatar-pro{
  width:32px!important;
  height:32px!important;
  min-width:32px!important;
  border-radius:999px!important;
  overflow:hidden!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:11px!important;
  font-weight:900!important;
  background:linear-gradient(135deg,#1d4ed8,#2563eb)!important;
  color:#fff!important;
}
.hdr-avatar-pro img{width:100%!important;height:100%!important;object-fit:cover!important;display:block!important;}
.hdr-profile-info{min-width:0!important;display:flex!important;flex-direction:column!important;line-height:1.05!important;}
.hdr-profile-name{max-width:92px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;font-size:12px!important;font-weight:900!important;color:#0f172a!important;}
.hdr-profile-role .role-chip,.hdr-profile-role{font-size:9.5px!important;font-weight:900!important;color:#1d4ed8!important;text-transform:uppercase!important;}
.hdr-profile-caret{font-size:10px!important;color:#64748b!important;margin-left:auto!important;}
.profile-dropdown,.profile-dropdown-pro{
  width:250px!important;
  background:#fff!important;
  border:1px solid #dbeafe!important;
  border-radius:16px!important;
  box-shadow:0 22px 55px rgba(15,23,42,.22)!important;
  padding:9px!important;
  display:none!important;
  z-index:99999!important;
}
.profile-dropdown.open,.profile-dropdown-pro.open{display:block!important;animation:slideDown .16s ease!important;}
.profile-dropdown-head{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  padding:10px!important;
  margin-bottom:6px!important;
  background:linear-gradient(135deg,#eff6ff,#ffffff)!important;
  border:1px solid #dbeafe!important;
  border-radius:13px!important;
}
.mini-profile-avatar{width:38px!important;height:38px!important;min-width:38px!important;border-radius:999px!important;overflow:hidden!important;}
.profile-dropdown-head strong{display:block!important;font-size:13px!important;color:#0f172a!important;max-width:160px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
.profile-dropdown-head small{display:block!important;font-size:10px!important;color:#2563eb!important;font-weight:900!important;text-transform:uppercase!important;margin-top:2px!important;}
.profile-dropdown button{
  width:100%!important;
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  border:0!important;
  background:#fff!important;
  color:#0f172a!important;
  font-size:12px!important;
  font-weight:800!important;
  border-radius:11px!important;
  padding:11px 10px!important;
  cursor:pointer!important;
  text-align:left!important;
}
.profile-dropdown button:hover{background:#eff6ff!important;color:#1d4ed8!important;}
.profile-dropdown button i{width:18px!important;text-align:center!important;color:#2563eb!important;}
.profile-dropdown hr{border:0!important;border-top:1px solid #e2e8f0!important;margin:7px 0!important;}
@media(max-width:700px){
  .hdr-profile-pro{min-width:42px!important;width:42px!important;padding:5px!important;}
  .hdr-profile-info,.hdr-profile-caret{display:none!important;}
}


/* =========================================================
   FIX ANCHO COMPACTO PERFIL SUPERIOR
   Igual al estilo compacto de referencia
   ========================================================= */

#hdrProfile.hdr-profile-pro,
.hdr-profile-pro{
  width:185px!important;
  min-width:185px!important;
  max-width:185px!important;
  height:43px!important;
  padding:4px 9px!important;
  gap:8px!important;
  border-radius:999px!important;
  overflow:hidden!important;
}

#hdrProfile .hdr-avatar-pro,
.hdr-profile-pro .hdr-avatar-pro{
  width:35px!important;
  height:35px!important;
  min-width:35px!important;
  max-width:35px!important;
  font-size:11px!important;
}

#hdrProfile .hdr-profile-info,
.hdr-profile-pro .hdr-profile-info{
  flex:1 1 auto!important;
  min-width:0!important;
  max-width:105px!important;
  overflow:hidden!important;
}

#hdrProfile .hdr-profile-name,
.hdr-profile-pro .hdr-profile-name{
  display:block!important;
  max-width:105px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:12px!important;
  line-height:1.05!important;
  font-weight:900!important;
}

#hdrProfile .hdr-profile-role,
.hdr-profile-pro .hdr-profile-role{
  display:block!important;
  max-width:105px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:9px!important;
  line-height:1.05!important;
  font-weight:900!important;
  text-transform:uppercase!important;
}

#hdrProfile .hdr-profile-caret,
.hdr-profile-pro .hdr-profile-caret{
  width:12px!important;
  min-width:12px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  margin-left:auto!important;
  font-size:10px!important;
}

/* Compacto en pantallas pequeñas */
@media(max-width:900px){
  #hdrProfile.hdr-profile-pro,
  .hdr-profile-pro{
    width:150px!important;
    min-width:150px!important;
    max-width:150px!important;
  }

  #hdrProfile .hdr-profile-info,
  .hdr-profile-pro .hdr-profile-info,
  #hdrProfile .hdr-profile-name,
  .hdr-profile-pro .hdr-profile-name,
  #hdrProfile .hdr-profile-role,
  .hdr-profile-pro .hdr-profile-role{
    max-width:74px!important;
  }
}


/* =========================================================
   FIX DEFINITIVO DROPDOWN PERFIL - CLICK Y CAPAS
   ========================================================= */
#profileDropdown,
#profileDropdown.profile-dropdown,
.profile-dropdown.profile-dropdown-pro{
  position:fixed!important;
  top:62px!important;
  right:14px!important;
  width:260px!important;
  max-width:calc(100vw - 28px)!important;
  background:#ffffff!important;
  border:1px solid #dbeafe!important;
  border-radius:16px!important;
  box-shadow:0 24px 70px rgba(15,23,42,.28)!important;
  padding:10px!important;
  z-index:2147483640!important;
  display:none!important;
  opacity:0!important;
  visibility:hidden!important;
  transform:translateY(-8px)!important;
  pointer-events:none!important;
}

#profileDropdown.open,
#profileDropdown.profile-dropdown.open,
.profile-dropdown.profile-dropdown-pro.open{
  display:block!important;
  opacity:1!important;
  visibility:visible!important;
  transform:translateY(0)!important;
  pointer-events:auto!important;
}

#profileDropdown .profile-dropdown-head{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  padding:11px!important;
  margin-bottom:6px!important;
  border-radius:14px!important;
  background:linear-gradient(135deg,#eff6ff,#ffffff)!important;
  border:1px solid #dbeafe!important;
}

#profileDropdown button{
  width:100%!important;
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  border:0!important;
  background:#fff!important;
  color:#0f172a!important;
  border-radius:12px!important;
  padding:11px!important;
  cursor:pointer!important;
  font-size:12px!important;
  font-weight:850!important;
  text-align:left!important;
}

#profileDropdown button:hover{
  background:#eff6ff!important;
  color:#1d4ed8!important;
}

#profileDropdown button i{
  width:18px!important;
  text-align:center!important;
  color:#2563eb!important;
}

#profileDropdown hr{
  border:0!important;
  border-top:1px solid #e2e8f0!important;
  margin:8px 0!important;
}

#hdrProfile,
#hdrProfile *{
  pointer-events:auto!important;
}


/* =========================================================
   FIX PERFIL: VENTANA EMERGENTE CENTRADA, NO PANEL LATERAL
   ========================================================= */

/* Cualquier contenedor de perfil debe comportarse como overlay/modal */
#profileModal,
#userProfileModal,
#myProfileModal,
.profile-modal-wrap,
.user-profile-modal,
.profile-panel-overlay{
  position:fixed!important;
  inset:0!important;
  width:100vw!important;
  height:100vh!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  padding:22px!important;
  background:rgba(15,23,42,.58)!important;
  backdrop-filter:blur(6px)!important;
  z-index:2147483500!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:auto!important;
  box-sizing:border-box!important;
  transform:none!important;
}

/* Oculto si el JS lo deja sin clase activa */
#profileModal:not(.open):not([style*="display: block"]):empty,
#userProfileModal:not(.open):not([style*="display: block"]):empty,
#myProfileModal:not(.open):not([style*="display: block"]):empty{
  display:none!important;
}

/* La tarjeta interna del perfil */
#profileModal > .profile-modal-card,
#profileModal .profile-modal-card,
#profileModal > .profile-panel,
#profileModal .profile-panel,
#profileModal > .profile-content,
#profileModal .profile-content,
#userProfileModal > .profile-modal-card,
#userProfileModal .profile-modal-card,
#myProfileModal > .profile-modal-card,
#myProfileModal .profile-modal-card,
.profile-modal-card{
  position:relative!important;
  width:min(760px,calc(100vw - 44px))!important;
  max-width:760px!important;
  min-width:0!important;
  height:auto!important;
  max-height:calc(100vh - 44px)!important;
  margin:auto!important;
  background:#fff!important;
  border-radius:24px!important;
  border:1px solid #dbeafe!important;
  box-shadow:0 32px 90px rgba(15,23,42,.38)!important;
  overflow:auto!important;
  transform:none!important;
  left:auto!important;
  right:auto!important;
  top:auto!important;
  bottom:auto!important;
}

/* Si el panel interno quedó sin clase, igual limitar el primer hijo */
#profileModal > div:first-child:not(.profile-dropdown),
#userProfileModal > div:first-child:not(.profile-dropdown),
#myProfileModal > div:first-child:not(.profile-dropdown){
  position:relative!important;
  width:min(760px,calc(100vw - 44px))!important;
  max-width:760px!important;
  height:auto!important;
  max-height:calc(100vh - 44px)!important;
  margin:auto!important;
  background:#fff!important;
  border-radius:24px!important;
  overflow:auto!important;
}

/* Cabecera visual del perfil dentro del modal */
#profileModal .profile-hero,
#userProfileModal .profile-hero,
#myProfileModal .profile-hero{
  display:flex!important;
  align-items:center!important;
  gap:18px!important;
  padding:22px 24px!important;
  background:linear-gradient(135deg,#eff6ff,#ffffff)!important;
  border-bottom:1px solid #dbeafe!important;
}

/* Formulario en 2 columnas dentro del modal */
#profileModal .profile-grid-form,
#userProfileModal .profile-grid-form,
#myProfileModal .profile-grid-form{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:12px!important;
  padding:18px 22px 22px!important;
}

#profileModal .profile-photo-field,
#userProfileModal .profile-photo-field,
#myProfileModal .profile-photo-field{
  grid-column:1/-1!important;
  padding:13px!important;
  border:1.5px dashed #93c5fd!important;
  border-radius:16px!important;
  background:#eff6ff!important;
}

#profileModal .profile-tabs,
#userProfileModal .profile-tabs,
#myProfileModal .profile-tabs{
  display:flex!important;
  gap:8px!important;
  padding:12px 22px 0!important;
  border-bottom:1px solid #e2e8f0!important;
}

#profileModal .profile-tab,
#userProfileModal .profile-tab,
#myProfileModal .profile-tab{
  padding:18px 22px 22px!important;
}

/* Botón cerrar siempre arriba */
#profileModal .modal-close,
#userProfileModal .modal-close,
#myProfileModal .modal-close,
#profileModal [data-close-profile],
#userProfileModal [data-close-profile],
#myProfileModal [data-close-profile]{
  position:absolute!important;
  top:14px!important;
  right:14px!important;
  z-index:10!important;
  width:36px!important;
  height:36px!important;
  border-radius:12px!important;
  border:1px solid #dbeafe!important;
  background:#fff!important;
  color:#64748b!important;
  cursor:pointer!important;
}

/* Evitar que el dashboard quede empujado por el perfil */
body.profile-open{
  overflow:hidden!important;
}

@media(max-width:780px){
  #profileModal,
  #userProfileModal,
  #myProfileModal,
  .profile-modal-wrap{
    padding:10px!important;
    align-items:flex-end!important;
  }
  #profileModal .profile-modal-card,
  #userProfileModal .profile-modal-card,
  #myProfileModal .profile-modal-card,
  .profile-modal-card,
  #profileModal > div:first-child,
  #userProfileModal > div:first-child,
  #myProfileModal > div:first-child{
    width:100%!important;
    max-width:100%!important;
    border-radius:18px!important;
  }
  #profileModal .profile-grid-form,
  #userProfileModal .profile-grid-form,
  #myProfileModal .profile-grid-form{
    grid-template-columns:1fr!important;
  }
}


/* =========================================================
   ADMIN USUARIOS - SUBIR FOTO DEL USUARIO
   ========================================================= */

.user-admin-photo-field{
  grid-column:1/-1!important;
  border:1.5px dashed #93c5fd!important;
  background:linear-gradient(135deg,#eff6ff,#ffffff)!important;
  border-radius:16px!important;
  padding:13px!important;
}

.user-admin-photo-row{
  display:flex!important;
  align-items:center!important;
  gap:14px!important;
}

.user-admin-photo-preview{
  width:58px!important;
  height:58px!important;
  min-width:58px!important;
  border-radius:999px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  background:linear-gradient(135deg,#1d4ed8,#2563eb)!important;
  color:#fff!important;
  font-size:15px!important;
  font-weight:900!important;
  box-shadow:0 10px 24px rgba(37,99,235,.20)!important;
}

.user-admin-photo-preview img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  display:block!important;
}

.user-admin-photo-input{
  flex:1!important;
  min-width:0!important;
}

.user-admin-photo-input input[type="file"]{
  width:100%!important;
  padding:9px!important;
  border:1px solid #cbd5e1!important;
  border-radius:12px!important;
  background:#fff!important;
}

.user-admin-photo-input .field-help.ok{
  color:#16a34a!important;
  font-weight:800!important;
  margin-top:5px!important;
}

@media(max-width:700px){
  .user-admin-photo-row{
    align-items:flex-end!important;
  }
}


/* =========================================================
   PERFIL USUARIO - OCULTAR CAMPO MENTOR
   ========================================================= */

/* Oculta bloques de mentor en Mi Perfil sin afectar otros formularios administrativos */
#profileModal input[name="mentor"],
#profileModal input[name="mentor_name"],
#profileModal input[id="mentor"],
#profileModal input[id="mentor_name"]{
  display:none!important;
}

#profileModal label:has(+ input[name="mentor"]),
#profileModal label:has(+ input[name="mentor_name"]),
#profileModal label:has(+ input[id="mentor"]),
#profileModal label:has(+ input[id="mentor_name"]){
  display:none!important;
}

/* Fallback visual para contenedores marcados desde HTML/JS */
#profileModal .profile-mentor-field,
#profileModal .mentor-field,
#profileModal [data-profile-field="mentor"]{
  display:none!important;
}


/* =========================================================
   RECURSOS HUMANOS / MI USUARIO
   ========================================================= */
.hr-user-layout{
  display:grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(320px, .95fr);
  gap:16px;
  margin-bottom:16px;
}
.hr-profile-card,
.hr-actions-card{
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:18px;
  box-shadow:0 10px 28px rgba(15,23,42,.06);
  overflow:hidden;
}
.hr-profile-loading{
  padding:22px;
  color:#64748b;
  font-size:13px;
}
.hr-profile-hero{
  display:flex;
  align-items:center;
  gap:18px;
  padding:22px;
  background:linear-gradient(135deg,#eff6ff,#ffffff);
  border-bottom:1px solid #dbeafe;
}
.hr-profile-avatar{
  width:86px;
  height:86px;
  min-width:86px;
  border-radius:999px;
  background:linear-gradient(135deg,#1d4ed8,#2563eb);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:26px;
  font-weight:900;
  overflow:hidden;
  box-shadow:0 14px 28px rgba(37,99,235,.22);
}
.hr-profile-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.hr-profile-hero h2{
  margin:0;
  font-size:24px;
  line-height:1.1;
  color:#0f172a;
  font-weight:900;
}
.hr-profile-hero p{
  margin:5px 0 8px;
  color:#64748b;
  font-size:13px;
  font-weight:800;
}
.hr-role-pill{
  display:inline-flex;
  align-items:center;
  padding:5px 10px;
  border-radius:999px;
  background:#dbeafe;
  color:#1d4ed8;
  font-size:10.5px;
  font-weight:900;
  text-transform:uppercase;
}
.hr-profile-meta{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:0;
  padding:8px 20px 16px;
}
.hr-profile-meta div{
  padding:12px 6px;
  border-bottom:1px solid #eef2f7;
}
.hr-profile-meta span,
.hr-info-grid span{
  display:block;
  color:#64748b;
  font-size:10.5px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.02em;
  margin-bottom:4px;
}
.hr-profile-meta b,
.hr-info-grid b{
  color:#0f172a;
  font-size:13px;
  font-weight:850;
  word-break:break-word;
}
.hr-profile-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding:14px 20px 18px;
  border-top:1px solid #eef2f7;
}
.hr-actions-card{
  padding:18px;
}
.hr-actions-title strong{
  display:block;
  color:#0f172a;
  font-size:15px;
  font-weight:900;
}
.hr-actions-title span{
  display:block;
  color:#64748b;
  font-size:12px;
  margin-top:3px;
}
.hr-actions-grid{
  display:grid;
  gap:12px;
  margin-top:14px;
}
.hr-action-btn{
  width:100%;
  display:grid;
  grid-template-columns:42px 1fr;
  gap:10px 12px;
  align-items:center;
  text-align:left;
  padding:14px;
  border-radius:16px;
  border:1px solid #e2e8f0;
  background:#fff;
  cursor:pointer;
  transition:.18s ease;
}
.hr-action-btn i{
  grid-row:1 / span 2;
  width:42px;
  height:42px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
}
.hr-action-btn b{
  color:#0f172a;
  font-size:14px;
  font-weight:900;
}
.hr-action-btn small{
  color:#64748b;
  font-size:11.5px;
  line-height:1.3;
}
.hr-action-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 28px rgba(15,23,42,.08);
}
.hr-action-btn.blue i{background:#dbeafe;color:#2563eb}
.hr-action-btn.green i{background:#dcfce7;color:#16a34a}
.hr-action-btn.orange i{background:#ffedd5;color:#f59e0b}
.hr-panel-grid{
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:16px;
}
.hr-info-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:0;
  padding:10px 18px 18px;
}
.hr-info-grid div{
  padding:12px 10px;
  border-bottom:1px solid #eef2f7;
}
.hr-muted{
  color:#94a3b8;
  font-weight:700;
}
.hr-kpi-mini-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  padding:18px;
}
.hr-kpi-mini{
  border:1px solid #e2e8f0;
  border-radius:16px;
  padding:14px;
  background:#fff;
}
.hr-kpi-mini i{
  width:34px;
  height:34px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-bottom:10px;
}
.hr-kpi-mini b{
  display:block;
  font-size:24px;
  color:#0f172a;
  font-weight:900;
  line-height:1;
}
.hr-kpi-mini span{
  display:block;
  margin-top:6px;
  color:#64748b;
  font-size:11.5px;
  font-weight:800;
}
.hr-kpi-mini.blue i{background:#dbeafe;color:#2563eb}
.hr-kpi-mini.green i{background:#dcfce7;color:#16a34a}
.hr-kpi-mini.orange i{background:#ffedd5;color:#f59e0b}
.hr-note{
  color:#64748b;
  font-size:12px;
  margin-top:12px;
}
.hr-modal-summary h3{
  margin:0 0 8px;
  color:#0f172a;
}
.hr-modal-summary p{
  color:#475569;
  line-height:1.5;
}
@media(max-width:1000px){
  .hr-user-layout,
  .hr-panel-grid{
    grid-template-columns:1fr;
  }
  .hr-info-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:640px){
  .hr-profile-hero{
    align-items:flex-start;
  }
  .hr-profile-meta,
  .hr-info-grid,
  .hr-kpi-mini-grid{
    grid-template-columns:1fr;
  }
  .hr-profile-actions{
    flex-direction:column;
  }
}


/* =========================================================
   FIX GLOBAL BOTÓN X / CIERRE DE MODALES
   ========================================================= */
.modal-close,
.close-modal,
.btn-close,
[data-close],
[data-close-modal],
[data-close-profile],
button[aria-label="Cerrar"],
button[title="Cerrar"]{
  cursor:pointer!important;
  pointer-events:auto!important;
  z-index:2147483600!important;
}

.modal .modal-close,
.profile-modal-wrap .modal-close,
.entity-modal .modal-close{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}


/* =========================================================
   FIX CIERRE DETALLE / PREVISUALIZACIÓN DE ÓRDENES
   ========================================================= */
#orderDetailModal.modal-overlay.open{
  pointer-events:auto!important;
}

#orderDetailModal .modal-close,
.modal-overlay .modal-close{
  pointer-events:auto!important;
  cursor:pointer!important;
  z-index:2147483647!important;
}


/* =========================================================
   FOTO DE PERFIL DESDE LA IMAGEN - SIN CAMPO ADJUNTAR VISIBLE
   ========================================================= */
.profile-photo-field,
#profileModal .profile-photo-field{
  display:none!important;
}

.profile-photo-editor,
.user-admin-photo-editor{
  position:relative;
  width:92px;
  height:92px;
  min-width:92px;
}

.profile-photo-editor .profile-big-avatar{
  cursor:pointer;
}

.profile-photo-mini{
  position:absolute;
  width:32px;
  height:32px;
  border-radius:999px;
  border:1px solid #e2e8f0;
  background:#ffffff;
  color:#0f172a;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(15,23,42,.16);
  z-index:5;
}

.profile-photo-mini.edit{
  left:2px;
  bottom:-4px;
}

.profile-photo-mini.del{
  right:2px;
  bottom:-4px;
}

.profile-photo-mini.edit:hover{
  background:#eff6ff;
  color:#1d4ed8;
  border-color:#93c5fd;
}

.profile-photo-mini.del:hover{
  background:#fff1f2;
  color:#dc2626;
  border-color:#fecaca;
}

.user-admin-photo-field{
  grid-column:1/-1!important;
  border:0!important;
  background:transparent!important;
  padding:0 0 8px!important;
}

.user-admin-photo-row{
  display:flex!important;
  align-items:center!important;
  gap:16px!important;
}

.user-admin-photo-preview{
  width:92px!important;
  height:92px!important;
  min-width:92px!important;
  border-radius:999px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
  background:linear-gradient(135deg,#1d4ed8,#2563eb)!important;
  color:#fff!important;
  font-size:22px!important;
  font-weight:900!important;
  cursor:pointer!important;
  border:1px solid #dbeafe!important;
  box-shadow:0 12px 24px rgba(37,99,235,.18)!important;
}

.user-admin-photo-preview img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  display:block!important;
}

.user-admin-photo-row .field-help{
  color:#64748b!important;
  font-size:11.5px!important;
  font-weight:700!important;
}

#profilePhotoInput,
input[name="profile_photo"][style*="display:none"]{
  display:none!important;
}


/* =========================================================
   FOTO PERFIL - ICONOS SOLO AL PASAR MOUSE Y MÁS PEQUEÑOS
   ========================================================= */

.profile-photo-mini{
  width:24px!important;
  height:24px!important;
  min-width:24px!important;
  font-size:10px!important;
  opacity:0!important;
  visibility:hidden!important;
  transform:scale(.88)!important;
  transition:opacity .16s ease, transform .16s ease, visibility .16s ease!important;
}

.profile-photo-editor:hover .profile-photo-mini,
.user-admin-photo-editor:hover .profile-photo-mini{
  opacity:1!important;
  visibility:visible!important;
  transform:scale(1)!important;
}

.profile-photo-mini.edit{
  left:4px!important;
  bottom:0!important;
}

.profile-photo-mini.del{
  right:4px!important;
  bottom:0!important;
}

.profile-photo-mini i{
  font-size:10px!important;
}

/* En móviles se mantienen visibles porque no hay hover real */
@media(max-width:768px){
  .profile-photo-mini{
    opacity:1!important;
    visibility:visible!important;
    transform:scale(1)!important;
  }
}


/* =========================================================
   PERFIL - MODAL MÁS COMPACTO
   ========================================================= */

/* Reduce ancho general del modal de perfil */
#profileModal .profile-modal-card,
#profileModal > .profile-modal-card,
#profileModal > div:first-child,
.profile-modal-wrap .profile-modal-card{
  width:min(620px, calc(100vw - 44px))!important;
  max-width:620px!important;
}

/* Cabecera más compacta */
#profileModal .profile-hero{
  padding:18px 22px!important;
  gap:16px!important;
}

#profileModal .profile-big-avatar,
#profileModal .profile-photo-editor{
  width:78px!important;
  height:78px!important;
  min-width:78px!important;
}

#profileModal .profile-hero h2{
  font-size:22px!important;
}

/* Formularios más compactos */
#profileModal .profile-tab{
  padding:16px 22px 20px!important;
}

#profileModal .profile-grid-form,
#profileModal .profile-password-form{
  max-width:520px!important;
}

#profileModal .profile-password-form{
  margin:0!important;
}

#profileModal .profile-grid-form{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:11px!important;
}

#profileModal .profile-grid-form input,
#profileModal .profile-password-form input{
  height:38px!important;
}

/* Botones más alineados */
#profileModal .profile-actions-row{
  justify-content:flex-end!important;
  gap:9px!important;
}

/* En pantallas pequeñas usa todo el ancho disponible */
@media(max-width:700px){
  #profileModal .profile-modal-card,
  #profileModal > .profile-modal-card,
  #profileModal > div:first-child,
  .profile-modal-wrap .profile-modal-card{
    width:calc(100vw - 20px)!important;
    max-width:calc(100vw - 20px)!important;
  }

  #profileModal .profile-grid-form{
    grid-template-columns:1fr!important;
  }

  #profileModal .profile-password-form{
    max-width:100%!important;
  }
}


/* =========================================================
   PERFIL - MODAL COMPACTO FINAL
   ========================================================= */

/* Modal general más angosto */
#profileModal .profile-modal-card,
#profileModal > .profile-modal-card,
#profileModal > div:first-child,
.profile-modal-wrap .profile-modal-card{
  width:min(560px, calc(100vw - 44px))!important;
  max-width:560px!important;
  min-width:0!important;
}

/* Reducir cabecera */
#profileModal .profile-hero{
  padding:16px 20px!important;
  gap:14px!important;
}

#profileModal .profile-big-avatar,
#profileModal .profile-photo-editor{
  width:72px!important;
  height:72px!important;
  min-width:72px!important;
}

#profileModal .profile-hero h2{
  font-size:20px!important;
  line-height:1.1!important;
}

#profileModal .profile-hero p{
  font-size:12px!important;
  margin:3px 0 6px!important;
}

#profileModal .profile-role-chip{
  font-size:10px!important;
  padding:4px 9px!important;
}

/* Tabs más compactos */
#profileModal .profile-tabs{
  padding:9px 20px 0!important;
}

#profileModal .profile-tabs button{
  padding:9px 10px!important;
  font-size:12px!important;
}

/* Cuerpo compacto */
#profileModal .profile-tab{
  padding:14px 20px 18px!important;
}

/* Perfil: 2 columnas ajustadas */
#profileModal .profile-grid-form{
  width:100%!important;
  max-width:480px!important;
  margin:0 auto!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px 12px!important;
}

/* Contraseña: ancho más corto y centrado */
#profileModal .profile-password-form{
  width:100%!important;
  max-width:440px!important;
  margin:0 auto!important;
  gap:11px!important;
}

#profileModal .profile-grid-form input,
#profileModal .profile-password-form input{
  height:36px!important;
  font-size:12.5px!important;
  border-radius:10px!important;
}

#profileModal .profile-grid-form label,
#profileModal .profile-password-form label{
  font-size:10.5px!important;
}

/* Caja de información más compacta */
#profileModal .profile-readonly-card{
  padding:10px!important;
  gap:6px!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}

#profileModal .profile-readonly-card b{
  font-size:12px!important;
}

#profileModal .profile-readonly-card span{
  font-size:10.5px!important;
}

/* Botones */
#profileModal .profile-actions-row{
  justify-content:flex-end!important;
  padding-top:10px!important;
  gap:8px!important;
}

#profileModal .btn-primary,
#profileModal .btn-outline{
  height:36px!important;
  padding:0 14px!important;
  font-size:12px!important;
  border-radius:10px!important;
}

/* X más pequeña */
#profileModal .modal-close{
  width:32px!important;
  height:32px!important;
  border-radius:10px!important;
}

/* Íconos de foto más pequeños todavía */
#profileModal .profile-photo-mini{
  width:22px!important;
  height:22px!important;
  min-width:22px!important;
  font-size:9px!important;
}

#profileModal .profile-photo-mini i{
  font-size:9px!important;
}

@media(max-width:620px){
  #profileModal .profile-modal-card,
  #profileModal > .profile-modal-card,
  #profileModal > div:first-child,
  .profile-modal-wrap .profile-modal-card{
    width:calc(100vw - 20px)!important;
    max-width:calc(100vw - 20px)!important;
  }

  #profileModal .profile-grid-form{
    grid-template-columns:1fr!important;
    max-width:100%!important;
  }

  #profileModal .profile-password-form{
    max-width:100%!important;
  }

  #profileModal .profile-readonly-card{
    grid-template-columns:1fr!important;
  }
}


/* =========================================================
   PERFIL - MODAL AUTOAJUSTABLE
   ========================================================= */

/* El modal se ajusta al contenido real, sin ancho fijo exagerado */
#profileModal .profile-modal-card,
#profileModal > .profile-modal-card,
#profileModal > div:first-child,
.profile-modal-wrap .profile-modal-card{
  width:fit-content!important;
  min-width:min(420px, calc(100vw - 24px))!important;
  max-width:calc(100vw - 40px)!important;
  height:auto!important;
}

/* Contenido centrado y sin estirarse */
#profileModal .profile-hero,
#profileModal .profile-tabs,
#profileModal .profile-tab{
  width:auto!important;
}

/* Perfil: ocupa solo lo necesario */
#profileModal .profile-grid-form{
  width:auto!important;
  max-width:none!important;
  min-width:420px!important;
  margin:0!important;
  grid-template-columns:repeat(2, minmax(210px, 1fr))!important;
  gap:10px 12px!important;
}

/* Contraseña: se autoajusta a los campos */
#profileModal .profile-password-form{
  width:auto!important;
  max-width:none!important;
  min-width:420px!important;
  margin:0!important;
  gap:11px!important;
}

/* Los campos definen el ancho natural */
#profileModal .profile-grid-form input,
#profileModal .profile-password-form input{
  width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
}

/* Caja de información sin expandir de más */
#profileModal .profile-readonly-card{
  width:100%!important;
  box-sizing:border-box!important;
}

/* Botones alineados al contenido */
#profileModal .profile-actions-row{
  width:100%!important;
  box-sizing:border-box!important;
}

/* Móvil: 1 columna y ancho completo disponible */
@media(max-width:640px){
  #profileModal .profile-modal-card,
  #profileModal > .profile-modal-card,
  #profileModal > div:first-child,
  .profile-modal-wrap .profile-modal-card{
    width:calc(100vw - 20px)!important;
    min-width:0!important;
    max-width:calc(100vw - 20px)!important;
  }

  #profileModal .profile-grid-form,
  #profileModal .profile-password-form{
    min-width:0!important;
    width:100%!important;
    grid-template-columns:1fr!important;
  }
}


/* =========================================================
   RRHH AVANZADO: PERMISOS, COMISIONES, BOLETAS
   ========================================================= */
.rrhh-policy-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  background:linear-gradient(135deg,#fff7ed,#ffffff);
  border:1px solid #fed7aa;
  border-radius:16px;
  padding:14px 16px;
  margin-bottom:16px;
  box-shadow:0 8px 20px rgba(15,23,42,.05);
}
.rrhh-policy-card strong{
  display:block;
  color:#7c2d12;
  font-size:13px;
  font-weight:900;
}
.rrhh-policy-card span{
  display:block;
  color:#9a3412;
  font-size:12px;
  margin-top:3px;
}
.rrhh-schedule{
  background:#fff;
  border:1px solid #fed7aa;
  color:#7c2d12;
  border-radius:999px;
  padding:8px 12px;
  font-size:12px;
  white-space:nowrap;
}
.rrhh-kpi-row{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin-bottom:16px;
}
.rrhh-kpi{
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:16px;
  padding:14px;
  box-shadow:0 8px 22px rgba(15,23,42,.05);
}
.rrhh-kpi i{
  width:36px;
  height:36px;
  border-radius:12px;
  background:#dbeafe;
  color:#2563eb;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-bottom:10px;
}
.rrhh-kpi span{
  display:block;
  color:#64748b;
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
}
.rrhh-kpi b{
  display:block;
  color:#0f172a;
  font-size:22px;
  font-weight:900;
  margin-top:4px;
}
.search-mini,
.filter-mini{
  height:34px;
  border:1px solid #cbd5e1;
  border-radius:10px;
  background:#fff;
  color:#0f172a;
  padding:0 10px;
  font-size:12px;
  outline:none;
}
.search-mini:focus,
.filter-mini:focus{
  border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(37,99,235,.12);
}
.table-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.mini-money{
  width:95px;
  height:32px;
  border:1px solid #cbd5e1;
  border-radius:9px;
  padding:0 8px;
  font-size:12px;
}
.text-success{color:#16a34a!important;}
.clamp-2{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  max-width:320px;
}
.empty-cell{
  text-align:center;
  color:#64748b;
  padding:24px!important;
}
.status-badge{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:5px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:900;
  text-transform:capitalize;
}
.status-badge.success{background:#dcfce7;color:#166534;}
.status-badge.warning{background:#fef3c7;color:#92400e;}
.status-badge.danger{background:#fee2e2;color:#991b1b;}
.icon-btn.ok{background:#dcfce7!important;color:#16a34a!important;}
.icon-btn.danger{background:#fee2e2!important;color:#dc2626!important;}
.boleta-template{
  border:1px solid #e2e8f0;
  border-radius:16px;
  padding:18px;
  background:#fff;
}
.boleta-template h2{
  margin:0 0 12px;
  color:#0f172a;
}
.boleta-line{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:9px 0;
  border-bottom:1px solid #eef2f7;
}
.boleta-line.total{
  border-bottom:0;
  margin-top:8px;
  padding:12px;
  border-radius:12px;
  background:#eff6ff;
  color:#1d4ed8;
  font-weight:900;
}
@media(max-width:900px){
  .rrhh-kpi-row{grid-template-columns:repeat(2,minmax(0,1fr));}
  .rrhh-policy-card{align-items:flex-start;flex-direction:column;}
  .rrhh-schedule{white-space:normal;border-radius:12px;}
}
@media(max-width:560px){
  .rrhh-kpi-row{grid-template-columns:1fr;}
}


/* =========================================================
   RR.HH. PERMISOS - CITA MÉDICA / PRUEBAS
   ========================================================= */
.btn-mini{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-height:28px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid #dbeafe;
  background:#eff6ff;
  color:#1d4ed8;
  font-size:11px;
  font-weight:900;
  cursor:pointer;
  white-space:nowrap;
}
.btn-mini.medical{
  background:#fff7ed;
  border-color:#fed7aa;
  color:#c2410c;
}
.btn-mini.view{
  background:#ecfdf5;
  border-color:#bbf7d0;
  color:#15803d;
}
.btn-mini:hover{
  filter:brightness(.98);
  transform:translateY(-1px);
}
.td-actions{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}
.text-warning{color:#d97706!important;font-weight:800}
.text-success{color:#16a34a!important;font-weight:800}
.text-danger{color:#dc2626!important;font-weight:800}


/* =========================================================
   MIS COMISIONES - ADMIN VALORES
   ========================================================= */
.mini-money{
  max-width:110px;
}
.text-warning{
  color:#d97706!important;
  font-weight:800;
}


/* =========================================================
   MIS COMISIONES - MARGEN CONSULTOR AUTOMATICO
   ========================================================= */
.text-info{
  color:#2563eb!important;
  font-weight:800;
}


/* =========================================================
   MIS COMISIONES - VISIBILIDAD USUARIO PAGADOS
   ========================================================= */
.pay-mini{
  min-width:92px;
  height:30px;
  padding:4px 8px;
  font-size:11px;
  font-weight:800;
}


/* =========================================================
   MIS COMISIONES - OCULTAR PAGO NO ADMIN
   ========================================================= */
.th-com-pago{
  white-space:nowrap;
}


/* =========================================================
   FIX SIDEBAR RESPONSIVE - SCROLL VERTICAL
   ========================================================= */

.sidebar,
.side-bar,
.app-sidebar,
#sidebar,
#sideMenu,
aside.sidebar{
  height:100vh!important;
  max-height:100vh!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
}

.sidebar nav,
.side-bar nav,
.app-sidebar nav,
#sidebar nav,
#sideMenu nav,
.side-nav,
.sidebar-menu,
.nav-menu{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding-bottom:18px!important;
  scrollbar-width:thin!important;
  scrollbar-color:rgba(148,163,184,.55) transparent!important;
}

.sidebar-footer,
.sidebar-user,
.user-sidebar-card,
.sidebar .user-card,
#sidebarUser,
.side-user{
  flex:0 0 auto!important;
  position:sticky!important;
  bottom:0!important;
  z-index:8!important;
  background:#0f172a!important;
}

.sidebar nav::-webkit-scrollbar,
.side-bar nav::-webkit-scrollbar,
.app-sidebar nav::-webkit-scrollbar,
#sidebar nav::-webkit-scrollbar,
#sideMenu nav::-webkit-scrollbar,
.side-nav::-webkit-scrollbar,
.sidebar-menu::-webkit-scrollbar,
.nav-menu::-webkit-scrollbar{
  width:7px!important;
}

.sidebar nav::-webkit-scrollbar-track,
.side-bar nav::-webkit-scrollbar-track,
.app-sidebar nav::-webkit-scrollbar-track,
#sidebar nav::-webkit-scrollbar-track,
#sideMenu nav::-webkit-scrollbar-track,
.side-nav::-webkit-scrollbar-track,
.sidebar-menu::-webkit-scrollbar-track,
.nav-menu::-webkit-scrollbar-track{
  background:transparent!important;
}

.sidebar nav::-webkit-scrollbar-thumb,
.side-bar nav::-webkit-scrollbar-thumb,
.app-sidebar nav::-webkit-scrollbar-thumb,
#sidebar nav::-webkit-scrollbar-thumb,
#sideMenu nav::-webkit-scrollbar-thumb,
.side-nav::-webkit-scrollbar-thumb,
.sidebar-menu::-webkit-scrollbar-thumb,
.nav-menu::-webkit-scrollbar-thumb{
  background:rgba(148,163,184,.45)!important;
  border-radius:999px!important;
}

.sidebar nav::-webkit-scrollbar-thumb:hover,
.side-bar nav::-webkit-scrollbar-thumb:hover,
.app-sidebar nav::-webkit-scrollbar-thumb:hover,
#sidebar nav::-webkit-scrollbar-thumb:hover,
#sideMenu nav::-webkit-scrollbar-thumb:hover,
.side-nav::-webkit-scrollbar-thumb:hover,
.sidebar-menu::-webkit-scrollbar-thumb:hover,
.nav-menu::-webkit-scrollbar-thumb:hover{
  background:rgba(148,163,184,.75)!important;
}

@media(max-height:760px){
  .nav-section{
    margin-top:12px!important;
    padding-bottom:5px!important;
    font-size:9px!important;
  }

  .nav-link{
    min-height:36px!important;
    padding-top:8px!important;
    padding-bottom:8px!important;
  }

  .sidebar-footer,
  .sidebar-user,
  .user-sidebar-card,
  .sidebar .user-card,
  #sidebarUser,
  .side-user{
    padding-top:8px!important;
    padding-bottom:8px!important;
  }
}

@media(max-height:650px){
  .nav-link{
    min-height:32px!important;
    padding-top:6px!important;
    padding-bottom:6px!important;
    font-size:12px!important;
  }

  .nav-section{
    margin-top:9px!important;
  }
}

.sidebar.collapsed nav,
.app-sidebar.collapsed nav,
#sidebar.collapsed nav,
.sidebar.is-collapsed nav{
  overflow-y:auto!important;
  overflow-x:hidden!important;
}


/* =========================================================
   FINANZAS / FACTURAS
   ========================================================= */
.invoice-request-list{
  max-height:430px;
  overflow:auto;
  display:grid;
  gap:10px;
  padding-right:4px;
}
.invoice-request-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px;
  border:1px solid #e2e8f0;
  border-radius:14px;
  background:#fff;
}
.invoice-request-item b{
  display:block;
  color:#0f172a;
  font-size:13px;
}
.invoice-request-item small{
  display:block;
  color:#64748b;
  font-size:11px;
  margin-top:3px;
}
.invoice-request-item .btn-mini[disabled]{
  opacity:.55;
  cursor:not-allowed;
}
.field-help.ok{
  color:#16a34a!important;
  font-weight:800;
}

/* =========================================================
   FACTURA SUBIDA SIN APROBAR ORDEN
   ========================================================= */
.current-doc-box{
  margin-top:6px;
  padding:7px 9px;
  border:1px solid #bbf7d0;
  background:#f0fdf4;
  border-radius:10px;
}
.current-doc-box .file-chip,
.current-doc-box a{
  font-size:11px!important;
}

/* =========================================================
   OCULTAR SUBIDA DE FACTURA SI YA EXISTE
   ========================================================= */
.invoice-already-uploaded{
  display:block;
}
.invoice-field-box input[name="invoice"]{
  display:block;
}


/* =========================================================
   PROSPECTOS - ESTILO ODOO / AUTOCOMPLETADO RUC
   ========================================================= */
.prospect-main-header{
  align-items:flex-end!important;
}
.prospect-feature-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
  margin:18px 0 22px;
}
.prospect-feature-card{
  display:flex;
  gap:16px;
  align-items:flex-start;
  padding:22px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:20px;
  box-shadow:0 8px 24px rgba(15,23,42,.06);
}
.prospect-feature-card i{
  width:58px;
  height:58px;
  border-radius:999px;
  display:grid;
  place-items:center;
  font-size:28px;
}
.prospect-feature-card.green i{background:#e9fbf5;color:#10b981}
.prospect-feature-card.blue i{background:#eef4ff;color:#2563eb}
.prospect-feature-card.red i{background:#fff1f1;color:#ef4444}
.prospect-feature-card.purple i{background:#f5edff;color:#7c3aed}
.prospect-feature-card b{
  display:block;
  font-size:20px;
  color:#0f172a;
  margin-bottom:8px;
}
.prospect-feature-card span{
  display:block;
  color:#475569;
  line-height:1.45;
}
.prospect-form-odoo{
  padding-top:4px;
}
.prospect-form-top{
  display:flex;
  gap:18px;
  align-items:center;
  margin-bottom:12px;
}
.radio-inline{
  display:inline-flex;
  gap:6px;
  align-items:center;
  font-weight:800;
  color:#0f172a;
}
.prospect-title-row{
  display:grid;
  grid-template-columns:1fr 96px;
  gap:18px;
  align-items:start;
  margin-bottom:18px;
}
.prospect-title-input{
  border:0!important;
  border-bottom:2px solid #94a3b8!important;
  border-radius:0!important;
  font-size:34px!important;
  font-weight:500!important;
  padding:8px 0!important;
  color:#0f172a!important;
}
.prospect-logo-box{
  width:86px;
  height:86px;
  border:1px solid #e5e7eb;
  border-radius:8px;
  background:#f8fafc;
  display:grid;
  place-items:center;
  color:#cbd5e1;
  font-size:34px;
}
.prospect-grid{
  grid-template-columns:1fr 1fr;
}
.ruc-lookup-row{
  display:flex;
  gap:8px;
  align-items:center;
}
.ruc-lookup-row input{
  flex:1;
}
.prospect-profile-card{
  display:flex;
  align-items:center;
  gap:18px;
  padding:14px;
  border:1px solid #e5e7eb;
  border-radius:18px;
  background:#fff;
  margin-bottom:18px;
}
.prospect-profile-logo{
  width:72px;
  height:72px;
  border-radius:18px;
  background:#dbeafe;
  color:#1d4ed8;
  display:grid;
  place-items:center;
  font-size:24px;
  font-weight:900;
}
.prospect-profile-card h2{
  margin:6px 0 2px;
  font-size:26px;
}
.prospect-profile-card p{
  margin:0;
  color:#64748b;
}
.prospect-detail-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.prospect-detail-grid div{
  padding:12px;
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#f8fafc;
}
.prospect-detail-grid b{
  display:block;
  font-size:11px;
  text-transform:uppercase;
  color:#64748b;
  margin-bottom:6px;
}
.prospect-detail-grid span{
  color:#0f172a;
  font-weight:700;
}
@media(max-width:900px){
  .prospect-feature-grid,
  .prospect-detail-grid{
    grid-template-columns:1fr;
  }
  .prospect-title-row{
    grid-template-columns:1fr;
  }
  .prospect-title-input{
    font-size:24px!important;
  }
}

/* =========================================================
   PROSPECTOS - FIX FORMULARIO
   ========================================================= */
.prospect-form-odoo{padding-top:4px}
.prospect-form-top{display:flex;gap:18px;align-items:center;margin-bottom:12px}
.radio-inline{display:inline-flex;gap:6px;align-items:center;font-weight:800;color:#0f172a}
.prospect-title-row{display:grid;grid-template-columns:1fr 96px;gap:18px;align-items:start;margin-bottom:18px}
.prospect-title-input{border:0!important;border-bottom:2px solid #94a3b8!important;border-radius:0!important;font-size:34px!important;font-weight:500!important;padding:8px 0!important;color:#0f172a!important}
.prospect-logo-box{width:86px;height:86px;border:1px solid #e5e7eb;border-radius:8px;background:#f8fafc;display:grid;place-items:center;color:#cbd5e1;font-size:34px}
.prospect-grid{grid-template-columns:1fr 1fr}
.ruc-lookup-row{display:flex;gap:8px;align-items:center}
.ruc-lookup-row input{flex:1}
.prospect-profile-card{display:flex;align-items:center;gap:18px;padding:14px;border:1px solid #e5e7eb;border-radius:18px;background:#fff;margin-bottom:18px}
.prospect-profile-logo{width:72px;height:72px;border-radius:18px;background:#dbeafe;color:#1d4ed8;display:grid;place-items:center;font-size:24px;font-weight:900}
.prospect-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.prospect-detail-grid div{padding:12px;border:1px solid #e5e7eb;border-radius:14px;background:#f8fafc}
.prospect-detail-grid b{display:block;font-size:11px;text-transform:uppercase;color:#64748b;margin-bottom:6px}
.prospect-detail-grid span{color:#0f172a;font-weight:700}
@media(max-width:900px){.prospect-detail-grid,.prospect-title-row{grid-template-columns:1fr}.prospect-title-input{font-size:24px!important}}


/* =========================================================
   PROSPECTOS - EMPRESA: OCULTAR CONTACTO Y CHECKS SUNAT
   ========================================================= */
.checkbox-inline{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:38px;
  padding:8px 10px;
  border:1px solid #dbeafe;
  background:#f8fbff;
  border-radius:12px;
  color:#334155;
  font-weight:700;
}
.checkbox-inline input{
  width:16px!important;
  height:16px!important;
  accent-color:#0ea5e9;
}
.checkbox-inline span{
  font-size:12px;
  color:#64748b;
}
.prospect-is-company .prospect-contact-field{
  display:none!important;
}
.prospect-company-extra{
  display:block;
}

/* =========================================================
   PROSPECTOS CRM - FICHA ODOO, CONTACTOS Y ACTIVIDADES
   ========================================================= */
.prospect-list-name{display:flex;align-items:center;gap:10px}
.prospect-list-avatar{width:38px;height:38px;border-radius:12px;background:#eaf2ff;display:grid;place-items:center;overflow:hidden;color:#94a3b8}
.prospect-list-avatar img,.prospect-photo-upload img,.prospect-big-photo img{width:100%;height:100%;object-fit:cover}
.prospect-photo-upload{cursor:pointer;overflow:hidden}
.prospect-photo-upload input{display:none!important}
.prospect-crm-view{display:grid;grid-template-columns:minmax(520px,1.2fr) minmax(360px,.8fr);gap:14px;min-height:620px}
.prospect-topbar{display:flex;gap:8px;justify-content:flex-end;margin-bottom:8px}
.prospect-main-card{background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:18px}
.prospect-radio-line{display:flex;gap:14px;font-weight:800;color:#334155;margin-bottom:10px}
.prospect-title-with-photo{display:grid;grid-template-columns:1fr 90px;align-items:start;gap:16px;border-bottom:1px solid #94a3b8;padding-bottom:12px}
.prospect-title-with-photo h2{font-size:30px;margin:0;color:#0f172a;font-weight:500}
.prospect-title-with-photo p{margin:8px 0 0;color:#334155}
.prospect-big-photo{width:86px;height:86px;border:1px solid #e5e7eb;border-radius:8px;background:#f8fafc;display:grid;place-items:center;color:#cbd5e1;font-size:34px;overflow:hidden}
.prospect-hero-card{display:grid;grid-template-columns:110px 1fr;gap:16px;align-items:start;border:1px solid #dbe2ea;background:#fff;padding:12px 14px;border-radius:10px;margin-bottom:10px}
.prospect-hero-photo{width:100px;height:100px;border:1px solid #dbe2ea;border-radius:4px;background:#f8fafc;display:grid;place-items:center;overflow:hidden;color:#cbd5e1;font-size:36px}
.prospect-hero-photo img{width:100%;height:100%;object-fit:cover}
.prospect-hero-info{min-width:0}
.prospect-hero-name{font-size:24px;line-height:1.15;font-weight:700;color:#0f172a;margin-bottom:6px;text-transform:uppercase}
.prospect-hero-line{color:#334155;line-height:1.35;margin:2px 0;word-break:break-word}
.prospect-hero-line.strong{font-weight:600;color:#0f172a}
.prospect-title-with-photo{display:block;border-bottom:1px solid #94a3b8;padding-bottom:12px}
.prospect-title-with-photo h2{font-size:30px;margin:0;color:#0f172a;font-weight:500}
.prospect-title-with-photo p{margin:8px 0 0;color:#334155}
.prospect-company-layout{display:grid;grid-template-columns:1fr 1fr;gap:28px;margin-top:24px}
.prospect-company-layout b{display:block;margin-bottom:8px;color:#0f172a}
.prospect-company-layout p{margin:4px 0;color:#334155}
.plain-check{display:block;margin:8px 0;color:#64748b}
.prospect-tabs-mini{display:flex;gap:0;border-bottom:1px solid #dbe2ea;margin-top:24px}
.prospect-tabs-mini button{background:#fff;border:1px solid transparent;border-bottom:0;padding:10px 14px;color:#475569}
.prospect-tabs-mini button.active{border-color:#dbe2ea;border-radius:8px 8px 0 0;color:#0f172a;font-weight:800}
.prospect-contact-section{padding:18px 10px}
.link-add{background:none;border:0;color:#2563eb;font-weight:900;cursor:pointer;font-size:12px}
.prospect-contact-card{display:flex;gap:10px;align-items:center;width:260px;border:1px solid #dbe2ea;background:#fff;padding:12px;margin-top:12px}
.contact-avatar{width:48px;height:48px;background:#f1f5f9;color:#cbd5e1;display:grid;place-items:center;font-size:28px}
.prospect-contact-card b,.prospect-contact-card small{display:block}
.prospect-crm-right{border-left:1px solid #dbe2ea;background:#fff;min-height:620px;max-height:720px;overflow:auto}
.chatter-tabs{display:flex;border-bottom:1px solid #dbe2ea;position:sticky;top:0;background:#fff;z-index:2}
.chatter-tabs button{border:0;background:#fff;padding:12px 14px;font-weight:800;color:#334155;cursor:pointer}
.chatter-tabs button.active{background:#0f172a;color:#fff}
.chatter-input{padding:14px;border-bottom:1px dashed #cbd5e1}
.chatter-input textarea{width:100%;height:70px;border:1px solid #cbd5e1;border-radius:0;padding:10px;resize:vertical}
.chatter-actions{display:flex;align-items:center;gap:10px;margin-top:8px}
.planned-title{text-align:center;font-weight:900;color:#334155;margin:18px 0 8px}
.activity-line{display:grid;grid-template-columns:38px 1fr;gap:10px;padding:13px;border-bottom:1px solid #eef2f7}
.activity-avatar{width:34px;height:34px;border-radius:999px;background:#e0f2fe;color:#0369a1;display:grid;place-items:center;font-size:11px;font-weight:900}
.activity-line b{color:#0f172a}
.activity-line small{color:#64748b}
.activity-line p{margin:4px 0;color:#111827;white-space:pre-wrap}
.empty-mini{padding:14px}
@media(max-width:1100px){.prospect-crm-view{grid-template-columns:1fr}.prospect-crm-right{border-left:0;border-top:1px solid #dbe2ea}.prospect-company-layout{grid-template-columns:1fr}}

/* =========================================================
   PROSPECTOS - SIN CARDS Y DETALLE EN PLATAFORMA
   ========================================================= */
#page-prospectos .prospect-feature-grid{display:none!important}
#prospectRows tr{cursor:pointer}
#prospectRows tr:hover{background:#f8fbff!important}
#page-prospectos .data-table th:last-child,
#page-prospectos .data-table td:last-child{display:none!important}
.prospect-inline-detail{display:none;animation:fadeIn .18s ease}
.prospect-inline-detail.active{display:block}
.prospect-inline-back{margin-bottom:12px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.prospect-inline-detail .prospect-crm-view{min-height:620px}
.prospect-inline-detail .prospect-crm-right{max-height:calc(100vh - 210px)}
.prospect-inline-detail .prospect-main-card,
.prospect-inline-detail .prospect-crm-right{box-shadow:0 10px 24px rgba(15,23,42,.06)}
.prospect-inline-detail .prospect-topbar{justify-content:flex-start}

/* =========================================================
   PROSPECTOS - FOTO EDITABLE EN DETALLE
   ========================================================= */
.prospect-photo-editable{
  position:relative;
  cursor:pointer;
  display:grid;
}
.prospect-photo-editable input{
  display:none!important;
}
.prospect-photo-editable .photo-edit-overlay{
  position:absolute;
  inset:auto 0 0 0;
  background:rgba(15,23,42,.78);
  color:#fff;
  font-size:10px;
  font-weight:900;
  text-align:center;
  padding:5px 3px;
  opacity:0;
  transition:.18s ease;
}
.prospect-photo-editable:hover .photo-edit-overlay{
  opacity:1;
}
.prospect-photo-editable:hover{
  outline:2px solid #2563eb;
  outline-offset:2px;
}

/* =========================================================
   PROSPECTOS - FOTO ESTILO USUARIO CON ICONOS
   ========================================================= */
.prospect-profile-header-card{
  display:flex;
  align-items:center;
  gap:18px;
  padding:4px 0 18px;
  border-bottom:1px solid #cbd5e1;
  margin-bottom:20px;
}
.prospect-profile-header-card h2{
  margin:0;
  font-size:26px;
  line-height:1.15;
  color:#0f172a;
  font-weight:900;
}
.prospect-profile-header-card p{
  margin:4px 0 8px;
  color:#64748b;
  font-weight:800;
}
.prospect-header-photo-wrap{
  width:88px;
  height:88px;
  position:relative;
  flex:0 0 auto;
}
.prospect-header-photo{
  width:88px;
  height:88px;
  border-radius:999px;
  background:#eef6ff;
  overflow:hidden;
  display:grid;
  place-items:center;
  color:#cbd5e1;
  font-size:34px;
  box-shadow:0 8px 22px rgba(15,23,42,.16);
}
.prospect-header-photo img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.prospect-photo-action{
  position:absolute;
  bottom:-4px;
  width:26px;
  height:26px;
  border-radius:999px;
  border:0;
  background:#fff;
  box-shadow:0 4px 12px rgba(15,23,42,.22);
  display:grid;
  place-items:center;
  color:#0f172a;
  cursor:pointer;
  transition:.16s ease;
  font-size:11px;
}
.prospect-photo-action:hover{
  transform:translateY(-1px);
  background:#f8fafc;
}
.prospect-photo-action input{
  display:none!important;
}
.prospect-photo-edit{
  left:10px;
}
.prospect-photo-delete{
  right:10px;
}
.prospect-photo-edit i{
  color:#2563eb;
}
.prospect-photo-delete i{
  color:#0f172a;
}

/* =========================================================
   PROSPECTOS - FOTO POSICIÓN ODOO Y AUTOGUARDADO
   ========================================================= */
.prospect-odoo-card{
  position:relative;
}
.prospect-odoo-radio-line{
  display:flex;
  gap:14px;
  font-weight:800;
  color:#334155;
  margin-bottom:10px;
}
.prospect-odoo-title-row{
  display:grid;
  grid-template-columns:1fr 96px;
  gap:18px;
  align-items:start;
  border-bottom:1px solid #94a3b8;
  padding-bottom:14px;
  margin-bottom:22px;
}
.prospect-odoo-title-text h2{
  margin:0;
  font-size:28px;
  line-height:1.15;
  color:#0f172a;
  font-weight:500;
}
.prospect-odoo-title-text p{
  margin:6px 0 0;
  color:#334155;
  font-weight:700;
}
.prospect-odoo-photo-wrap{
  width:86px;
  height:86px;
  justify-self:end;
  position:relative;
}
.prospect-odoo-photo-box{
  width:86px;
  height:86px;
  border:1px solid #dbe2ea;
  border-radius:2px;
  background:#f8fafc;
  display:grid;
  place-items:center;
  cursor:pointer;
  position:relative;
  overflow:visible;
}
.prospect-odoo-photo-box input{
  display:none!important;
}
.prospect-odoo-photo-img{
  width:100%;
  height:100%;
  display:grid;
  place-items:center;
  overflow:hidden;
  color:#cbd5e1;
  font-size:34px;
}
.prospect-odoo-photo-img img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.prospect-odoo-photo-img i{
  color:#cbd5e1;
}
.prospect-odoo-photo-edit{
  position:absolute;
  left:8px;
  bottom:-10px;
  width:22px;
  height:22px;
  border-radius:3px;
  background:#fff;
  border:1px solid #cbd5e1;
  display:grid;
  place-items:center;
  box-shadow:0 2px 6px rgba(15,23,42,.15);
  color:#0f172a;
  font-size:10px;
}
.prospect-odoo-photo-edit::after{
  content:"Editar";
  position:absolute;
  top:25px;
  left:-6px;
  font-size:10px;
  background:#fff;
  border:1px solid #cbd5e1;
  color:#334155;
  padding:2px 6px;
  border-radius:2px;
  opacity:0;
  pointer-events:none;
}
.prospect-odoo-photo-box:hover .prospect-odoo-photo-edit::after{
  opacity:1;
}
.prospect-odoo-photo-wrap.uploading::before{
  content:"Guardando...";
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.82);
  color:#2563eb;
  font-size:11px;
  font-weight:900;
  z-index:3;
}
@media(max-width:700px){
  .prospect-odoo-title-row{
    grid-template-columns:1fr;
  }
  .prospect-odoo-photo-wrap{
    justify-self:start;
  }
}

/* =========================================================
   PROSPECTOS - MÉTRICAS ODOO AMARRADAS
   ========================================================= */
.prospect-odoo-metricbar{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  border:1px solid #dbe2ea;
  border-left:0;
  border-right:0;
  margin:-18px -18px 18px;
  background:#fff;
}
.prospect-odoo-metricbar .metric-cell{
  min-height:52px;
  border-right:1px solid #dbe2ea;
  display:grid;
  grid-template-columns:24px auto;
  grid-template-rows:1fr 1fr;
  column-gap:7px;
  align-items:center;
  justify-content:center;
  padding:6px 8px;
  color:#334155;
}
.prospect-odoo-metricbar .metric-cell:last-child{
  border-right:0;
}
.prospect-odoo-metricbar .metric-cell i{
  grid-row:1 / span 2;
  font-size:17px;
  color:#475569;
}
.prospect-odoo-metricbar .metric-cell b{
  font-size:12px;
  line-height:1;
  color:#1e3a8a;
  font-weight:900;
}
.prospect-odoo-metricbar .metric-cell span{
  font-size:10px;
  line-height:1;
  color:#475569;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
@media(max-width:1100px){
  .prospect-odoo-metricbar{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}
@media(max-width:650px){
  .prospect-odoo-metricbar{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

/* =========================================================
   PROSPECTOS - HOJAS DE VENTAS Y FACTURAS
   ========================================================= */
.prospect-odoo-metricbar .metric-click{
  border:0;
  border-right:1px solid #dbe2ea;
  background:#fff;
  cursor:pointer;
  font-family:inherit;
}
.prospect-odoo-metricbar .metric-click:hover{
  background:#f8fbff;
}
.prospect-related-sheet{
  background:#fff;
  border:1px solid #dbe2ea;
  border-radius:12px;
  overflow:hidden;
}
.related-sheet-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 10px;
  border-bottom:1px solid #dbe2ea;
  background:#fff;
}
.related-search{
  color:#64748b;
  border-bottom:1px solid #94a3b8;
  min-width:260px;
  font-size:12px;
  padding:3px 0;
}
.related-table th,
.related-table td{
  font-size:12px;
}
.related-table .text-right{
  text-align:right;
  font-weight:800;
}
.related-sheet-total{
  background:#0f2a33;
  color:#fff;
  text-align:right;
  padding:10px 18px;
  font-weight:900;
}

/* =========================================================
   ORDENES - MONTO FACTURADO
   ========================================================= */
.invoice-amount-link{
  border:1px solid #bfdbfe;
  background:#eff6ff;
  color:#1d4ed8;
  border-radius:10px;
  padding:7px 10px;
  font-weight:900;
  cursor:pointer;
}
.invoice-amount-link:hover{
  background:#dbeafe;
}
.invoice-amount-btn{
  background:#fff7ed!important;
  color:#c2410c!important;
}
.invoice-amount-btn:hover{
  background:#fed7aa!important;
}

/* =========================================================
   COTIZACIONES COMERCIALES / PROSPECTOS
   ========================================================= */
.prospect-odoo-metricbar-4{
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
}
.sales-quotes-list-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  overflow:hidden;
  box-shadow:0 10px 24px rgba(15,23,42,.04);
}
.sales-quote-form h2{
  font-size:28px;
  margin:20px 0 18px;
}
.sales-quote-actions{
  display:flex;
  gap:6px;
  border-bottom:1px solid #dbe2ea;
  padding-bottom:8px;
}
.sales-quote-status{
  display:flex;
  justify-content:flex-end;
  gap:0;
  margin-top:8px;
}
.sales-quote-status span{
  padding:8px 16px;
  background:#f1f5f9;
  color:#475569;
  font-size:11px;
  font-weight:900;
  border-right:1px solid #dbe2ea;
}
.sales-quote-status span.active{
  background:#0f2a33;
  color:#fff;
}
.sales-quote-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px 28px;
}
.sales-tabs{
  margin-top:22px;
}
.sales-lines-table input{
  width:100%;
  border:0;
  border-bottom:1px solid #cbd5e1;
  padding:6px;
  background:transparent;
}
.sales-quote-totals{
  width:320px;
  margin:22px 0 0 auto;
}
.sales-quote-totals div{
  display:flex;
  justify-content:space-between;
  padding:6px 0;
  border-bottom:1px solid #e5e7eb;
}
.sales-value-added{
  margin-top:40px;
  font-size:12px;
  color:#334155;
}
.metric-cell.metric-click{
  border:0;
  background:#fff;
  cursor:pointer;
  font-family:inherit;
}
.metric-cell.metric-click:hover{
  background:#f8fbff;
}
@media(max-width:900px){
  .sales-quote-grid{grid-template-columns:1fr}
  .prospect-odoo-metricbar-4{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* =========================================================
   COTIZACIONES - FORMULARIO INLINE
   ========================================================= */
.sales-quote-inline-form{
  display:none;
}
.sales-quote-inline-form.active{
  display:block;
}
.sales-quote-inline-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:12px;
}
.sales-quote-form-inline{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:18px;
  box-shadow:0 10px 24px rgba(15,23,42,.05);
}
.sales-quote-footer{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:22px;
  border-top:1px solid #e5e7eb;
  padding-top:16px;
}


/* =========================================================
   FIX ESTABLE MENÚ COTIZACIONES - SIN PARPADEO
   ========================================================= */
.sidebar .nav-link.nav-text-fixed,
.sidebar a.nav-text-fixed{
  min-height:44px!important;
  height:auto!important;
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  overflow:visible!important;
}
.sidebar .nav-link.nav-text-fixed .nav-label-fixed,
.sidebar a.nav-text-fixed .nav-label-fixed{
  display:block!important;
  white-space:normal!important;
  line-height:1.12!important;
  font-size:12px!important;
  font-weight:700!important;
  overflow:visible!important;
  text-overflow:clip!important;
  flex:1 1 auto!important;
}
.sidebar .nav-link.nav-text-fixed .badge,
.sidebar .nav-link.nav-text-fixed .nav-badge,
.sidebar .nav-link.nav-text-fixed .menu-badge,
.sidebar a.nav-text-fixed .badge,
.sidebar a.nav-text-fixed .nav-badge,
.sidebar a.nav-text-fixed .menu-badge{
  margin-left:auto!important;
  flex:0 0 auto!important;
}

/* =========================================================
   FIX ESTABLE MENÚ - PROPECTO COMERCIAL
   ========================================================= */
.sidebar .nav-link[data-page="prospectos"].nav-text-fixed,
.sidebar a[data-page="prospectos"].nav-text-fixed{
  min-height:44px!important;
  height:auto!important;
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  overflow:visible!important;
}
.sidebar .nav-link[data-page="prospectos"].nav-text-fixed .nav-label-fixed,
.sidebar a[data-page="prospectos"].nav-text-fixed .nav-label-fixed{
  display:block!important;
  white-space:normal!important;
  line-height:1.12!important;
  font-size:12px!important;
  font-weight:700!important;
  overflow:visible!important;
  text-overflow:clip!important;
  flex:1 1 auto!important;
}

/* =========================================================
   SIDEBAR COLAPSO ESTABLE - ICONOS ORIGINALES
   ========================================================= */

/* Estado colapsado: solo iconos */
.sidebar.lpw-sidebar-collapsed{
  overflow-x:hidden!important;
}

/* Ocultar textos, pero NO tocar iconos */
.sidebar.lpw-sidebar-collapsed .nav-link span,
.sidebar.lpw-sidebar-collapsed .nav-link .nav-label-fixed,
.sidebar.lpw-sidebar-collapsed a[data-page] span,
.sidebar.lpw-sidebar-collapsed a[data-page] .nav-label-fixed,
.sidebar.lpw-sidebar-collapsed .menu-text,
.sidebar.lpw-sidebar-collapsed .nav-text,
.sidebar.lpw-sidebar-collapsed .sidebar-label{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  width:0!important;
  max-width:0!important;
  overflow:hidden!important;
}

/* Ocultar títulos de categoría cuando está replegado */
.sidebar.lpw-sidebar-collapsed .section-title,
.sidebar.lpw-sidebar-collapsed .nav-section-title,
.sidebar.lpw-sidebar-collapsed .sidebar-section,
.sidebar.lpw-sidebar-collapsed .menu-section-title,
.sidebar.lpw-sidebar-collapsed .sidebar-heading{
  color:transparent!important;
  font-size:0!important;
  line-height:0!important;
  height:10px!important;
  min-height:10px!important;
  margin:6px 0!important;
  padding:0!important;
  overflow:hidden!important;
}

/* Links centrados y compactos */
.sidebar.lpw-sidebar-collapsed .nav-link,
.sidebar.lpw-sidebar-collapsed a[data-page],
.sidebar .nav-link.lpw-icon-only,
.sidebar a[data-page].lpw-icon-only{
  width:42px!important;
  min-width:42px!important;
  max-width:42px!important;
  height:42px!important;
  min-height:42px!important;
  max-height:42px!important;
  padding:0!important;
  margin:5px auto!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:0!important;
  position:relative!important;
  overflow:visible!important;
  border-radius:12px!important;
}

/* Mantener iconos originales visibles */
.sidebar.lpw-sidebar-collapsed .nav-link > i,
.sidebar.lpw-sidebar-collapsed a[data-page] > i,
.sidebar.lpw-sidebar-collapsed .nav-link > svg,
.sidebar.lpw-sidebar-collapsed a[data-page] > svg,
.sidebar .nav-link.lpw-icon-only > i,
.sidebar a[data-page].lpw-icon-only > i,
.sidebar .nav-link.lpw-icon-only > svg,
.sidebar a[data-page].lpw-icon-only > svg{
  display:inline-flex!important;
  visibility:visible!important;
  opacity:1!important;
  width:18px!important;
  min-width:18px!important;
  height:18px!important;
  min-height:18px!important;
  align-items:center!important;
  justify-content:center!important;
  margin:0!important;
  font-size:16px!important;
  line-height:1!important;
  color:inherit!important;
  flex:0 0 auto!important;
}

/* Si el icono está más profundo, también conservarlo */
.sidebar.lpw-sidebar-collapsed .nav-link i,
.sidebar.lpw-sidebar-collapsed a[data-page] i,
.sidebar.lpw-sidebar-collapsed .nav-link svg,
.sidebar.lpw-sidebar-collapsed a[data-page] svg{
  visibility:visible!important;
  opacity:1!important;
}

/* Badge pequeño en esquina */
.sidebar.lpw-sidebar-collapsed .nav-link .badge,
.sidebar.lpw-sidebar-collapsed .nav-link .nav-badge,
.sidebar.lpw-sidebar-collapsed .nav-link .menu-badge,
.sidebar.lpw-sidebar-collapsed .nav-link .count,
.sidebar.lpw-sidebar-collapsed .nav-link [class*="badge"],
.sidebar.lpw-sidebar-collapsed .nav-link [class*="count"],
.sidebar.lpw-sidebar-collapsed a[data-page] .badge,
.sidebar.lpw-sidebar-collapsed a[data-page] .nav-badge,
.sidebar.lpw-sidebar-collapsed a[data-page] .menu-badge,
.sidebar.lpw-sidebar-collapsed a[data-page] .count,
.sidebar.lpw-sidebar-collapsed a[data-page] [class*="badge"],
.sidebar.lpw-sidebar-collapsed a[data-page] [class*="count"]{
  position:absolute!important;
  right:-2px!important;
  top:-2px!important;
  margin:0!important;
  transform:scale(.72)!important;
  transform-origin:center!important;
  display:inline-flex!important;
  visibility:visible!important;
  opacity:1!important;
  z-index:3!important;
}

/* Footer usuario colapsado: solo avatar/icono */
.sidebar.lpw-sidebar-collapsed .user-info,
.sidebar.lpw-sidebar-collapsed .sidebar-user .user-name,
.sidebar.lpw-sidebar-collapsed .sidebar-user .user-role,
.sidebar.lpw-sidebar-collapsed .profile-name,
.sidebar.lpw-sidebar-collapsed .profile-role{
  display:none!important;
}

/* No expandir el área del menú al colapsar */
.sidebar.lpw-sidebar-collapsed .nav-link.active,
.sidebar.lpw-sidebar-collapsed .nav-link:hover{
  width:42px!important;
  min-width:42px!important;
}

/* =========================================================
   SIDEBAR COLAPSADO - ICONOS + TOOLTIP FINAL
   ========================================================= */
.sidebar.lpw-sidebar-collapsed-final .nav-link,
.sidebar.lpw-sidebar-collapsed-final a[data-page],
.sidebar .nav-link.lpw-icon-only-final,
.sidebar a[data-page].lpw-icon-only-final{
  width:42px!important;
  min-width:42px!important;
  max-width:42px!important;
  height:42px!important;
  min-height:42px!important;
  max-height:42px!important;
  padding:0!important;
  margin:5px auto!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:0!important;
  position:relative!important;
  overflow:visible!important;
  border-radius:12px!important;
}

/* Ocultar solo textos/labels, jamás el icono */
.sidebar.lpw-sidebar-collapsed-final .nav-link span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar.lpw-sidebar-collapsed-final a[data-page] span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar.lpw-sidebar-collapsed-final .nav-link .nav-label-fixed,
.sidebar.lpw-sidebar-collapsed-final a[data-page] .nav-label-fixed,
.sidebar .nav-link.lpw-icon-only-final span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar a[data-page].lpw-icon-only-final span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar .nav-link.lpw-icon-only-final .nav-label-fixed,
.sidebar a[data-page].lpw-icon-only-final .nav-label-fixed{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  width:0!important;
  max-width:0!important;
  overflow:hidden!important;
}

/* Íconos originales o fallback siempre visibles */
.sidebar.lpw-sidebar-collapsed-final .nav-link .lpw-sidebar-icon,
.sidebar.lpw-sidebar-collapsed-final a[data-page] .lpw-sidebar-icon,
.sidebar.lpw-sidebar-collapsed-final .nav-link > i,
.sidebar.lpw-sidebar-collapsed-final a[data-page] > i,
.sidebar.lpw-sidebar-collapsed-final .nav-link > svg,
.sidebar.lpw-sidebar-collapsed-final a[data-page] > svg,
.sidebar .nav-link.lpw-icon-only-final .lpw-sidebar-icon,
.sidebar a[data-page].lpw-icon-only-final .lpw-sidebar-icon,
.sidebar .nav-link.lpw-icon-only-final > i,
.sidebar a[data-page].lpw-icon-only-final > i,
.sidebar .nav-link.lpw-icon-only-final > svg,
.sidebar a[data-page].lpw-icon-only-final > svg{
  display:inline-flex!important;
  visibility:visible!important;
  opacity:1!important;
  width:18px!important;
  min-width:18px!important;
  height:18px!important;
  min-height:18px!important;
  align-items:center!important;
  justify-content:center!important;
  margin:0!important;
  font-size:16px!important;
  line-height:1!important;
  color:inherit!important;
  flex:0 0 18px!important;
}

/* Badges */
.sidebar.lpw-sidebar-collapsed-final .nav-link .badge,
.sidebar.lpw-sidebar-collapsed-final .nav-link .nav-badge,
.sidebar.lpw-sidebar-collapsed-final .nav-link .menu-badge,
.sidebar.lpw-sidebar-collapsed-final .nav-link .count,
.sidebar.lpw-sidebar-collapsed-final .nav-link [class*="badge"],
.sidebar.lpw-sidebar-collapsed-final .nav-link [class*="count"],
.sidebar .nav-link.lpw-icon-only-final .badge,
.sidebar .nav-link.lpw-icon-only-final .nav-badge,
.sidebar .nav-link.lpw-icon-only-final .menu-badge,
.sidebar .nav-link.lpw-icon-only-final .count,
.sidebar .nav-link.lpw-icon-only-final [class*="badge"],
.sidebar .nav-link.lpw-icon-only-final [class*="count"]{
  position:absolute!important;
  right:-2px!important;
  top:-2px!important;
  margin:0!important;
  transform:scale(.72)!important;
  transform-origin:center!important;
  z-index:4!important;
  display:inline-flex!important;
  visibility:visible!important;
  opacity:1!important;
}

/* Tooltip al pasar mouse en menú replegado */
.sidebar.lpw-sidebar-collapsed-final .nav-link[data-tooltip]:hover::after,
.sidebar.lpw-sidebar-collapsed-final a[data-page][data-tooltip]:hover::after,
.sidebar .nav-link.lpw-icon-only-final[data-tooltip]:hover::after,
.sidebar a[data-page].lpw-icon-only-final[data-tooltip]:hover::after{
  content:attr(data-tooltip);
  position:absolute!important;
  left:50px!important;
  top:50%!important;
  transform:translateY(-50%)!important;
  background:#111827!important;
  color:#fff!important;
  padding:7px 10px!important;
  border-radius:8px!important;
  font-size:12px!important;
  line-height:1.1!important;
  white-space:nowrap!important;
  z-index:99999!important;
  box-shadow:0 10px 22px rgba(15,23,42,.25)!important;
  pointer-events:none!important;
}

.sidebar.lpw-sidebar-collapsed-final .nav-link[data-tooltip]:hover::before,
.sidebar.lpw-sidebar-collapsed-final a[data-page][data-tooltip]:hover::before,
.sidebar .nav-link.lpw-icon-only-final[data-tooltip]:hover::before,
.sidebar a[data-page].lpw-icon-only-final[data-tooltip]:hover::before{
  content:"";
  position:absolute!important;
  left:44px!important;
  top:50%!important;
  transform:translateY(-50%)!important;
  border:6px solid transparent!important;
  border-right-color:#111827!important;
  z-index:99999!important;
}

/* =========================================================
   SIDEBAR - ALINEACIÓN IZQUIERDA Y SECCIONES EN UNA LÍNEA
   ========================================================= */

/* Al replegar, los iconos no deben quedar centrados: van alineados a la izquierda */
.sidebar.lpw-left-collapsed .nav-link,
.sidebar.lpw-left-collapsed a[data-page],
.sidebar.lpw-sidebar-collapsed-final .nav-link,
.sidebar.lpw-sidebar-collapsed-final a[data-page],
.sidebar .nav-link.lpw-icon-only-final,
.sidebar a[data-page].lpw-icon-only-final{
  justify-content:flex-start!important;
  align-items:center!important;
  padding-left:18px!important;
  padding-right:0!important;
  margin-left:0!important;
  margin-right:auto!important;
  width:58px!important;
  min-width:58px!important;
  max-width:58px!important;
  gap:0!important;
}

/* Icono pegado a la izquierda en estado replegado */
.sidebar.lpw-left-collapsed .nav-link > i,
.sidebar.lpw-left-collapsed a[data-page] > i,
.sidebar.lpw-left-collapsed .nav-link > svg,
.sidebar.lpw-left-collapsed a[data-page] > svg,
.sidebar.lpw-left-collapsed .nav-link .lpw-sidebar-icon,
.sidebar.lpw-left-collapsed a[data-page] .lpw-sidebar-icon{
  margin-left:0!important;
  margin-right:0!important;
  flex:0 0 18px!important;
}

/* Secciones/categorías siempre en una sola línea */
.sidebar .section-title,
.sidebar .nav-section-title,
.sidebar .sidebar-section,
.sidebar .menu-section-title,
.sidebar .sidebar-heading{
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

/* En replegado, mantener las secciones compactas y sin partirse */
.sidebar.lpw-left-collapsed .section-title,
.sidebar.lpw-left-collapsed .nav-section-title,
.sidebar.lpw-left-collapsed .sidebar-section,
.sidebar.lpw-left-collapsed .menu-section-title,
.sidebar.lpw-left-collapsed .sidebar-heading,
.sidebar.lpw-sidebar-collapsed-final .section-title,
.sidebar.lpw-sidebar-collapsed-final .nav-section-title,
.sidebar.lpw-sidebar-collapsed-final .sidebar-section,
.sidebar.lpw-sidebar-collapsed-final .menu-section-title,
.sidebar.lpw-sidebar-collapsed-final .sidebar-heading{
  white-space:nowrap!important;
  height:12px!important;
  min-height:12px!important;
  line-height:12px!important;
  font-size:9px!important;
  overflow:hidden!important;
  text-overflow:clip!important;
  padding-left:8px!important;
  margin:8px 0!important;
}

/* Texto normal del menú desplegado: una línea si entra, sin partir palabras raras */
.sidebar:not(.lpw-left-collapsed) .nav-link span,
.sidebar:not(.lpw-left-collapsed) a[data-page] span,
.sidebar:not(.lpw-left-collapsed) .nav-label-fixed{
  word-break:normal!important;
  overflow-wrap:normal!important;
}

/* =========================================================
   SIDEBAR - TEXTOS UNA LÍNEA Y ALINEACIÓN FINAL
   ========================================================= */

/* Menú desplegado: todos los ítems alineados igual */
.sidebar.lpw-expanded-final .nav-link,
.sidebar.lpw-expanded-final a[data-page],
.sidebar:not(.lpw-collapsed-final) .nav-link,
.sidebar:not(.lpw-collapsed-final) a[data-page]{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:12px!important;
  min-height:42px!important;
  height:42px!important;
  padding:0 14px!important;
  margin:3px 8px!important;
  width:auto!important;
  max-width:none!important;
  overflow:hidden!important;
  position:relative!important;
}

/* Icono desplegado: ancho fijo para que todos los textos arranquen en la misma línea */
.sidebar.lpw-expanded-final .nav-link > i,
.sidebar.lpw-expanded-final a[data-page] > i,
.sidebar.lpw-expanded-final .nav-link > svg,
.sidebar.lpw-expanded-final a[data-page] > svg,
.sidebar.lpw-expanded-final .nav-link .lpw-menu-icon-final,
.sidebar.lpw-expanded-final a[data-page] .lpw-menu-icon-final,
.sidebar:not(.lpw-collapsed-final) .nav-link > i,
.sidebar:not(.lpw-collapsed-final) a[data-page] > i,
.sidebar:not(.lpw-collapsed-final) .nav-link > svg,
.sidebar:not(.lpw-collapsed-final) a[data-page] > svg{
  flex:0 0 18px!important;
  width:18px!important;
  min-width:18px!important;
  height:18px!important;
  margin:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}

/* Texto desplegado: una sola línea, sin salto, sin partir palabras */
.sidebar.lpw-expanded-final .nav-link span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar.lpw-expanded-final a[data-page] span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar.lpw-expanded-final .nav-link .nav-label-fixed,
.sidebar.lpw-expanded-final a[data-page] .nav-label-fixed,
.sidebar.lpw-expanded-final .nav-link .lpw-menu-label-final,
.sidebar.lpw-expanded-final a[data-page] .lpw-menu-label-final,
.sidebar:not(.lpw-collapsed-final) .nav-link span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar:not(.lpw-collapsed-final) a[data-page] span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar:not(.lpw-collapsed-final) .nav-link .nav-label-fixed,
.sidebar:not(.lpw-collapsed-final) a[data-page] .nav-label-fixed{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  white-space:nowrap!important;
  word-break:keep-all!important;
  overflow-wrap:normal!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  line-height:1.15!important;
  max-width:145px!important;
  flex:1 1 auto!important;
}

/* Contadores en menú desplegado a la derecha */
.sidebar.lpw-expanded-final .nav-link .badge,
.sidebar.lpw-expanded-final .nav-link .nav-badge,
.sidebar.lpw-expanded-final .nav-link .menu-badge,
.sidebar.lpw-expanded-final .nav-link [class*="badge"],
.sidebar.lpw-expanded-final .nav-link [class*="count"],
.sidebar:not(.lpw-collapsed-final) .nav-link .badge,
.sidebar:not(.lpw-collapsed-final) .nav-link .nav-badge,
.sidebar:not(.lpw-collapsed-final) .nav-link .menu-badge,
.sidebar:not(.lpw-collapsed-final) .nav-link [class*="badge"],
.sidebar:not(.lpw-collapsed-final) .nav-link [class*="count"]{
  margin-left:auto!important;
  flex:0 0 auto!important;
  position:static!important;
  transform:none!important;
}

/* Categorías: una sola línea */
.sidebar .section-title,
.sidebar .nav-section-title,
.sidebar .sidebar-section,
.sidebar .menu-section-title,
.sidebar .sidebar-heading{
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  line-height:1!important;
}

/* Menú replegado: solo íconos, alineados a la izquierda */
.sidebar.lpw-collapsed-final .nav-link,
.sidebar.lpw-collapsed-final a[data-page],
.sidebar.lpw-sidebar-collapsed-final .nav-link,
.sidebar.lpw-sidebar-collapsed-final a[data-page],
.sidebar.lpw-left-collapsed .nav-link,
.sidebar.lpw-left-collapsed a[data-page]{
  width:52px!important;
  min-width:52px!important;
  max-width:52px!important;
  height:42px!important;
  min-height:42px!important;
  padding:0 0 0 18px!important;
  margin:5px 0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:0!important;
  overflow:visible!important;
  position:relative!important;
}

/* Replegado: ocultar texto */
.sidebar.lpw-collapsed-final .nav-link span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar.lpw-collapsed-final a[data-page] span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar.lpw-collapsed-final .nav-link .nav-label-fixed,
.sidebar.lpw-collapsed-final a[data-page] .nav-label-fixed,
.sidebar.lpw-sidebar-collapsed-final .nav-link span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar.lpw-sidebar-collapsed-final a[data-page] span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar.lpw-left-collapsed .nav-link span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar.lpw-left-collapsed a[data-page] span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count){
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  width:0!important;
  max-width:0!important;
  overflow:hidden!important;
}

/* Replegado: icono visible */
.sidebar.lpw-collapsed-final .nav-link > i,
.sidebar.lpw-collapsed-final a[data-page] > i,
.sidebar.lpw-collapsed-final .nav-link > svg,
.sidebar.lpw-collapsed-final a[data-page] > svg,
.sidebar.lpw-collapsed-final .nav-link .lpw-sidebar-icon,
.sidebar.lpw-collapsed-final a[data-page] .lpw-sidebar-icon{
  display:inline-flex!important;
  visibility:visible!important;
  opacity:1!important;
  width:18px!important;
  height:18px!important;
  min-width:18px!important;
  margin:0!important;
  flex:0 0 18px!important;
}

/* =========================================================
   SIDEBAR - ALINEAR TEXTOS A LA IZQUIERDA FINAL
   ========================================================= */

/* Menú desplegado: icono fijo + texto inmediatamente a la derecha */
.sidebar:not(.lpw-collapsed-final) .nav-link,
.sidebar:not(.lpw-collapsed-final) a[data-page],
.sidebar.lpw-expanded-final .nav-link,
.sidebar.lpw-expanded-final a[data-page]{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  text-align:left!important;
  gap:0!important;
  padding-left:16px!important;
  padding-right:10px!important;
  width:auto!important;
}

/* Icono con ancho fijo */
.sidebar:not(.lpw-collapsed-final) .nav-link > i,
.sidebar:not(.lpw-collapsed-final) a[data-page] > i,
.sidebar:not(.lpw-collapsed-final) .nav-link > svg,
.sidebar:not(.lpw-collapsed-final) a[data-page] > svg,
.sidebar:not(.lpw-collapsed-final) .nav-link .lpw-menu-icon-final,
.sidebar:not(.lpw-collapsed-final) a[data-page] .lpw-menu-icon-final,
.sidebar:not(.lpw-collapsed-final) .nav-link .lpw-sidebar-icon,
.sidebar:not(.lpw-collapsed-final) a[data-page] .lpw-sidebar-icon{
  flex:0 0 18px!important;
  width:18px!important;
  min-width:18px!important;
  max-width:18px!important;
  height:18px!important;
  margin:0!important;
  text-align:center!important;
}

/* Texto: alineado a la izquierda, no centrado, empieza igual en todas las filas */
.sidebar:not(.lpw-collapsed-final) .nav-link span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar:not(.lpw-collapsed-final) a[data-page] span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar:not(.lpw-collapsed-final) .nav-link .nav-label-fixed,
.sidebar:not(.lpw-collapsed-final) a[data-page] .nav-label-fixed,
.sidebar:not(.lpw-collapsed-final) .nav-link .lpw-menu-label-final,
.sidebar:not(.lpw-collapsed-final) a[data-page] .lpw-menu-label-final,
.sidebar.lpw-expanded-final .nav-link span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar.lpw-expanded-final a[data-page] span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar.lpw-expanded-final .nav-link .nav-label-fixed,
.sidebar.lpw-expanded-final a[data-page] .nav-label-fixed{
  display:block!important;
  flex:1 1 auto!important;
  margin-left:12px!important;
  text-align:left!important;
  justify-content:flex-start!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  max-width:150px!important;
}

/* Evitar que algunos labels queden centrados por estilos anteriores */
.sidebar .nav-link,
.sidebar a[data-page]{
  text-align:left!important;
}

.sidebar .nav-link .nav-label-fixed,
.sidebar a[data-page] .nav-label-fixed,
.sidebar .nav-link span,
.sidebar a[data-page] span{
  text-align:left!important;
}

/* Badge queda a la derecha, sin empujar el texto al centro */
.sidebar:not(.lpw-collapsed-final) .nav-link .badge,
.sidebar:not(.lpw-collapsed-final) .nav-link .nav-badge,
.sidebar:not(.lpw-collapsed-final) .nav-link .menu-badge,
.sidebar:not(.lpw-collapsed-final) .nav-link [class*="badge"],
.sidebar:not(.lpw-collapsed-final) .nav-link [class*="count"],
.sidebar.lpw-expanded-final .nav-link .badge,
.sidebar.lpw-expanded-final .nav-link .nav-badge,
.sidebar.lpw-expanded-final .nav-link .menu-badge,
.sidebar.lpw-expanded-final .nav-link [class*="badge"],
.sidebar.lpw-expanded-final .nav-link [class*="count"]{
  margin-left:auto!important;
  flex:0 0 auto!important;
  position:static!important;
}

/* =========================================================
   SIDEBAR - ALINEACIÓN ABSOLUTA FINAL
   ========================================================= */

/*
  Solución final:
  El problema viene de estilos previos que centran el contenido del link.
  Aquí se fuerza una estructura fija:
  - Icono absoluto a la izquierda.
  - Texto absoluto desde el mismo punto en todas las filas.
  - Badge absoluto a la derecha.
*/

/* Estado desplegado */
.sidebar:not(.lpw-collapsed-final):not(.lpw-sidebar-collapsed-final):not(.lpw-left-collapsed) .nav-link,
.sidebar:not(.lpw-collapsed-final):not(.lpw-sidebar-collapsed-final):not(.lpw-left-collapsed) a[data-page],
.sidebar.lpw-expanded-final .nav-link,
.sidebar.lpw-expanded-final a[data-page]{
  position:relative!important;
  display:block!important;
  height:42px!important;
  min-height:42px!important;
  line-height:42px!important;
  padding:0!important;
  margin:3px 8px!important;
  width:calc(100% - 16px)!important;
  max-width:calc(100% - 16px)!important;
  overflow:hidden!important;
  text-align:left!important;
}

/* Icono fijo a la izquierda */
.sidebar:not(.lpw-collapsed-final):not(.lpw-sidebar-collapsed-final):not(.lpw-left-collapsed) .nav-link > i,
.sidebar:not(.lpw-collapsed-final):not(.lpw-sidebar-collapsed-final):not(.lpw-left-collapsed) a[data-page] > i,
.sidebar:not(.lpw-collapsed-final):not(.lpw-sidebar-collapsed-final):not(.lpw-left-collapsed) .nav-link > svg,
.sidebar:not(.lpw-collapsed-final):not(.lpw-sidebar-collapsed-final):not(.lpw-left-collapsed) a[data-page] > svg,
.sidebar:not(.lpw-collapsed-final):not(.lpw-sidebar-collapsed-final):not(.lpw-left-collapsed) .nav-link .lpw-sidebar-icon,
.sidebar:not(.lpw-collapsed-final):not(.lpw-sidebar-collapsed-final):not(.lpw-left-collapsed) a[data-page] .lpw-sidebar-icon,
.sidebar.lpw-expanded-final .nav-link > i,
.sidebar.lpw-expanded-final a[data-page] > i,
.sidebar.lpw-expanded-final .nav-link > svg,
.sidebar.lpw-expanded-final a[data-page] > svg,
.sidebar.lpw-expanded-final .nav-link .lpw-sidebar-icon,
.sidebar.lpw-expanded-final a[data-page] .lpw-sidebar-icon{
  position:absolute!important;
  left:16px!important;
  top:50%!important;
  transform:translateY(-50%)!important;
  width:18px!important;
  min-width:18px!important;
  height:18px!important;
  min-height:18px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  margin:0!important;
  font-size:16px!important;
  line-height:1!important;
  visibility:visible!important;
  opacity:1!important;
}

/* Texto fijo: siempre inicia en la misma coordenada */
.sidebar:not(.lpw-collapsed-final):not(.lpw-sidebar-collapsed-final):not(.lpw-left-collapsed) .nav-link span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar:not(.lpw-collapsed-final):not(.lpw-sidebar-collapsed-final):not(.lpw-left-collapsed) a[data-page] span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar:not(.lpw-collapsed-final):not(.lpw-sidebar-collapsed-final):not(.lpw-left-collapsed) .nav-link .nav-label-fixed,
.sidebar:not(.lpw-collapsed-final):not(.lpw-sidebar-collapsed-final):not(.lpw-left-collapsed) a[data-page] .nav-label-fixed,
.sidebar:not(.lpw-collapsed-final):not(.lpw-sidebar-collapsed-final):not(.lpw-left-collapsed) .nav-link .lpw-menu-label-final,
.sidebar:not(.lpw-collapsed-final):not(.lpw-sidebar-collapsed-final):not(.lpw-left-collapsed) a[data-page] .lpw-menu-label-final,
.sidebar.lpw-expanded-final .nav-link span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar.lpw-expanded-final a[data-page] span:not(.badge):not(.nav-badge):not(.menu-badge):not(.count),
.sidebar.lpw-expanded-final .nav-link .nav-label-fixed,
.sidebar.lpw-expanded-final a[data-page] .nav-label-fixed,
.sidebar.lpw-expanded-final .nav-link .lpw-menu-label-final,
.sidebar.lpw-expanded-final a[data-page] .lpw-menu-label-final{
  position:absolute!important;
  left:46px!important;
  right:32px!important;
  top:50%!important;
  transform:translateY(-50%)!important;
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  margin:0!important;
  padding:0!important;
  width:auto!important;
  max-width:none!important;
  height:auto!important;
  line-height:1.15!important;
  text-align:left!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  word-break:keep-all!important;
  overflow-wrap:normal!important;
  justify-content:flex-start!important;
}

/* Badge fijo a la derecha */
.sidebar:not(.lpw-collapsed-final):not(.lpw-sidebar-collapsed-final):not(.lpw-left-collapsed) .nav-link .badge,
.sidebar:not(.lpw-collapsed-final):not(.lpw-sidebar-collapsed-final):not(.lpw-left-collapsed) .nav-link .nav-badge,
.sidebar:not(.lpw-collapsed-final):not(.lpw-sidebar-collapsed-final):not(.lpw-left-collapsed) .nav-link .menu-badge,
.sidebar:not(.lpw-collapsed-final):not(.lpw-sidebar-collapsed-final):not(.lpw-left-collapsed) .nav-link [class*="badge"],
.sidebar:not(.lpw-collapsed-final):not(.lpw-sidebar-collapsed-final):not(.lpw-left-collapsed) .nav-link [class*="count"],
.sidebar.lpw-expanded-final .nav-link .badge,
.sidebar.lpw-expanded-final .nav-link .nav-badge,
.sidebar.lpw-expanded-final .nav-link .menu-badge,
.sidebar.lpw-expanded-final .nav-link [class*="badge"],
.sidebar.lpw-expanded-final .nav-link [class*="count"]{
  position:absolute!important;
  right:12px!important;
  top:50%!important;
  transform:translateY(-50%)!important;
  margin:0!important;
  z-index:2!important;
}

/* Categorías: una sola línea y alineadas a la izquierda */
.sidebar .section-title,
.sidebar .nav-section-title,
.sidebar .sidebar-section,
.sidebar .menu-section-title,
.sidebar .sidebar-heading{
  display:block!important;
  text-align:left!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

/* Estado replegado: se mantiene lo ya definido, solo icono */
.sidebar.lpw-collapsed-final .nav-link,
.sidebar.lpw-collapsed-final a[data-page],
.sidebar.lpw-sidebar-collapsed-final .nav-link,
.sidebar.lpw-sidebar-collapsed-final a[data-page],
.sidebar.lpw-left-collapsed .nav-link,
.sidebar.lpw-left-collapsed a[data-page]{
  display:flex!important;
  justify-content:flex-start!important;
  align-items:center!important;
  padding-left:18px!important;
}

/* =========================================================
   PROPUESTAS ECONÓMICAS - FORMULARIO INLINE ODOO AJUSTADO
   ========================================================= */
#salesQuoteInlinePlatform{
  display:none;
}
#salesQuoteInlinePlatform.active{
  display:block;
}

.sales-inline-layout{
  display:grid;
  grid-template-columns:minmax(640px,1fr) 360px;
  gap:14px;
  align-items:start;
}

.sales-inline-main{
  min-width:0;
}

.sales-inline-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:18px;
  box-shadow:0 10px 24px rgba(15,23,42,.05);
}

.sales-inline-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:14px;
}

.sales-inline-topbar{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 0 12px;
  border-bottom:1px solid #dbe2ea;
  margin-bottom:10px;
}

.inline-status{
  margin-left:auto!important;
  margin-top:0!important;
}

.compact-quote-grid{
  grid-template-columns:1fr 1fr!important;
  gap:14px 28px!important;
}

.only-lines-tab button:not(.active){
  display:none!important;
}

.sales-value-added-text{
  width:100%;
  min-height:260px;
  border:0;
  border-top:1px solid #e5e7eb;
  margin-top:28px;
  padding-top:16px;
  resize:vertical;
  font-family:inherit;
  font-size:12px;
  color:#334155;
  line-height:1.45;
  background:#fff;
}

.sales-value-added-view{
  white-space:pre-wrap;
  font-family:inherit;
  font-size:12px;
  color:#334155;
  line-height:1.45;
  border-top:1px solid #e5e7eb;
  padding-top:16px;
  margin-top:28px;
}

.sales-activity-panel{
  background:#fff;
  border-left:1px solid #dbe2ea;
  min-height:720px;
  box-shadow:0 10px 24px rgba(15,23,42,.04);
  position:sticky;
  top:76px;
}

.activity-feed{
  padding:18px;
}

.activity-today{
  text-align:center;
  font-weight:900;
  color:#0f172a;
  margin-bottom:14px;
}

.activity-item{
  display:grid;
  grid-template-columns:34px 1fr;
  gap:10px;
  margin-bottom:14px;
  color:#0f172a;
}

.activity-avatar-mini{
  width:32px;
  height:32px;
  border-radius:999px;
  background:#e0f2fe;
  color:#0369a1;
  display:grid;
  place-items:center;
  font-weight:900;
}

.activity-item b,
.activity-item small{
  display:block;
}

.activity-item small{
  color:#64748b;
  font-size:11px;
}

.activity-item p{
  margin:5px 0;
  color:#334155;
}

.sales-lines-table input[readonly]{
  background:#f8fafc!important;
  color:#334155!important;
}

.sales-quote-totals .total-row{
  font-size:16px;
  font-weight:900;
}

@media(max-width:1200px){
  .sales-inline-layout{
    grid-template-columns:1fr;
  }
  .sales-activity-panel{
    position:relative;
    top:auto;
    min-height:auto;
    border-left:0;
    border-top:1px solid #dbe2ea;
  }
}

@media(max-width:800px){
  .compact-quote-grid{
    grid-template-columns:1fr!important;
  }
  .sales-inline-topbar{
    flex-wrap:wrap;
  }
  .inline-status{
    width:100%;
    justify-content:flex-start!important;
  }
}

/* =========================================================
   PROPUESTAS ECONÓMICAS - HEADER ESPACIADO FINAL
   ========================================================= */
#page-ventas_cotizaciones .pe-header-fixed,
#page-ventas_cotizaciones .page-title-row.pe-header-fixed{
  display:flex!important;
  align-items:flex-end!important;
  justify-content:space-between!important;
  gap:24px!important;
  margin:0 0 24px 0!important;
  width:100%!important;
}

#page-ventas_cotizaciones .pe-title-wrap{
  display:block!important;
  min-width:0!important;
}

#page-ventas_cotizaciones .pe-title-wrap h1{
  margin:0 0 10px 0!important;
  line-height:1.12!important;
}

#page-ventas_cotizaciones .pe-title-wrap p{
  margin:0!important;
  line-height:1.4!important;
  color:#64748b!important;
}

#page-ventas_cotizaciones .pe-new-btn{
  margin-left:auto!important;
  align-self:flex-start!important;
  white-space:nowrap!important;
  flex:0 0 auto!important;
}

#page-ventas_cotizaciones .sales-quotes-list-card{
  margin-top:8px!important;
}

#salesQuoteInlinePlatform.active{
  display:block!important;
  margin-top:10px!important;
}

/* =========================================================
   PROPUESTAS ECONÓMICAS - CLIENTE, ACTIVIDADES Y EMAIL
   ========================================================= */
.client-preview-odoo{
  margin-top:8px;
  font-size:12px;
  color:#475569;
  line-height:1.35;
  background:#f8fafc;
  border-left:3px solid #2563eb;
  padding:8px 10px;
  border-radius:8px;
}
.pe-activity-text{
  width:100%;
  min-height:110px;
  border:1px solid #dbe2ea;
  border-radius:12px;
  padding:10px;
  resize:vertical;
}
.pe-activity-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:10px;
}
.email-preview-box{
  padding:14px;
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:12px;
  color:#334155;
}
.sales-quote-status span:last-child:empty{
  display:none!important;
}


/* FIX v229 - Prospecto Comercial: vista Kanban con imágenes, lista intacta */
.prospect-view-toolbar{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  margin:0 0 10px 0;
}
.prospect-view-toolbar .prospect-view-label{
  font-size:12px;
  color:#64748b;
  font-weight:800;
  margin-right:4px;
}
.prospect-view-toolbar button{
  width:34px;
  height:32px;
  border:1px solid #dbe2ea;
  background:#fff;
  color:#334155;
  border-radius:8px;
  cursor:pointer;
  display:grid;
  place-items:center;
}
.prospect-view-toolbar button.active{
  background:#0f172a;
  color:#fff;
  border-color:#0f172a;
}
.prospect-kanban-panel{
  display:grid;
  grid-template-columns:repeat(4,minmax(260px,1fr));
  gap:10px;
  align-items:stretch;
}
.prospect-kanban-card{
  position:relative;
  display:grid;
  grid-template-columns:82px minmax(0,1fr);
  grid-template-rows:1fr auto;
  min-height:150px;
  border:1px solid #dbe2ea;
  background:#fff;
  cursor:pointer;
  transition:.15s ease;
  overflow:hidden;
}
.prospect-kanban-card:hover{
  border-color:#93c5fd;
  box-shadow:0 6px 20px rgba(15,23,42,.08);
  transform:translateY(-1px);
}
.prospect-kanban-photo{
  grid-row:1 / span 2;
  width:82px;
  min-height:150px;
  background:#f1f5f9;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  border-right:1px solid #e5e7eb;
}
.prospect-kanban-photo img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.prospect-kanban-photo.no-image{
  background:#f8fafc;
}
.prospect-kanban-placeholder{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#c7cbd1;
  font-size:54px;
}
.prospect-kanban-body{
  padding:10px 10px 4px 10px;
  min-width:0;
}
.prospect-kanban-name{
  font-size:13px;
  line-height:1.25;
  font-weight:900;
  color:#0f2544;
  text-transform:uppercase;
  margin-bottom:4px;
}
.prospect-kanban-contact{
  font-size:12px;
  color:#0f172a;
  font-weight:800;
  margin-bottom:3px;
}
.prospect-kanban-line{
  font-size:11px;
  color:#334155;
  line-height:1.32;
  margin:2px 0;
}
.prospect-kanban-email{
  word-break:break-word;
}
.prospect-kanban-tags{
  display:flex;
  gap:5px;
  flex-wrap:wrap;
  margin-top:5px;
}
.prospect-kanban-tags span{
  font-size:10px;
  color:#7c2d12;
  background:#fef3c7;
  border-radius:999px;
  padding:2px 6px;
  font-weight:700;
}
.prospect-kanban-footer{
  grid-column:2;
  display:grid;
  grid-template-columns:auto auto 1fr;
  align-items:center;
  gap:10px;
  padding:4px 10px 8px;
  color:#4338ca;
  font-size:11px;
}
.prospect-kanban-footer .prospect-phone{
  justify-self:end;
  color:#16a34a;
  font-size:14px;
}
@media(max-width:1400px){
  .prospect-kanban-panel{grid-template-columns:repeat(3,minmax(250px,1fr));}
}
@media(max-width:1100px){
  .prospect-kanban-panel{grid-template-columns:repeat(2,minmax(240px,1fr));}
}
@media(max-width:720px){
  .prospect-kanban-panel{grid-template-columns:1fr;}
}



/* FIX v235 - Kanban final independiente */
.prospect-v235-toolbar{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:8px!important;
  margin:10px 0 12px!important;
}
.prospect-v235-toolbar span{
  color:#64748b!important;
  font-size:12px!important;
  font-weight:900!important;
}
.prospect-v235-toolbar button{
  height:34px!important;
  border:1px solid #dbe2ea!important;
  background:#fff!important;
  color:#334155!important;
  border-radius:8px!important;
  padding:0 12px!important;
  cursor:pointer!important;
  display:inline-flex!important;
  align-items:center!important;
  gap:6px!important;
  font-weight:800!important;
}
.prospect-v235-toolbar button.active{
  background:#0f172a!important;
  color:#fff!important;
  border-color:#0f172a!important;
}
.prospect-v235-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(260px,1fr));
  gap:10px;
  align-items:stretch;
  width:100%;
  margin-top:10px;
}
.prospect-v235-card{
  position:relative;
  display:grid;
  grid-template-columns:82px minmax(0,1fr);
  grid-template-rows:1fr auto;
  min-height:150px;
  border:1px solid #dbe2ea;
  background:#fff;
  cursor:pointer;
  overflow:hidden;
  transition:.15s ease;
}
.prospect-v235-card:hover{
  border-color:#93c5fd;
  box-shadow:0 6px 20px rgba(15,23,42,.08);
  transform:translateY(-1px);
}
.prospect-v235-photo{
  grid-row:1 / span 2;
  width:82px;
  min-height:150px;
  background:#f1f5f9;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  border-right:1px solid #e5e7eb;
}
.prospect-v235-photo img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  display:block!important;
}
.prospect-v235-placeholder{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#c7cbd1;
  font-size:54px;
}
.prospect-v235-body{
  padding:10px 10px 4px 10px;
  min-width:0;
}
.prospect-v235-name{
  font-size:13px;
  line-height:1.25;
  font-weight:900;
  color:#0f2544;
  text-transform:uppercase;
  margin-bottom:4px;
}
.prospect-v235-contact{
  font-size:12px;
  color:#0f172a;
  font-weight:800;
  margin-bottom:3px;
}
.prospect-v235-line{
  font-size:11px;
  color:#334155;
  line-height:1.32;
  margin:2px 0;
}
.prospect-v235-email{
  word-break:break-word;
}
.prospect-v235-tags{
  display:flex;
  gap:5px;
  flex-wrap:wrap;
  margin-top:5px;
}
.prospect-v235-tags span{
  font-size:10px;
  color:#7c2d12;
  background:#fef3c7;
  border-radius:999px;
  padding:2px 6px;
  font-weight:700;
}
.prospect-v235-footer{
  grid-column:2;
  display:grid;
  grid-template-columns:auto auto 1fr;
  align-items:center;
  gap:10px;
  padding:4px 10px 8px;
  color:#4338ca;
  font-size:11px;
}
.prospect-v235-footer .phone{
  justify-self:end;
  color:#16a34a;
  font-size:14px;
}
.prospect-v235-loading,
.prospect-v235-empty{
  grid-column:1/-1;
  padding:22px;
  color:#475569;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:10px;
}
@media(max-width:1400px){
  .prospect-v235-grid{grid-template-columns:repeat(3,minmax(250px,1fr));}
}
@media(max-width:1100px){
  .prospect-v235-grid{grid-template-columns:repeat(2,minmax(240px,1fr));}
}
@media(max-width:720px){
  .prospect-v235-grid{grid-template-columns:1fr;}
}


/* FIX v236 - Kanban limpio: imagen real del prospecto */
.prospect-v235-photo{
  background:#eef2f7!important;
}
.prospect-v235-photo img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  object-position:center!important;
}
.prospect-v235-photo.empty{
  background:#f1f5f9!important;
}
.prospect-v235-photo.empty .prospect-v235-placeholder{
  color:#c5cbd3!important;
}


/* FIX v237 - Kanban: nunca dejar foto en blanco si falla la imagen */
.prospect-v235-photo{
  background:#f1f5f9!important;
}
.prospect-v235-photo.empty{
  background:#f1f5f9!important;
}
.prospect-v235-placeholder{
  width:100%!important;
  height:100%!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  color:#c5cbd3!important;
  font-size:54px!important;
}


/* FIX v238 - ocultar imagen rota y mostrar placeholder limpio */
.prospect-v235-photo.empty img{
  display:none!important;
}
.prospect-v235-photo img[alt="Foto"]{
  font-size:0!important;
}
.prospect-v235-photo.empty .prospect-v235-placeholder{
  display:flex!important;
}


/* FIX v239 - Kanban: imagen por proxy backend */
.prospect-v235-photo img{
  text-indent:-9999px!important;
  color:transparent!important;
}


/* FIX v241 - Kanban: imagen igual a ficha del prospecto */
.prospect-v235-photo img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  object-position:center!important;
  display:block!important;
}
.prospect-v235-photo img[alt=""]{
  color:transparent!important;
  font-size:0!important;
}






/* FIX v245 - Propuestas: buscador definitivo igual a Prospecto Comercial */
#page-ventas_cotizaciones .sales-quotes-list-card{
  border:1px solid #dbe4f0!important;
  border-radius:14px!important;
  background:#fff!important;
  overflow:hidden!important;
  margin-top:16px!important;
}

#page-ventas_cotizaciones .pe-search-header-v245{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:20px!important;
  padding:16px 18px!important;
  border-bottom:1px solid #edf2f7!important;
  background:#fff!important;
}

#page-ventas_cotizaciones .pe-search-title-v245{
  display:flex!important;
  flex-direction:column!important;
  gap:3px!important;
}

#page-ventas_cotizaciones .pe-search-title-v245 b{
  color:#0f172a!important;
  font-size:15px!important;
  font-weight:900!important;
}

#page-ventas_cotizaciones .pe-search-title-v245 small{
  color:#8aa0bd!important;
  font-size:12px!important;
}

#page-ventas_cotizaciones .pe-search-box-v245{
  position:relative!important;
  width:520px!important;
  max-width:min(520px, 45vw)!important;
}

#page-ventas_cotizaciones .pe-search-box-v245::before{
  content:"\f002";
  font-family:"Font Awesome 6 Free";
  font-weight:900;
  position:absolute;
  left:14px;
  top:50%;
  transform:translateY(-50%);
  color:#94a3b8;
  font-size:13px;
  pointer-events:none;
  z-index:1;
}

#page-ventas_cotizaciones #peSearchInputV245{
  width:100%!important;
  height:38px!important;
  min-width:0!important;
  border:1px solid #cbd7ea!important;
  border-radius:10px!important;
  background:#fff!important;
  color:#0f172a!important;
  padding:0 14px 0 38px!important;
  font-size:14px!important;
  outline:none!important;
  box-shadow:none!important;
}

#page-ventas_cotizaciones #peSearchInputV245:focus{
  border-color:#93c5fd!important;
  box-shadow:0 0 0 3px rgba(59,130,246,.12)!important;
}

#page-ventas_cotizaciones .pe-search-old-hidden-v245{
  display:none!important;
}

/* Ocultar buscador suelto si por caché queda fuera de la tarjeta */
#page-ventas_cotizaciones > input[placeholder*="producto"],
#page-ventas_cotizaciones > input[placeholder*="vendedor"],
#page-ventas_cotizaciones > input[placeholder*="número"],
#page-ventas_cotizaciones > input[placeholder*="numero"],
#page-ventas_cotizaciones > input[placeholder*="correo"]{
  display:none!important;
}

@media(max-width:900px){
  #page-ventas_cotizaciones .pe-search-header-v245{
    flex-direction:column!important;
    align-items:stretch!important;
  }
  #page-ventas_cotizaciones .pe-search-box-v245{
    width:100%!important;
    max-width:100%!important;
  }
}


/* FIX v249 - Nuevo Registro con todas las opciones */
.global-new-panel-wide{
  width:min(1120px, 94vw)!important;
  max-height:88vh!important;
  overflow:auto!important;
}
.global-new-grid-all{
  grid-template-columns:repeat(4,minmax(210px,1fr))!important;
  gap:14px!important;
}
.global-new-card.emerald .global-new-ico{background:#10b981!important}
.global-new-card.indigo .global-new-ico{background:#4f46e5!important}
.global-new-card.orange .global-new-ico{background:#f97316!important}
.global-new-card.rose .global-new-ico{background:#e11d48!important}
.global-new-card.slate .global-new-ico{background:#475569!important}
.global-new-card.amber .global-new-ico{background:#f59e0b!important}
.global-new-card.teal .global-new-ico{background:#14b8a6!important}
.global-new-card.purple .global-new-ico{background:#9333ea!important}
.global-new-card.dark .global-new-ico{background:#111827!important}
.global-new-card.map .global-new-ico{background:#2563eb!important}
@media(max-width:1050px){
  .global-new-grid-all{grid-template-columns:repeat(3,minmax(210px,1fr))!important}
}
@media(max-width:760px){
  .global-new-grid-all{grid-template-columns:1fr!important}
}


/* FIX v250 - Nuevo Registro como ventana emergente real */
#globalNewRegisterModal.global-new-modal,
#globalNewRegisterModal.global-new-force-modal-v250{
  position:fixed!important;
  inset:0!important;
  z-index:99999!important;
  display:none!important;
  align-items:center!important;
  justify-content:center!important;
  padding:22px!important;
  background:rgba(15,23,42,.58)!important;
  backdrop-filter:blur(3px)!important;
  overflow:auto!important;
}

#globalNewRegisterModal.global-new-modal.open,
#globalNewRegisterModal.global-new-force-modal-v250.open{
  display:flex!important;
}

#globalNewRegisterModal .global-new-panel,
#globalNewRegisterModal .global-new-panel-wide{
  position:relative!important;
  width:min(1120px, 94vw)!important;
  max-width:1120px!important;
  max-height:88vh!important;
  margin:auto!important;
  background:#fff!important;
  border-radius:16px!important;
  box-shadow:0 24px 80px rgba(15,23,42,.32)!important;
  overflow:auto!important;
  transform:none!important;
}

body.global-new-modal-open-v250{
  overflow:hidden!important;
}

#globalNewRegisterModal .global-new-head{
  position:sticky!important;
  top:0!important;
  z-index:2!important;
  background:#fff!important;
}

#globalNewRegisterModal .global-new-grid-all{
  grid-template-columns:repeat(4,minmax(210px,1fr))!important;
}

@media(max-width:1050px){
  #globalNewRegisterModal .global-new-grid-all{
    grid-template-columns:repeat(3,minmax(210px,1fr))!important;
  }
}

@media(max-width:760px){
  #globalNewRegisterModal .global-new-grid-all{
    grid-template-columns:1fr!important;
  }
}


/* FIX v251 - Ocultar residuo del modal Nuevo Registro */
#globalNewRegisterModal:not(.open),
.global-new-modal:not(.open){
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}

#globalNewRegisterModal:not(.open) .global-new-panel,
#globalNewRegisterModal:not(.open) .global-new-panel-wide,
#globalNewRegisterModal:not(.open) .global-new-head{
  display:none!important;
}

/* Evita que una cabecera suelta del modal se vea incrustada en el dashboard */
body:not(.global-new-modal-open-v250) #globalNewRegisterModal .global-new-head{
  display:none!important;
}


/* FIX v252 - No permitir cabecera huérfana de Nuevo Registro */
#globalNewRegisterModal:not(.open){
  display:none!important;
}
#globalNewRegisterModal.open:not(:has(.global-new-grid-all)){
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}

/* Si el modal está abierto correctamente, debe ser overlay centrado */
#globalNewRegisterModal.open{
  position:fixed!important;
  inset:0!important;
  z-index:99999!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:22px!important;
  background:rgba(15,23,42,.58)!important;
  backdrop-filter:blur(3px)!important;
}
#globalNewRegisterModal.open .global-new-panel-wide,
#globalNewRegisterModal.open .global-new-panel{
  margin:auto!important;
}


/* FIX v273 - Propuestas: edición estable de líneas */
#page-ventas_cotizaciones table.sales-lines-table input,
#page-ventas_cotizaciones table.sales-lines-table select,
#page-ventas_cotizaciones table.sales-lines-table textarea,
#page-ventas_cotizaciones #salesQuoteLines input,
#page-ventas_cotizaciones #salesQuoteLines select{
  min-height:30px!important;
}

#page-ventas_cotizaciones table.sales-lines-table input:focus,
#page-ventas_cotizaciones table.sales-lines-table select:focus,
#page-ventas_cotizaciones table.sales-lines-table textarea:focus{
  outline:2px solid #111827!important;
  outline-offset:1px!important;
}


/* FIX v274 - Dashboard Ejecutivo */
.exec-dashboard-v274{
  margin-top:22px!important;
  display:block!important;
}

.exec-head-v274{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:14px!important;
  margin:8px 0 14px!important;
}

.exec-head-v274 h2{
  margin:0!important;
  color:#0f172a!important;
  font-size:22px!important;
  font-weight:900!important;
}

.exec-head-v274 p{
  margin:4px 0 0!important;
  color:#64748b!important;
  font-size:13px!important;
}

.exec-period-v274{
  display:flex!important;
  gap:6px!important;
  background:#eef3fb!important;
  border:1px solid #dbe4f0!important;
  border-radius:12px!important;
  padding:4px!important;
}

.exec-period-v274 button{
  border:none!important;
  background:transparent!important;
  color:#475569!important;
  padding:8px 12px!important;
  border-radius:9px!important;
  font-weight:800!important;
  cursor:pointer!important;
}

.exec-period-v274 button.active{
  background:#fff!important;
  color:#1d4ed8!important;
  box-shadow:0 4px 12px rgba(15,23,42,.08)!important;
}

.exec-kpis-v274{
  display:grid!important;
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  gap:12px!important;
  margin-bottom:14px!important;
}

.exec-kpi-v274{
  display:flex!important;
  gap:10px!important;
  align-items:flex-end!important;
  background:#fff!important;
  border:1px solid #e5edf6!important;
  border-radius:16px!important;
  padding:14px!important;
  box-shadow:0 10px 24px rgba(15,23,42,.05)!important;
  min-height:104px!important;
  border-top:4px solid #2563eb!important;
}

.exec-kpi-v274.green{border-top-color:#10b981!important}
.exec-kpi-v274.red{border-top-color:#ef4444!important}
.exec-kpi-v274.purple{border-top-color:#8b5cf6!important}
.exec-kpi-v274.cyan{border-top-color:#06b6d4!important}
.exec-kpi-v274.amber{border-top-color:#f59e0b!important}

.exec-kpi-icon-v274{
  width:36px!important;
  height:36px!important;
  border-radius:12px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:#eff6ff!important;
  color:#2563eb!important;
  flex:0 0 36px!important;
}

.exec-kpi-v274.green .exec-kpi-icon-v274{background:#ecfdf5!important;color:#10b981!important}
.exec-kpi-v274.red .exec-kpi-icon-v274{background:#fef2f2!important;color:#ef4444!important}
.exec-kpi-v274.purple .exec-kpi-icon-v274{background:#f5f3ff!important;color:#8b5cf6!important}
.exec-kpi-v274.cyan .exec-kpi-icon-v274{background:#ecfeff!important;color:#06b6d4!important}
.exec-kpi-v274.amber .exec-kpi-icon-v274{background:#fffbeb!important;color:#f59e0b!important}

.exec-kpi-v274 span{
  display:block!important;
  font-size:12px!important;
  color:#64748b!important;
  font-weight:800!important;
}

.exec-kpi-v274 strong{
  display:block!important;
  margin-top:5px!important;
  font-size:21px!important;
  color:#0f172a!important;
  line-height:1.05!important;
}

.exec-kpi-v274 small{
  display:block!important;
  margin-top:6px!important;
  color:#94a3b8!important;
  font-size:11.5px!important;
}

.exec-grid-v274{
  display:grid!important;
  grid-template-columns:1.2fr 1fr 1fr!important;
  gap:14px!important;
  margin-bottom:20px!important;
}

.exec-panel-v274{
  background:#fff!important;
  border:1px solid #e5edf6!important;
  border-radius:16px!important;
  padding:14px!important;
  box-shadow:0 10px 24px rgba(15,23,42,.05)!important;
  min-height:210px!important;
}

.exec-panel-v274.wide{
  grid-column:span 2!important;
}

.exec-panel-head-v274{
  display:flex!important;
  justify-content:space-between!important;
  gap:10px!important;
  align-items:flex-end!important;
  margin-bottom:12px!important;
}

.exec-panel-head-v274 h3{
  margin:0!important;
  color:#0f172a!important;
  font-size:15px!important;
  font-weight:900!important;
}

.exec-panel-head-v274 span{
  color:#94a3b8!important;
  font-size:11.5px!important;
  font-weight:800!important;
}

.exec-funnel-v274{
  display:grid!important;
  gap:12px!important;
}

.exec-funnel-step-v274 div{
  display:flex!important;
  justify-content:space-between!important;
  color:#334155!important;
  font-size:13px!important;
  margin-bottom:6px!important;
}

.exec-funnel-step-v274 b{
  color:#0f172a!important;
}

.exec-funnel-step-v274 span{
  font-weight:900!important;
  color:#2563eb!important;
}

.exec-funnel-step-v274 > i{
  display:block!important;
  height:12px!important;
  border-radius:999px!important;
  background:linear-gradient(90deg,#2563eb,#22c55e)!important;
}

.exec-score-v274{
  display:grid!important;
  grid-template-columns:repeat(3,1fr)!important;
  gap:10px!important;
  padding-top:8px!important;
}

.exec-score-v274 div{
  background:#f8fafc!important;
  border:1px solid #e2e8f0!important;
  border-radius:14px!important;
  padding:14px 10px!important;
  text-align:center!important;
}

.exec-score-v274 b{
  display:block!important;
  font-size:25px!important;
  color:#0f172a!important;
}

.exec-score-v274 span{
  display:block!important;
  margin-top:4px!important;
  color:#64748b!important;
  font-size:12px!important;
}

.exec-risk-list-v274{
  display:grid!important;
  gap:8px!important;
  max-height:330px!important;
  overflow:auto!important;
  padding-right:3px!important;
}

.exec-risk-v274{
  border-left:4px solid #2563eb!important;
  background:#f8fafc!important;
  border-radius:12px!important;
  padding:10px!important;
  display:grid!important;
  gap:3px!important;
}

.exec-risk-v274.danger{border-left-color:#ef4444!important;background:#fff5f5!important}
.exec-risk-v274.warning{border-left-color:#f59e0b!important;background:#fffbeb!important}
.exec-risk-v274.info{border-left-color:#06b6d4!important;background:#ecfeff!important}

.exec-risk-v274 span{
  font-size:11px!important;
  font-weight:900!important;
  color:#64748b!important;
  text-transform:uppercase!important;
}

.exec-risk-v274 b{
  color:#0f172a!important;
  font-size:13px!important;
}

.exec-risk-v274 small{
  color:#334155!important;
  font-size:12px!important;
}

.exec-risk-v274 em{
  color:#94a3b8!important;
  font-size:11px!important;
  font-style:normal!important;
}

.exec-bar-row-v274{
  margin-bottom:11px!important;
}

.exec-bar-meta-v274{
  display:flex!important;
  justify-content:space-between!important;
  gap:10px!important;
  font-size:12px!important;
  margin-bottom:5px!important;
}

.exec-bar-meta-v274 b{
  color:#0f172a!important;
  max-width:70%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}

.exec-bar-meta-v274 span{
  color:#2563eb!important;
  font-weight:900!important;
}

.exec-bar-track-v274{
  height:9px!important;
  background:#edf2f7!important;
  border-radius:999px!important;
  overflow:hidden!important;
}

.exec-bar-track-v274 i{
  display:block!important;
  height:100%!important;
  background:linear-gradient(90deg,#2563eb,#06b6d4)!important;
  border-radius:999px!important;
}

.exec-insights-v274{
  margin:0!important;
  padding-left:18px!important;
  display:grid!important;
  gap:10px!important;
  color:#334155!important;
  line-height:1.45!important;
}

.exec-insights-v274 li{
  background:#f8fafc!important;
  border:1px solid #e2e8f0!important;
  border-radius:12px!important;
  padding:10px 12px!important;
}

.exec-empty-v274{
  color:#64748b!important;
  background:#f8fafc!important;
  border:1px dashed #cbd5e1!important;
  border-radius:12px!important;
  padding:18px!important;
  text-align:center!important;
}

.exec-empty-v274.good{
  color:#15803d!important;
  background:#f0fdf4!important;
  border-color:#bbf7d0!important;
}

@media(max-width:1280px){
  .exec-kpis-v274{grid-template-columns:repeat(3,1fr)!important}
  .exec-grid-v274{grid-template-columns:1fr 1fr!important}
}

@media(max-width:860px){
  .exec-head-v274{flex-direction:column!important;align-items:flex-start!important}
  .exec-kpis-v274{grid-template-columns:1fr!important}
  .exec-grid-v274{grid-template-columns:1fr!important}
  .exec-panel-v274.wide{grid-column:auto!important}
}


/* FIX v275 - Dashboard interactivo con widgets */
.dash-interactive-v275{
  margin:18px 0 22px!important;
}

.dash-top-v275{
  display:flex!important;
  align-items:flex-end!important;
  justify-content:space-between!important;
  gap:14px!important;
  margin-bottom:12px!important;
}

.dash-top-v275 h2{
  margin:0!important;
  font-size:23px!important;
  font-weight:900!important;
  color:#0f172a!important;
}

.dash-top-v275 p{
  margin:4px 0 0!important;
  color:#64748b!important;
  font-size:13px!important;
}

.dash-actions-v275{
  display:flex!important;
  gap:8px!important;
  flex-wrap:wrap!important;
  justify-content:flex-end!important;
}

.dash-actions-v275 button{
  border:none!important;
  background:#2563eb!important;
  color:#fff!important;
  border-radius:10px!important;
  padding:9px 12px!important;
  font-weight:800!important;
  cursor:pointer!important;
  box-shadow:0 8px 18px rgba(37,99,235,.18)!important;
}

.dash-actions-v275 button:nth-child(2){
  background:#10b981!important;
}

.dash-actions-v275 button:nth-child(3){
  background:#0f172a!important;
}

.dash-filters-v275{
  display:grid!important;
  grid-template-columns:140px 170px 170px 210px 1fr!important;
  gap:10px!important;
  margin:0 0 14px!important;
  background:#fff!important;
  border:1px solid #e5edf6!important;
  border-radius:16px!important;
  padding:12px!important;
  box-shadow:0 8px 20px rgba(15,23,42,.04)!important;
}

.dash-filters-v275 select,
.dash-filters-v275 input{
  height:38px!important;
  border:1px solid #d8e2f0!important;
  border-radius:10px!important;
  padding:0 10px!important;
  outline:none!important;
  background:#fff!important;
  color:#0f172a!important;
}

.dash-filters-v275 input:focus,
.dash-filters-v275 select:focus{
  border-color:#2563eb!important;
  box-shadow:0 0 0 3px rgba(37,99,235,.12)!important;
}

.dash-widgets-v275{
  display:grid!important;
  grid-template-columns:repeat(6,minmax(0,1fr))!important;
  gap:12px!important;
  margin-bottom:14px!important;
}

.dash-widget-v275{
  position:relative!important;
  display:flex!important;
  gap:10px!important;
  align-items:flex-end!important;
  background:#fff!important;
  border:1px solid #e5edf6!important;
  border-top:4px solid #2563eb!important;
  border-radius:16px!important;
  padding:14px!important;
  min-height:108px!important;
  box-shadow:0 10px 24px rgba(15,23,42,.05)!important;
  cursor:grab!important;
  transition:transform .15s ease, box-shadow .15s ease!important;
}

.dash-widget-v275:hover{
  transform:translateY(-2px)!important;
  box-shadow:0 14px 28px rgba(15,23,42,.08)!important;
}

.dash-widget-v275.dragging{
  opacity:.55!important;
  transform:scale(.98)!important;
}

.dash-widget-v275.green{border-top-color:#10b981!important}
.dash-widget-v275.red{border-top-color:#ef4444!important}
.dash-widget-v275.purple{border-top-color:#8b5cf6!important}
.dash-widget-v275.cyan{border-top-color:#06b6d4!important}
.dash-widget-v275.amber{border-top-color:#f59e0b!important}

.dash-widget-icon-v275{
  width:36px!important;
  height:36px!important;
  border-radius:12px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:#eff6ff!important;
  color:#2563eb!important;
  flex:0 0 36px!important;
}

.dash-widget-v275.green .dash-widget-icon-v275{background:#ecfdf5!important;color:#10b981!important}
.dash-widget-v275.red .dash-widget-icon-v275{background:#fef2f2!important;color:#ef4444!important}
.dash-widget-v275.purple .dash-widget-icon-v275{background:#f5f3ff!important;color:#8b5cf6!important}
.dash-widget-v275.cyan .dash-widget-icon-v275{background:#ecfeff!important;color:#06b6d4!important}
.dash-widget-v275.amber .dash-widget-icon-v275{background:#fffbeb!important;color:#f59e0b!important}

.dash-widget-v275 span{
  display:block!important;
  color:#64748b!important;
  font-size:12px!important;
  font-weight:900!important;
}

.dash-widget-v275 strong{
  display:block!important;
  margin-top:5px!important;
  color:#0f172a!important;
  font-size:21px!important;
  line-height:1.05!important;
}

.dash-widget-v275 small{
  display:block!important;
  margin-top:6px!important;
  color:#94a3b8!important;
  font-size:11.5px!important;
}

.dash-widget-remove-v275{
  position:absolute!important;
  top:7px!important;
  right:8px!important;
  width:20px!important;
  height:20px!important;
  border:none!important;
  border-radius:50%!important;
  background:#f1f5f9!important;
  color:#64748b!important;
  cursor:pointer!important;
  font-weight:900!important;
  line-height:20px!important;
  padding:0!important;
}

.dash-widget-remove-v275:hover{
  background:#fee2e2!important;
  color:#dc2626!important;
}

.dash-analytics-v275{
  display:grid!important;
  grid-template-columns:1fr 1fr 1.2fr!important;
  gap:14px!important;
}

.dash-panel-v275{
  background:#fff!important;
  border:1px solid #e5edf6!important;
  border-radius:16px!important;
  padding:14px!important;
  box-shadow:0 10px 24px rgba(15,23,42,.05)!important;
  min-height:210px!important;
}

.dash-panel-head-v275{
  display:flex!important;
  justify-content:space-between!important;
  gap:10px!important;
  align-items:flex-end!important;
  margin-bottom:12px!important;
}

.dash-panel-head-v275 h3{
  margin:0!important;
  color:#0f172a!important;
  font-size:15px!important;
  font-weight:900!important;
}

.dash-panel-head-v275 span{
  color:#94a3b8!important;
  font-size:11.5px!important;
  font-weight:800!important;
}

.dash-mini-bar-v275{
  margin-bottom:11px!important;
}

.dash-mini-bar-v275 > div{
  display:flex!important;
  justify-content:space-between!important;
  gap:10px!important;
  font-size:12px!important;
  margin-bottom:5px!important;
}

.dash-mini-bar-v275 b{
  color:#0f172a!important;
  max-width:70%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}

.dash-mini-bar-v275 span{
  color:#2563eb!important;
  font-weight:900!important;
}

.dash-mini-bar-v275 > i{
  display:block!important;
  height:9px!important;
  background:#edf2f7!important;
  border-radius:999px!important;
  overflow:hidden!important;
}

.dash-mini-bar-v275 em{
  display:block!important;
  height:100%!important;
  background:linear-gradient(90deg,#2563eb,#06b6d4)!important;
  border-radius:999px!important;
}

.dash-decisions-v275{
  margin:0!important;
  padding-left:18px!important;
  display:grid!important;
  gap:10px!important;
  color:#334155!important;
  line-height:1.45!important;
}

.dash-decisions-v275 li{
  background:#f8fafc!important;
  border:1px solid #e2e8f0!important;
  border-radius:12px!important;
  padding:10px 12px!important;
}

.dash-empty-v275{
  color:#64748b!important;
  background:#f8fafc!important;
  border:1px dashed #cbd5e1!important;
  border-radius:12px!important;
  padding:18px!important;
  text-align:center!important;
}

.dash-market-overlay-v275{
  position:fixed!important;
  inset:0!important;
  background:rgba(15,23,42,.36)!important;
  z-index:99999!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:20px!important;
}

.dash-market-v275{
  width:min(760px,96vw)!important;
  max-height:86vh!important;
  overflow:auto!important;
  background:#fff!important;
  border-radius:18px!important;
  padding:20px!important;
  box-shadow:0 24px 70px rgba(15,23,42,.25)!important;
  position:relative!important;
}

.dash-market-close-v275{
  position:absolute!important;
  top:12px!important;
  right:12px!important;
  width:32px!important;
  height:32px!important;
  border:none!important;
  border-radius:10px!important;
  background:#f1f5f9!important;
  color:#334155!important;
  font-size:20px!important;
  cursor:pointer!important;
}

.dash-market-v275 h2{
  margin:0!important;
  color:#0f172a!important;
  font-size:22px!important;
  font-weight:900!important;
}

.dash-market-v275 p{
  margin:4px 0 16px!important;
  color:#64748b!important;
}

.dash-market-grid-v275{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
}

.dash-market-item-v275{
  display:grid!important;
  grid-template-columns:34px 1fr auto!important;
  align-items:center!important;
  gap:10px!important;
  text-align:left!important;
  border:1px solid #e2e8f0!important;
  background:#fff!important;
  border-radius:14px!important;
  padding:12px!important;
  cursor:pointer!important;
}

.dash-market-item-v275:hover{
  background:#f8fafc!important;
  border-color:#2563eb!important;
}

.dash-market-item-v275.selected{
  background:#eff6ff!important;
  border-color:#93c5fd!important;
}

.dash-market-item-v275 i{
  color:#2563eb!important;
  font-size:18px!important;
}

.dash-market-item-v275 b{
  color:#0f172a!important;
}

.dash-market-item-v275 span{
  color:#64748b!important;
  font-size:12px!important;
  font-weight:800!important;
}

@media(max-width:1280px){
  .dash-widgets-v275{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .dash-filters-v275{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .dash-analytics-v275{grid-template-columns:1fr 1fr!important}
}

@media(max-width:860px){
  .dash-top-v275{flex-direction:column!important}
  .dash-actions-v275{justify-content:flex-start!important}
  .dash-widgets-v275{grid-template-columns:1fr!important}
  .dash-filters-v275{grid-template-columns:1fr!important}
  .dash-analytics-v275{grid-template-columns:1fr!important}
  .dash-market-grid-v275{grid-template-columns:1fr!important}
}














/* FIX v281 - Dashboard Gerencial Power BI limpio */
#page-dashboard .pbi281-hide{display:none!important}
#gerencialPBI281{margin:10px 0 24px!important;color:#0f172a!important}
.pbi281-shell{display:grid!important;grid-template-columns:260px minmax(0,1fr)!important;gap:16px!important;min-height:calc(100vh - 120px)!important}
.pbi281-sidebar{background:#0f172a!important;color:#fff!important;border-radius:20px!important;padding:18px!important;box-shadow:0 20px 44px rgba(15,23,42,.22)!important;position:sticky!important;top:12px!important;height:max-content!important}
.pbi281-brand{padding-bottom:14px!important;border-bottom:1px solid rgba(255,255,255,.12)!important;margin-bottom:16px!important}
.pbi281-brand b{display:block!important;font-size:19px!important;letter-spacing:.02em!important}
.pbi281-brand span{display:block!important;color:#93c5fd!important;font-size:12px!important;margin-top:3px!important}
.pbi281-filter-title{color:#dbeafe!important;font-size:12px!important;font-weight:900!important;text-transform:uppercase!important;margin-bottom:10px!important}
.pbi281-sidebar label{display:block!important;color:#bfdbfe!important;font-size:11px!important;font-weight:850!important;margin:12px 0 6px!important}
.pbi281-sidebar select,.pbi281-sidebar input{width:100%!important;height:38px!important;border:none!important;border-radius:11px!important;padding:0 10px!important;background:#1e293b!important;color:#fff!important;outline:none!important}
.pbi281-sidebar input::placeholder{color:#94a3b8!important}
.pbi281-sidebar select:focus,.pbi281-sidebar input:focus{box-shadow:0 0 0 3px rgba(59,130,246,.35)!important}
.pbi281-sidebar button{width:100%!important;margin-top:14px!important;height:38px!important;border:none!important;border-radius:11px!important;background:#2563eb!important;color:#fff!important;font-weight:900!important;cursor:pointer!important}
.pbi281-role{margin-top:16px!important;padding:12px!important;border-radius:14px!important;background:rgba(37,99,235,.18)!important;border:1px solid rgba(147,197,253,.25)!important}
.pbi281-role span{display:block!important;color:#bfdbfe!important;font-size:11px!important}
.pbi281-role b{display:block!important;color:#fff!important;margin-top:3px!important}
.pbi281-main{min-width:0!important}
.pbi281-header{display:flex!important;justify-content:space-between!important;gap:16px!important;align-items:flex-start!important;background:linear-gradient(135deg,#eff6ff,#ffffff)!important;border:1px solid #dbeafe!important;border-radius:20px!important;padding:18px 20px!important;margin-bottom:14px!important;box-shadow:0 12px 30px rgba(15,23,42,.06)!important}
.pbi281-header h2{margin:0!important;color:#0f172a!important;font-size:27px!important;font-weight:950!important;letter-spacing:-.02em!important}
.pbi281-header p{margin:6px 0 0!important;color:#475569!important;max-width:980px!important;line-height:1.4!important}
.pbi281-header button{border:none!important;background:#2563eb!important;color:#fff!important;border-radius:12px!important;padding:10px 14px!important;font-weight:900!important;cursor:pointer!important;box-shadow:0 10px 22px rgba(37,99,235,.18)!important}
.pbi281-kpis{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:12px!important;margin-bottom:14px!important}
.pbi281-kpi{background:#fff!important;border:1px solid #e5edf6!important;border-bottom:4px solid #2563eb!important;border-radius:18px!important;padding:13px!important;min-height:128px!important;box-shadow:0 10px 24px rgba(15,23,42,.05)!important}
.pbi281-kpi.red{border-bottom-color:#ef4444!important}.pbi281-kpi.green{border-bottom-color:#10b981!important}.pbi281-kpi.purple{border-bottom-color:#8b5cf6!important}.pbi281-kpi.cyan{border-bottom-color:#06b6d4!important}.pbi281-kpi.amber{border-bottom-color:#f59e0b!important}
.pbi281-kpi-head{display:flex!important;justify-content:space-between!important;align-items:center!important;gap:8px!important}
.pbi281-kpi-head span{color:#64748b!important;font-size:11px!important;font-weight:950!important;text-transform:uppercase!important}
.pbi281-kpi-head i{width:32px!important;height:32px!important;border-radius:11px!important;display:flex!important;align-items:center!important;justify-content:center!important;background:#eff6ff!important;color:#2563eb!important}
.pbi281-kpi strong{display:block!important;margin-top:11px!important;color:#0f172a!important;font-size:23px!important;font-weight:950!important;line-height:1.05!important}
.pbi281-kpi small{display:block!important;margin-top:7px!important;color:#64748b!important;font-size:12px!important}
.pbi281-kpi em{display:inline-block!important;margin-top:8px!important;font-style:normal!important;font-size:11px!important;font-weight:900!important;border-radius:999px!important;padding:4px 8px!important;background:#ecfdf5!important;color:#047857!important}
.pbi281-kpi em.down{background:#fef2f2!important;color:#dc2626!important}
.pbi281-grid{display:grid!important;grid-template-columns:1.1fr 1.1fr .9fr!important;gap:14px!important}
.pbi281-card{background:#fff!important;border:1px solid #e5edf6!important;border-radius:18px!important;padding:14px!important;min-height:250px!important;box-shadow:0 10px 24px rgba(15,23,42,.05)!important;overflow:hidden!important}
.pbi281-span2{grid-column:span 2!important}
.pbi281-card-head{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:10px!important;margin-bottom:12px!important}
.pbi281-card-head h3{margin:0!important;color:#0f172a!important;font-size:16px!important;font-weight:950!important}
.pbi281-card-head span{color:#94a3b8!important;font-size:11.5px!important;font-weight:850!important}
.pbi281-month-chart{height:230px!important;display:flex!important;align-items:end!important;gap:11px!important;padding:12px 6px 0!important;border-left:1px solid #e5edf6!important;border-bottom:1px solid #e5edf6!important}
.pbi281-month{flex:1!important;height:100%!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:flex-end!important;gap:7px!important}
.pbi281-bar-wrap{width:100%!important;height:100%!important;display:flex!important;align-items:end!important;justify-content:center!important;gap:4px!important}
.pbi281-bar-wrap i{width:13px!important;display:block!important;border-radius:8px 8px 0 0!important}
.pbi281-bar-wrap .rev{background:linear-gradient(180deg,#2563eb,#06b6d4)!important}.pbi281-bar-wrap .ord{background:linear-gradient(180deg,#22c55e,#10b981)!important}
.pbi281-month span{color:#64748b!important;font-size:11px!important}
.pbi281-legend{display:flex!important;gap:14px!important;justify-content:flex-end!important;margin-top:10px!important;color:#64748b!important;font-size:12px!important}
.pbi281-legend i{display:inline-block!important;width:10px!important;height:10px!important;border-radius:3px!important;margin-right:5px!important}.pbi281-legend .blue{background:#2563eb!important}.pbi281-legend .green{background:#22c55e!important}
.pbi281-alert-list{display:grid!important;gap:8px!important;max-height:340px!important;overflow:auto!important;padding-right:3px!important}
.pbi281-alert{border-left:4px solid #06b6d4!important;background:#ecfeff!important;border-radius:13px!important;padding:9px 10px!important;display:grid!important;gap:2px!important}
.pbi281-alert.danger{border-left-color:#ef4444!important;background:#fff5f5!important}.pbi281-alert.warning{border-left-color:#f59e0b!important;background:#fffbeb!important}
.pbi281-alert span{color:#64748b!important;font-size:10.5px!important;font-weight:950!important;text-transform:uppercase!important}
.pbi281-alert b{color:#0f172a!important;font-size:13px!important}.pbi281-alert small{color:#334155!important;font-size:12px!important}.pbi281-alert em{color:#94a3b8!important;font-style:normal!important;font-size:11px!important}
.pbi281-table-wrap{overflow:auto!important;max-height:350px!important}.pbi281-table{width:100%!important;border-collapse:separate!important;border-spacing:0!important;font-size:12px!important}
.pbi281-table th{position:sticky!important;top:0!important;background:#f8fafc!important;color:#475569!important;font-size:11px!important;text-transform:uppercase!important;padding:10px!important;text-align:left!important;border-bottom:1px solid #e5edf6!important}
.pbi281-table td{padding:10px!important;border-bottom:1px solid #edf2f7!important;color:#334155!important}.pbi281-table .ok{color:#16a34a!important;font-weight:900!important}.pbi281-table .warn{color:#d97706!important;font-weight:900!important}.pbi281-table .bad{color:#dc2626!important;font-weight:900!important}
.pbi281-track{display:block!important;width:96px!important;height:8px!important;background:#edf2f7!important;border-radius:999px!important;overflow:hidden!important}.pbi281-track em{display:block!important;height:100%!important;background:linear-gradient(90deg,#2563eb,#10b981)!important}
.pbi281-gauge{display:grid!important;grid-template-columns:repeat(2,1fr)!important;gap:10px!important}.pbi281-gauge div{background:#f8fafc!important;border:1px solid #e2e8f0!important;border-radius:15px!important;padding:14px 10px!important;text-align:center!important}.pbi281-gauge strong{display:block!important;color:#0f172a!important;font-size:23px!important;font-weight:950!important}.pbi281-gauge span{display:block!important;color:#64748b!important;font-size:11.5px!important;margin:5px 0 8px!important}.pbi281-gauge i{display:inline-block!important;width:13px!important;height:13px!important;border-radius:50%!important}.pbi281-gauge .ok{background:#22c55e!important}.pbi281-gauge .warn{background:#f59e0b!important}.pbi281-gauge .bad{background:#ef4444!important}
.pbi281-hbar{margin-bottom:11px!important}.pbi281-hbar div{display:flex!important;justify-content:space-between!important;gap:10px!important;margin-bottom:6px!important;font-size:12px!important}.pbi281-hbar b{color:#0f172a!important;max-width:65%!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}.pbi281-hbar span{color:#2563eb!important;font-weight:900!important}.pbi281-hbar>i{height:9px!important;display:block!important;background:#edf2f7!important;border-radius:999px!important;overflow:hidden!important}.pbi281-hbar em{display:block!important;height:100%!important;background:linear-gradient(90deg,#2563eb,#10b981)!important}
.pbi281-decisions{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(250px,1fr))!important;gap:10px!important}.pbi281-decisions div{border-left:5px solid #2563eb!important;background:#f8fafc!important;border-radius:14px!important;padding:12px!important}.pbi281-decisions .danger{border-left-color:#ef4444!important;background:#fff5f5!important}.pbi281-decisions .warning{border-left-color:#f59e0b!important;background:#fffbeb!important}.pbi281-decisions .ok{border-left-color:#22c55e!important;background:#f0fdf4!important}.pbi281-decisions b{display:block!important;color:#0f172a!important;margin-bottom:5px!important}.pbi281-decisions span{color:#334155!important;line-height:1.4!important}
.pbi281-empty{color:#64748b!important;background:#f8fafc!important;border:1px dashed #cbd5e1!important;border-radius:12px!important;padding:18px!important;text-align:center!important}.pbi281-empty.ok{color:#16a34a!important;background:#f0fdf4!important;border-color:#bbf7d0!important}
@media(max-width:1500px){.pbi281-shell{grid-template-columns:220px minmax(0,1fr)!important}.pbi281-kpis{grid-template-columns:repeat(3,minmax(0,1fr))!important}.pbi281-grid{grid-template-columns:1fr 1fr!important}}
@media(max-width:980px){.pbi281-shell{grid-template-columns:1fr!important}.pbi281-sidebar{position:relative!important;top:auto!important}.pbi281-header{flex-direction:column!important}.pbi281-kpis{grid-template-columns:1fr!important}.pbi281-grid{grid-template-columns:1fr!important}.pbi281-span2{grid-column:auto!important}}


/* FIX v282 - Dashboard horizontal filters */
#page-dashboard > .pbi282-force-hide,
#page-dashboard > :not(#gerencialPBI281){
  display:none !important;
}

#gerencialPBI281{
  display:block !important;
  width:100% !important;
}

.pbi281-shell{
  grid-template-columns:1fr !important;
  gap:14px !important;
}

.pbi281-sidebar{
  position:relative !important;
  top:auto !important;
  display:grid !important;
  grid-template-columns:1.2fr repeat(4,minmax(150px,1fr)) 1.1fr !important;
  gap:12px !important;
  align-items:end !important;
  background:linear-gradient(180deg,#0f172a,#14284b) !important;
  padding:16px !important;
}

.pbi281-brand{
  margin:0 !important;
  padding:0 10px 0 0 !important;
  border-bottom:none !important;
  border-right:1px solid rgba(255,255,255,.12) !important;
  align-self:stretch !important;
  display:flex !important;
  flex-direction:column !important;
  justify-content:center !important;
}

.pbi281-filter-title{
  display:none !important;
}

.pbi281-sidebar label{
  margin:0 0 6px !important;
}

.pbi281-sidebar > label,
.pbi281-sidebar > select,
.pbi281-sidebar > input,
.pbi281-sidebar > button,
.pbi281-role{
  margin-top:0 !important;
}

.pbi281-sidebar select,
.pbi281-sidebar input,
.pbi281-sidebar button{
  height:42px !important;
}

.pbi281-sidebar button{
  align-self:end !important;
}

.pbi281-role{
  min-height:42px !important;
  display:flex !important;
  flex-direction:column !important;
  justify-content:center !important;
  margin:0 !important;
}

@media(max-width:1500px){
  .pbi281-sidebar{
    grid-template-columns:repeat(3,minmax(180px,1fr)) !important;
  }
  .pbi281-brand{
    border-right:none !important;
    border-bottom:1px solid rgba(255,255,255,.12) !important;
    padding-bottom:10px !important;
  }
}

@media(max-width:980px){
  .pbi281-sidebar{
    grid-template-columns:1fr !important;
  }
  .pbi281-brand{
    border-right:none !important;
    border-bottom:1px solid rgba(255,255,255,.12) !important;
    padding-bottom:10px !important;
  }
}


/* FIX v283 - Dashboard detalle modal y ajustes de importes */
.pbi281-decisions div,.pbi281-alert{cursor:pointer!important;transition:transform .15s ease,box-shadow .15s ease!important}
.pbi281-decisions div:hover,.pbi281-alert:hover{transform:translateY(-1px)!important;box-shadow:0 10px 22px rgba(15,23,42,.08)!important}
.pbi283-modal-backdrop{position:fixed!important;inset:0!important;background:rgba(15,23,42,.42)!important;z-index:99999!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:22px!important}
.pbi283-modal{width:min(1050px,96vw)!important;max-height:86vh!important;overflow:auto!important;background:#fff!important;border-radius:18px!important;box-shadow:0 28px 80px rgba(15,23,42,.32)!important;padding:20px!important;position:relative!important}
.pbi283-close{position:absolute!important;right:14px!important;top:12px!important;width:34px!important;height:34px!important;border:none!important;border-radius:10px!important;background:#f1f5f9!important;color:#0f172a!important;font-size:22px!important;line-height:34px!important;cursor:pointer!important}
.pbi283-modal h2{margin:0!important;padding-right:45px!important;color:#0f172a!important;font-size:22px!important;font-weight:950!important}
.pbi283-modal p{margin:6px 0 16px!important;color:#64748b!important}
.pbi283-modal-table{width:100%!important;border-collapse:separate!important;border-spacing:0!important;font-size:13px!important}
.pbi283-modal-table th{position:sticky!important;top:0!important;background:#f8fafc!important;color:#475569!important;text-align:left!important;text-transform:uppercase!important;font-size:11px!important;padding:10px!important;border-bottom:1px solid #e5edf6!important}
.pbi283-modal-table td{padding:10px!important;border-bottom:1px solid #edf2f7!important;color:#334155!important;vertical-align:top!important}
.pbi283-modal-empty{padding:18px!important;border:1px dashed #cbd5e1!important;border-radius:12px!important;background:#f8fafc!important;color:#64748b!important;text-align:center!important}


.pbi281-kpi.clickable{cursor:pointer;transition:transform .18s ease, box-shadow .18s ease;}
.pbi281-kpi.clickable:hover{transform:translateY(-2px);box-shadow:0 10px 24px rgba(15,23,42,.10);}

/* FIX VISUAL BUSCADOR PROPUESTAS v237 - SOLO ESTILO */
#page-ventas_cotizaciones .pe-searchbar-v198{
  display:flex!important;
  justify-content:flex-end!important;
  align-items:center!important;
  width:100%!important;
  margin:16px 0 0!important;
  padding:14px 18px!important;
  background:#fff!important;
  border:1px solid #dbe4f0!important;
  border-bottom:0!important;
  border-radius:14px 14px 0 0!important;
  box-sizing:border-box!important;
}
#page-ventas_cotizaciones .pe-searchbox-v198{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  width:470px!important;
  max-width:100%!important;
}
#page-ventas_cotizaciones .pe-searchbox-v198 > i{
  position:absolute!important;
  left:14px!important;
  top:50%!important;
  transform:translateY(-50%)!important;
  color:#94a3b8!important;
  font-size:13px!important;
  pointer-events:none!important;
  z-index:2!important;
}
#page-ventas_cotizaciones #peSearchInput{
  width:100%!important;
  height:38px!important;
  min-width:0!important;
  margin:0!important;
  padding:0 38px!important;
  border:1px solid #cbd7ea!important;
  border-radius:10px!important;
  background:#fff!important;
  color:#0f172a!important;
  font-family:inherit!important;
  font-size:14px!important;
  line-height:38px!important;
  outline:none!important;
  box-shadow:none!important;
  box-sizing:border-box!important;
  appearance:none!important;
  -webkit-appearance:none!important;
}
#page-ventas_cotizaciones #peSearchInput:focus{
  border-color:#60a5fa!important;
  box-shadow:0 0 0 3px rgba(59,130,246,.14)!important;
}
#page-ventas_cotizaciones #peSearchInput::-webkit-search-cancel-button{
  cursor:pointer!important;
}
#page-ventas_cotizaciones .pe-searchbar-v198 + .pe-list-card{
  margin-top:0!important;
  border-top-left-radius:0!important;
  border-top-right-radius:0!important;
}
@media (max-width:700px){
  #page-ventas_cotizaciones .pe-searchbar-v198{
    padding:12px!important;
  }
  #page-ventas_cotizaciones .pe-searchbox-v198{
    width:100%!important;
  }
}

/* FIX v241 - ESTILO REAL DEL BUSCADOR DE PROPUESTAS (sin depender del ID de página) */
.pe-searchbar-v198{
  display:flex!important;
  justify-content:flex-end!important;
  align-items:center!important;
  width:100%!important;
  margin:16px 0 0!important;
  padding:14px 18px!important;
  background:#fff!important;
  border:1px solid #dbe4f0!important;
  border-bottom:0!important;
  border-radius:14px 14px 0 0!important;
  box-sizing:border-box!important;
}
.pe-searchbox-v198{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  width:470px!important;
  max-width:100%!important;
  margin-left:auto!important;
}
.pe-searchbox-v198 > i{
  position:absolute!important;
  left:14px!important;
  top:50%!important;
  transform:translateY(-50%)!important;
  color:#94a3b8!important;
  font-size:13px!important;
  pointer-events:none!important;
  z-index:2!important;
}
.pe-searchbox-v198 #peSearchInput,
input#peSearchInput{
  display:block!important;
  width:100%!important;
  height:38px!important;
  min-width:0!important;
  margin:0!important;
  padding:0 38px!important;
  border:1px solid #cbd7ea!important;
  border-radius:10px!important;
  background:#fff!important;
  color:#0f172a!important;
  font-family:inherit!important;
  font-size:14px!important;
  line-height:38px!important;
  outline:none!important;
  box-shadow:none!important;
  box-sizing:border-box!important;
  appearance:none!important;
  -webkit-appearance:none!important;
}
.pe-searchbox-v198 #peSearchInput:focus,
input#peSearchInput:focus{
  border-color:#60a5fa!important;
  box-shadow:0 0 0 3px rgba(59,130,246,.14)!important;
}
.pe-searchbar-v198 + .pe-list-card{
  margin-top:0!important;
  border-top-left-radius:0!important;
  border-top-right-radius:0!important;
}
@media(max-width:700px){
  .pe-searchbar-v198{padding:12px!important;}
  .pe-searchbox-v198{width:100%!important;}
}


/* CHAT READ RECEIPTS V1 */
.chat-read-status{display:block;margin-top:3px;font-size:10px;line-height:1;text-align:right;opacity:.82;white-space:nowrap}.chat-read-status i{font-size:9px;margin-right:3px}.chat-read-status.is-read{font-weight:700;opacity:1}.chat-msg.theirs .chat-read-status{display:none}

/* Flujo de solicitud de pago de comisiones */
.commission-request-btn,
.commission-pay-btn{
  border:0;
  border-radius:9px;
  padding:7px 11px;
  font-size:11px;
  font-weight:700;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:6px;
  white-space:nowrap;
}
.commission-request-btn{background:#2563eb;color:#fff;box-shadow:0 4px 10px rgba(37,99,235,.18)}
.commission-request-btn:hover{background:#1d4ed8}
.commission-pay-btn{background:#16a34a;color:#fff;box-shadow:0 4px 10px rgba(22,163,74,.18)}
.commission-pay-btn:hover{background:#15803d}
.commission-request-meta{margin-top:6px;font-size:10px;line-height:1.25;color:#64748b;max-width:150px}
.commission-request-meta b{color:#0f172a}


/* Comisiones V313 */
.commission-actions{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.commission-action-btn{border:0;border-radius:9px;padding:8px 11px;font-weight:800;font-size:11px;cursor:pointer;display:inline-flex;align-items:center;gap:6px;box-shadow:0 3px 10px rgba(15,23,42,.10)}
.commission-action-btn.save{background:#e2e8f0;color:#334155}
.commission-action-btn.pay{background:#16a34a;color:#fff}
.commission-action-btn.reject{background:#dc2626;color:#fff}
.commission-action-btn:hover,.commission-request-btn:hover{filter:brightness(.96);transform:translateY(-1px)}
.commission-state{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:7px 10px;font-size:11px;font-weight:800;white-space:nowrap}
.commission-state.paid{background:#dcfce7;color:#166534}.commission-state.pending{background:#fef3c7;color:#92400e}.commission-state.rejected{background:#fee2e2;color:#991b1b}.commission-state.idle{background:#f1f5f9;color:#64748b}
.commission-reject-note{margin-top:7px;max-width:270px;padding:8px 10px;border-left:3px solid #dc2626;background:#fff1f2;color:#7f1d1d;border-radius:6px;font-size:11px;line-height:1.35}
.commission-request-meta{margin-top:6px;color:#475569;font-size:11px}.commission-request-btn.retry{margin-top:7px;background:#475569}

/* Comisiones ADMIN V314 */
#rrhhCommissionTable th:last-child,#rrhhCommissionTable td:last-child{min-width:165px;width:165px;vertical-align:middle}
#rrhhCommissionTable .commission-actions{display:flex!important;gap:7px!important;align-items:flex-start!important;flex-wrap:wrap!important}
#rrhhCommissionTable .commission-action-btn{appearance:none!important;text-decoration:none!important;line-height:1!important}
#rrhhCommissionTable .commission-state.idle{margin:0!important}


/* PLANILLA Y BOLETAS V316 */
.payroll-tabs{display:flex;gap:8px;margin:0 0 14px;padding:6px;background:#fff;border:1px solid #e5eaf2;border-radius:12px;width:max-content}.payroll-tabs button{border:0;background:transparent;padding:10px 16px;border-radius:9px;font-weight:700;color:#52627a;cursor:pointer}.payroll-tabs button.active{background:#1769ff;color:#fff;box-shadow:0 4px 12px rgba(23,105,255,.25)}
.payroll-work .table-actions{display:flex;gap:8px}.payroll-work .table-actions select,.payroll-work .table-actions input{border:1px solid #ced8e8;border-radius:8px;padding:8px}.payroll-scroll{overflow:auto;max-height:65vh}.payroll-grid{min-width:1900px}.payroll-grid th{position:sticky;top:0;z-index:2}.payroll-grid td{vertical-align:top}.payroll-grid td:first-child{position:sticky;left:0;background:#fff;z-index:1;min-width:220px}.payroll-grid small{display:block;color:#7b8ba6;margin:3px 0}.payroll-input,.payroll-grid select{width:90px;border:1px solid #ccd7e7;border-radius:8px;padding:7px}.payroll-actions{display:flex;flex-direction:column;gap:6px;margin-top:6px}.payroll-actions button,.btn-payroll-view{border:0;border-radius:8px;padding:8px 10px;font-weight:700;cursor:pointer;background:#e9f1ff;color:#1558c9;white-space:nowrap}.payroll-actions button.generate{background:#16a56a;color:#fff}.payroll-net{font-weight:800;color:#078b4d;white-space:nowrap}
.payroll-config-grid{display:grid;grid-template-columns:1fr 1.3fr;gap:14px}.payroll-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:14px}.payroll-form-grid label{font-size:12px;font-weight:700;color:#506079}.payroll-form-grid input,.payroll-form-grid select{display:block;width:100%;margin-top:5px;border:1px solid #ccd7e7;border-radius:8px;padding:9px;background:#fff}.payroll-form-grid .full{grid-column:1/-1}.payroll-profile-list{padding:10px;max-height:70vh;overflow:auto}.payroll-profile-list details{border:1px solid #e1e7f0;border-radius:10px;margin-bottom:8px}.payroll-profile-list summary{padding:12px;font-weight:800;cursor:pointer}.payroll-profile-list summary span{float:right;color:#71819a;font-weight:500}.payroll-form-grid.profile{grid-template-columns:repeat(3,minmax(0,1fr))}
.payslip-sheet{font-size:12px;color:#10213d;max-width:1000px;margin:auto}.payslip-title{text-align:center;border-bottom:2px solid #163765;padding-bottom:10px}.payslip-title h2{margin:0;font-size:22px}.payslip-sheet section{margin-top:12px;border:1px solid #cad5e5}.payslip-sheet section h3{margin:0;padding:7px 10px;background:#eaf1fb;color:#163765;font-size:12px}.payslip-info{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;background:#d9e1ec}.payslip-info span{background:#fff;padding:8px}.payslip-info b{display:block;font-size:10px;color:#64748b;margin-bottom:3px}.payslip-columns{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px}.payslip-line{display:flex;justify-content:space-between;padding:6px 8px;border-bottom:1px solid #edf1f6}.payslip-line.total{background:#eef5ff;font-weight:800}.payslip-net-total{display:flex;justify-content:space-between;margin-top:12px;padding:13px;background:#163765;color:#fff;font-size:17px}.payslip-signatures{display:flex;justify-content:space-around;margin-top:180px;min-height:70px;align-items:flex-start}.payslip-signatures span{border-top:1px solid #333;padding:7px 50px;min-width:180px;text-align:center}
@media(max-width:900px){.payroll-config-grid{grid-template-columns:1fr}.payroll-form-grid.profile{grid-template-columns:1fr 1fr}.payslip-columns{grid-template-columns:1fr}.payslip-info{grid-template-columns:1fr 1fr}}

/* Planilla v319: vista ADMIN simplificada y descuento automático de asistencia */
.payroll-grid-v319{min-width:1420px}.payroll-attendance-discount b{display:block;color:#dc2626}.payroll-attendance-discount small{display:block;color:#64748b;margin-top:4px;white-space:nowrap}.payroll-period-open{display:block;color:#b45309;font-size:10px;margin-top:5px}.payroll-actions button:disabled{opacity:.45;cursor:not-allowed;filter:grayscale(.25)}


/* V328: ventana emergente de boleta */
.payslip-modal-v328{position:fixed;inset:0;background:rgba(15,23,42,.72);z-index:99999;display:flex;align-items:center;justify-content:center;padding:22px}
.payslip-modal-card-v328{width:min(1120px,96vw);max-height:94vh;background:#fff;border-radius:14px;box-shadow:0 24px 70px rgba(0,0,0,.35);overflow:hidden;display:flex;flex-direction:column}
.payslip-modal-head-v328{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid #dce5f1;background:#f8fafc;font-size:15px}
.payslip-modal-head-v328>div{display:flex;gap:8px}.payslip-modal-head-v328 button{border:0;border-radius:8px;padding:8px 12px;background:#1f5be3;color:#fff;font-weight:700;cursor:pointer}.payslip-modal-head-v328 button.close{background:#e8eef8;color:#17315b;padding:8px 11px}
.payslip-modal-body-v328{padding:18px;overflow:auto;background:#eef3f9}.payslip-modal-body-v328 .payslip-sheet{background:#fff;padding:18px;box-shadow:0 4px 18px rgba(15,23,42,.10);max-width:1000px;width:100%}
@media(max-width:760px){.payslip-modal-v328{padding:6px}.payslip-modal-body-v328{padding:8px}.payslip-info{grid-template-columns:repeat(2,1fr)}.payslip-columns{grid-template-columns:1fr}.payslip-signatures span{padding:7px 25px}}
@media print{.payslip-print-v328{margin:0;padding:12mm}.payslip-print-v328 .payslip-sheet{max-width:none;box-shadow:none}.payslip-modal-v328{display:none!important}}


/* v329 Boleta con logo y estilos de impresión */
.payslip-title-head{display:grid;grid-template-columns:84px 1fr;gap:14px;align-items:center}
.payslip-logo-wrap{display:flex;align-items:center;justify-content:center;min-height:72px}
.payslip-logo{max-width:72px;max-height:72px;object-fit:contain}
.payslip-title-copy{text-align:center}
.payslip-modal-card-v329{max-width:1100px;width:min(1100px,96vw)}
.payslip-modal-body-v328 .payslip-sheet{padding:18px 14px 20px}
.payslip-sheet{page-break-inside:avoid;break-inside:avoid}
.payslip-sheet section,.payslip-columns,.payslip-net-total{page-break-inside:avoid;break-inside:avoid}
@media(max-width:760px){.payslip-title-head{grid-template-columns:1fr}.payslip-logo-wrap{min-height:56px}.payslip-logo{max-width:56px;max-height:56px}}
@media print{html,body{background:#fff!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.payslip-print-v329{padding:0!important;margin:0!important}.payslip-print-v329 .payslip-sheet{box-shadow:none!important;max-width:none!important;width:100%!important}}


/* v330 Cabecera de boleta estilo Laproworld */
.payslip-title-head{display:grid!important;grid-template-columns:155px 1fr!important;gap:18px!important;align-items:center!important;min-height:100px!important}
.payslip-logo-wrap{display:flex!important;align-items:center!important;justify-content:flex-start!important;min-height:96px!important}
.payslip-logo{width:145px!important;max-width:145px!important;max-height:96px!important;object-fit:contain!important;display:block!important;opacity:1!important;filter:none!important}
.payslip-title-copy{text-align:center!important;padding-right:155px!important}
.payslip-title-copy h2{color:#000!important;font-size:24px!important;line-height:1.05!important;margin:0!important}
.payslip-title-copy p{color:#000!important;font-size:10px!important;font-weight:700!important;margin:5px 0 0!important}
.payslip-title-copy b{display:inline-block!important;color:#000!important;font-size:12px!important;text-decoration:underline!important;margin-top:5px!important}
@media(max-width:760px){.payslip-title-head{grid-template-columns:120px 1fr!important}.payslip-logo{width:110px!important}.payslip-title-copy{padding-right:120px!important}.payslip-title-copy h2{font-size:19px!important}}
@media print{.payslip-title-head{grid-template-columns:145px 1fr!important;min-height:92px!important}.payslip-logo{width:135px!important;max-width:135px!important}.payslip-title-copy{padding-right:145px!important}.payslip-title-copy h2{font-size:16pt!important}}

/* v331 cabecera de boleta */
.payslip-title-head{display:grid;grid-template-columns:120px 1fr;gap:16px;align-items:center;min-height:86px}
.payslip-logo-wrap{display:flex;align-items:center;justify-content:flex-start}
.payslip-logo{display:block;width:100px;max-width:100px;max-height:92px;object-fit:contain}
.payslip-title-copy{text-align:center;padding-right:110px}
.payslip-title-copy h2{color:#000}
.payslip-title-copy p,.payslip-title-copy b{color:#000}
.payslip-title-copy b{text-decoration:underline}
@media(max-width:760px){.payslip-title-head{grid-template-columns:90px 1fr}.payslip-logo{width:78px}.payslip-title-copy{padding-right:80px}}

/* v333 asistencia boleta */
.payslip-attendance-line span{display:flex;flex-direction:column;gap:2px}.payslip-attendance-line small{font-size:8px;color:#64748b;font-weight:500}


/* V335 - Restauración de Actividades planificadas: Propuestas y Prospectos */
.pe-planned-section,.crm-plan-section{margin:18px 0 10px;font-size:12px;color:#26374d}.pe-planned-title,.crm-plan-divider{display:flex;align-items:center;gap:9px;font-weight:600;color:#34465d;margin:10px 0 14px;white-space:nowrap}.pe-planned-title>span,.crm-plan-divider>span{height:1px;flex:1;border-top:1px dashed #cfd8e4}.pe-planned-list{display:flex;flex-direction:column;gap:12px}.pe-planned-row,.crm-plan-row{display:grid;grid-template-columns:42px minmax(0,1fr);gap:9px;position:relative;padding:2px 2px 10px}.pe-planned-avatar-wrap,.crm-plan-avatar-wrap{position:relative;width:38px;height:38px}.pe-planned-avatar-wrap .pe-avatar,.crm-plan-avatar{width:31px;height:31px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#dce7f5;color:#173962;font-weight:800;overflow:hidden}.pe-planned-avatar-wrap .pe-avatar img{width:100%;height:100%;object-fit:cover}.pe-planned-icon,.crm-plan-type-icon{position:absolute;right:0;bottom:0;width:19px;height:19px;border-radius:50%;display:grid;place-items:center;background:#ffca28;color:#253247;border:2px solid #fff;font-size:9px;box-shadow:0 1px 2px rgba(0,0,0,.15)}.pe-planned-content,.crm-plan-content{min-width:0}.pe-planned-line,.crm-plan-main{display:flex;align-items:center;gap:4px;flex-wrap:wrap;line-height:1.45}.pe-planned-status,.crm-plan-due{font-weight:700;color:#df5b2b}.pe-planned-info-btn,.crm-plan-info{border:0;background:none;padding:1px 3px;color:#416884;cursor:pointer;font-size:11px}.pe-planned-summary,.crm-plan-summary{margin-top:5px;color:#27384f;white-space:pre-wrap}.pe-planned-actions,.crm-plan-actions{display:flex;gap:13px;flex-wrap:wrap;margin-top:7px}.pe-planned-actions button,.crm-plan-actions button{border:0;background:none;padding:0;color:#526c82;font-size:11px;cursor:pointer}.pe-planned-actions button:hover,.crm-plan-actions button:hover{color:#1260b8;text-decoration:underline}.pe-planned-details,.crm-plan-details{margin:8px 0 6px;padding:9px 10px;background:#fbfcfe;border-left:2px solid #9fb2ca}.pe-planned-detail-grid,.crm-plan-detail-grid{display:grid;grid-template-columns:130px minmax(0,1fr);gap:8px 14px;align-items:center}.pe-planned-detail-label,.crm-plan-detail-grid>b{text-align:right;color:#42556b;font-weight:600}.pe-inline-user,.crm-plan-inline-user{display:inline-flex;align-items:center;gap:5px}.pe-inline-user-avatar,.crm-plan-mini-avatar{width:21px;height:21px;border-radius:50%;display:inline-grid;place-items:center;background:#dce7f5;color:#173962;font-size:9px;font-weight:800;overflow:hidden}.pe-inline-user-avatar img{width:100%;height:100%;object-fit:cover}.pe-planned-note-block,.crm-plan-note{margin:9px 0 0;padding:7px 9px;background:#f4f6f8;border:1px solid #e1e6ed;color:#27384f;white-space:pre-wrap}.pe-planned-done-box,.crm-plan-done-box{margin:9px 0 0;border:1px solid #aab7c7;background:#f8fafc;padding:8px;max-width:430px}.pe-planned-done-head,.crm-plan-done-box>b{display:block;margin-bottom:6px;font-weight:700}.pe-planned-done-text,.crm-plan-done-box textarea{width:100%;min-height:66px;resize:vertical;border:1px solid #7f9db9;padding:7px;font:inherit;background:#fff}.pe-planned-done-actions,.crm-plan-done-box>div{display:flex;align-items:center;gap:5px;margin-top:6px}.pe-planned-done-actions button,.crm-plan-done-box>div button{border:0;padding:6px 10px;font-size:10px;cursor:pointer;background:#667f99;color:#fff;font-weight:700}.pe-planned-done-actions .pe-done-next,.crm-plan-done-box button.next{background:#5b8eae}.pe-planned-done-actions .pe-done-cancel,.crm-plan-done-box button.discard{background:transparent;color:#725c91;font-weight:500}.crm-plan-history{display:grid;grid-template-columns:30px minmax(0,1fr);gap:8px;padding:8px 0;border-bottom:1px solid #edf1f5}.crm-plan-history small{display:block;color:#8a98aa;margin:1px 0 5px}.crm-plan-history p{margin:5px 0;white-space:pre-wrap}.crm-plan-modal textarea{min-height:95px}@media(max-width:700px){.pe-planned-detail-grid,.crm-plan-detail-grid{grid-template-columns:1fr}.pe-planned-detail-label,.crm-plan-detail-grid>b{text-align:left}.pe-planned-row,.crm-plan-row{grid-template-columns:34px minmax(0,1fr)}}

/* v337 Campana exclusiva de planificaciones */
#notifBtn .notif-dot{min-width:17px;height:17px;padding:0 4px;border-radius:999px;display:none;align-items:center;justify-content:center;font-size:9px;font-weight:800;color:#fff;background:#ef4444;line-height:1}
.planned-notif-v337{width:100%;border:0;background:#fff;text-align:left;cursor:pointer}
.planned-notif-v337:hover{background:#f8fbff}


/* v340 Modal independiente de actividades planificadas */
.pe-planned-standalone-overlay{position:fixed;inset:0;z-index:1000005;background:rgba(15,23,42,.58);display:flex;align-items:center;justify-content:center;padding:22px}
.pe-planned-standalone-box{width:min(920px,96vw);max-height:92vh;overflow:auto;background:#fff;border-radius:16px;box-shadow:0 28px 90px rgba(15,23,42,.38)}
.pe-planned-standalone-head{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid #e2e8f0;font-size:16px;color:#0f172a}
.pe-planned-close{width:34px;height:34px;border:1px solid #dbe4ef;border-radius:9px;background:#f8fafc;color:#64748b;cursor:pointer}
.pe-planned-standalone-form{padding:18px 22px}
.pe-planned-standalone-actions{display:flex;justify-content:flex-end;gap:10px;padding-top:16px;border-top:1px solid #e2e8f0;margin-top:6px}
.pe-planned-standalone-actions button{border-radius:10px;padding:10px 18px;font-weight:700;cursor:pointer}
.pe-planned-cancel{background:#fff;border:1px solid #cbd5e1;color:#334155}
.pe-planned-save{background:#2558e8;border:1px solid #2558e8;color:#fff}
.pe-planned-save:disabled{opacity:.65;cursor:not-allowed}

/* V342 Prospecto Comercial - paridad de planificación con Propuestas Económicas */
#prospectActivitiesBox .crm-plan-section{margin-top:14px}
#prospectActivitiesBox .crm-plan-due.pros-due-red{color:#df4f2f}
#prospectActivitiesBox .crm-plan-due.pros-due-green{color:#b87500}
#prospectActivitiesBox .crm-plan-due.pros-due-gray{color:#64748b}
#prospectActivitiesBox .crm-plan-history{margin:4px 0}

/* v343 Prospecto planificación paridad real */
#prospectActivitiesBox .crm-plan-section{margin-top:0}
#prospectActivitiesBox .crm-extra-activity-feed{margin-top:18px;border-top:1px solid #dbe5f0;padding-top:12px}

/* V344 Prospecto - historial por fechas y fotos reales */
.prospect-crm-right>.planned-title{display:none!important}
.prospect-v344-date{text-align:center;font-weight:800;color:#111827;margin:20px 0 10px;font-size:13px}
.crm-plan-avatar.has-photo img,.crm-plan-mini-avatar.has-photo img,.crm-plan-history-avatar.has-photo img,.prospect-v344-avatar.has-photo img{width:100%;height:100%;object-fit:cover;border-radius:50%}
.crm-plan-history-avatar{width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#dce7f5;color:#173962;font-weight:800}
.prospect-v344-avatar{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#dce7f5;color:#173962;font-weight:800;flex:0 0 32px}
.prospect-v344-line{align-items:flex-start}

/* V345 Prospecto: fotos reales de usuarios en actividades */
.crm-plan-avatar.no-photo,.crm-plan-mini-avatar.no-photo,.crm-plan-history-avatar.no-photo,.prospect-v344-avatar.no-photo{background:#eef2f7;color:#64748b;display:flex;align-items:center;justify-content:center}
.crm-plan-avatar.no-photo i,.crm-plan-mini-avatar.no-photo i,.crm-plan-history-avatar.no-photo i,.prospect-v344-avatar.no-photo i{font-size:55%}
.crm-plan-avatar img,.crm-plan-mini-avatar img,.crm-plan-history-avatar img,.prospect-v344-avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%;display:block}

/* V347 URLs completas y clicables en notas/actividades */
#prospectActivitiesBox .prospect-activity-text-v347,
#prospectActivitiesBox .prospect-activity-card p,
#prospectActivitiesBox .crm-extra-activity-feed p{
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
  max-width:100%;
}
#prospectActivitiesBox .prospect-activity-url-v347{
  display:inline;
  color:#1d4ed8;
  text-decoration:underline;
  overflow-wrap:anywhere;
  word-break:break-all;
}
#prospectActivitiesBox .prospect-activity-url-v347:hover{color:#1e40af}


/* v348 Propuestas Económicas: notas y URLs completas */
#page-ventas_cotizaciones .pe-feed,
#page-ventas_cotizaciones .pe-feed-item,
#page-ventas_cotizaciones .pe-feed-body{
  min-width:0!important;
  max-width:100%!important;
  overflow:visible!important;
}
#page-ventas_cotizaciones .pe-feed-body p,
#page-ventas_cotizaciones .pe-feed-item p,
#page-ventas_cotizaciones [data-note-text]{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  white-space:pre-wrap!important;
  overflow:visible!important;
  overflow-wrap:anywhere!important;
  word-break:break-word!important;
  text-overflow:clip!important;
  -webkit-line-clamp:unset!important;
  line-clamp:unset!important;
  max-height:none!important;
}
#page-ventas_cotizaciones .pe-activity-url-v348{
  display:inline!important;
  color:#1d4ed8!important;
  text-decoration:underline!important;
  overflow-wrap:anywhere!important;
  word-break:break-all!important;
}

/* v521 - Campana de Planificación: contador al costado, sin superposición */
#notifBtn{
  width:auto!important;
  min-width:36px!important;
  padding:0 8px!important;
  gap:4px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}
#notifBtn .notif-dot{
  position:static!important;
  order:-1!important;
  min-width:0!important;
  width:auto!important;
  height:auto!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  color:#ef4444!important;
  font-size:12px!important;
  font-weight:800!important;
  line-height:1!important;
  box-shadow:none!important;
}
#notifBtn > i{
  order:0!important;
  flex:0 0 auto!important;
}

/* Orden de compra: control independiente YA ATENDIDO */
.order-attended-label{margin-top:4px;font-size:10px;font-weight:700;color:#059669;white-space:nowrap}.order-attended-label i{margin-right:3px}.act-btn.attended-done{opacity:.72;cursor:default;background:#d1fae5!important;color:#047857!important;border-color:#a7f3d0!important}
\n/* V608 - selector compacto de Tipo de actividad */
.lpw-activity-picker-v608{position:relative;width:100%;font-size:14px}
.lpw-activity-trigger-v608{width:100%;height:38px;display:flex;align-items:center;justify-content:space-between;background:#fff;border:1px solid #cbd5e1;border-radius:10px;padding:0 12px;cursor:pointer;text-align:left;color:#0f172a}
.lpw-activity-trigger-v608:hover,.lpw-activity-trigger-v608:focus{border-color:#2563eb;outline:none;box-shadow:0 0 0 2px rgba(37,99,235,.10)}
.lpw-activity-arrow-v608{font-size:16px;color:#475569;line-height:1}
.lpw-activity-menu-v608{position:absolute;z-index:10020;left:0;right:0;top:calc(100% + 2px);max-height:280px;overflow-y:auto;background:#fff;border:1px solid #cbd5e1;border-radius:8px;box-shadow:0 10px 28px rgba(15,23,42,.18);padding:0}
.lpw-activity-option-v608{display:block;width:100%;height:30px;min-height:30px;margin:0;padding:0 11px;border:0;border-bottom:1px solid #f1f5f9;background:#fff;color:#0f172a;text-align:left;line-height:30px;font-size:13px;cursor:pointer;border-radius:0}
.lpw-activity-option-v608:last-child{border-bottom:0}
.lpw-activity-option-v608:hover,.lpw-activity-option-v608.is-selected{background:#2563eb;color:#fff}

/* V609 - Tipo de actividad: select nativo estable y compacto */
.lpw-activity-select-v609{width:100%;height:36px;min-height:36px;padding:0 11px;border:1px solid #2563eb;border-radius:10px;background:#fff;color:#0f172a;font-size:13px;line-height:1.2;outline:none;cursor:pointer}
.lpw-activity-select-v609:focus{border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,.10)}
.lpw-activity-select-v609 option{padding:0;margin:0;font-size:13px}


/* LAPROWORLD Call v632 - estado en header */
.lpw-call-top-status{display:inline-flex!important;align-items:center;gap:7px;white-space:nowrap;transition:.18s ease;}
.lpw-call-top-status .lpw-call-top-dot{width:9px;height:9px;border-radius:999px;display:inline-block;box-shadow:0 0 0 3px rgba(148,163,184,.15);background:#94a3b8;}
.lpw-call-top-status.is-online{background:#16a34a!important;border-color:#16a34a!important;color:#fff!important;}
.lpw-call-top-status.is-online .lpw-call-top-dot{background:#bbf7d0;box-shadow:0 0 0 3px rgba(187,247,208,.2);}
.lpw-call-top-status.is-offline{background:#64748b!important;border-color:#64748b!important;color:#fff!important;}
.lpw-call-top-status.is-offline .lpw-call-top-dot{background:#fecaca;box-shadow:0 0 0 3px rgba(254,202,202,.2);}
@media(max-width:1180px){.lpw-call-top-status .lpw-call-top-label{display:none}.lpw-call-top-status{padding-left:10px!important;padding-right:10px!important;}}

/* V679 · Reemplazo controlado de factura anulada */
.invoice-replace-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.invoice-replace-requested{margin-top:10px;padding:10px 12px;border:1px solid #f59e0b;background:#fffbeb;border-radius:10px;color:#92400e;display:flex;flex-direction:column;gap:3px}.invoice-replace-requested b{font-size:12px}.invoice-replace-requested small{font-size:11px}.invoice-replacement-approved{margin-top:9px;padding:9px 11px;border:1px solid #86efac;background:#ecfdf5;border-radius:9px;color:#166534;font-size:11px;font-weight:700}.invoice-history-list{display:flex;flex-direction:column;gap:10px}.invoice-history-item{border:1px solid #e2e8f0;border-radius:12px;padding:12px;background:#f8fafc;display:grid;gap:8px}.invoice-history-item b,.invoice-history-item small{display:block}.invoice-history-item small{color:#64748b;font-size:11px}.btn-mini.danger{background:#fff1f2!important;color:#b91c1c!important;border:1px solid #fecaca!important}.btn-mini.disabled{opacity:.55;cursor:not-allowed}

/* V680 · Acciones de reemplazo de factura dentro de Alertas pendientes */
.alerta-invoice-actions{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin-left:auto}.alerta-invoice-actions button{border:0;border-radius:9px;padding:7px 10px;font-size:11px;font-weight:800;cursor:pointer;display:inline-flex;align-items:center;gap:5px;white-space:nowrap}.alerta-invoice-approve{background:#dcfce7;color:#166534}.alerta-invoice-approve:hover{background:#bbf7d0}.alerta-invoice-reject{background:#fee2e2;color:#991b1b}.alerta-invoice-reject:hover{background:#fecaca}@media(max-width:720px){.alerta-invoice-actions{width:100%;margin-left:44px;margin-top:6px}.alerta-invoice-actions button{flex:1;justify-content:center}}

.invoice-replacement-rejected{margin-top:10px;padding:10px 12px;border:1px solid #fecaca;background:#fff1f2;border-radius:10px;color:#991b1b;display:flex;flex-direction:column;gap:3px}.invoice-replacement-rejected b{font-size:12px}.invoice-replacement-rejected small{font-size:11px}


/* =========================================================
   FIX v717 - cabecera compacta sin estiramiento
   Mantener botones como en la primera carga, sin expandirse.
   ========================================================= */
.header-right{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  flex-wrap:nowrap!important;
  overflow:visible!important;
}
.header-right > .btn-new,
.header-right > a.btn-new,
.header-right > button.btn-new,
.header-right > #btnClientesGeo,
.header-right > #btnNew,
.header-right > #btnCorreoTop,
.header-right > #btnAlertasGlobal,
.header-right > #btnWhatsappTop,
.header-right > #lpwCallTopStatus{
  flex:0 0 auto!important;
  width:auto!important;
  max-width:none!important;
  min-width:auto!important;
  white-space:nowrap!important;
}
#btnClientesGeo.btn-map-clientes,
#btnNew,
#btnCorreoTop,
#btnAlertasGlobal,
#btnWhatsappTop,
#lpwCallTopStatus{
  width:auto!important;
  min-width:auto!important;
  max-width:none!important;
  padding:0 16px!important;
}
#btnClientesGeo.btn-map-clientes span,
#btnNew span,
#btnCorreoTop span,
#btnAlertasGlobal span,
#btnWhatsappTop span,
#lpwCallTopStatus .lpw-call-top-label{
  display:inline!important;
}

/* V718 cabecera final compacta */
.header-right #btnClientesGeo.btn-map-clientes,
.header-right #btnNew,
.header-right #btnCorreoTop,
.header-right #btnAlertasGlobal,
.header-right #btnWhatsappTop,
.header-right #lpwCallTopStatus{
  flex:0 0 auto!important;
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  height:40px!important;
  padding-left:14px!important;
  padding-right:14px!important;
  white-space:nowrap!important;
}
.header-right #btnClientesGeo.btn-map-clientes span,
.header-right #btnNew span{display:inline!important;}


/* =========================================================
   V719 - CABECERA MÁS DELGADA Y NUEVO CORTO
   ========================================================= */
.header-right{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  flex-wrap:nowrap!important;
}
.header-right > .btn-new,
.header-right > a.btn-new,
.header-right > button.btn-new{
  flex:0 0 auto!important;
}
.header-right .btn-new:not(.hdr-profile),
#btnWhatsappTop,
#btnCorreoTop,
#btnAlertasGlobal,
#btnClientesGeo,
#btnNew,
#lpwCallTopStatus{
  height:36px!important;
  min-height:36px!important;
  max-height:36px!important;
  padding:0 12px!important;
  border-radius:10px!important;
  font-size:12px!important;
  line-height:1!important;
  white-space:nowrap!important;
  width:auto!important;
  min-width:auto!important;
  max-width:none!important;
}
#btnWhatsappTop i,
#btnCorreoTop i,
#btnAlertasGlobal i,
#btnClientesGeo i,
#btnNew i,
#lpwCallTopStatus i{
  font-size:12px!important;
}
#btnNew span{
  display:inline!important;
}
@media (max-width:1280px){
  #btnWhatsappTop span,
  #btnCorreoTop span,
  #btnAlertasGlobal span,
  #btnClientesGeo span,
  #btnNew span,
  #lpwCallTopStatus .lpw-call-top-label{
    display:none!important;
  }
  #btnWhatsappTop,
  #btnCorreoTop,
  #btnAlertasGlobal,
  #btnClientesGeo,
  #btnNew,
  #lpwCallTopStatus{
    width:36px!important;
    min-width:36px!important;
    max-width:36px!important;
    padding:0!important;
  }
}

/* V727 - Comentarios ADMIN en Solicitud de Cotización */
.quote-admin-comment{margin-top:8px;padding:9px 11px;border:1px solid #bfdbfe;border-left:4px solid #2563eb;border-radius:10px;background:#eff6ff;color:#1e3a5f;max-width:100%}
.quote-admin-comment-head{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:4px;color:#1d4ed8;font-size:11px}.quote-admin-comment-head span{margin-left:auto;color:#64748b;font-weight:500;font-size:10px}.quote-admin-comment-text{font-size:11.5px;line-height:1.45;white-space:pre-wrap}.quote-admin-comment small{display:block;margin-top:5px;color:#64748b;font-size:10px}.quote-comment-btn{background:#eef4ff!important;border-color:#bfdbfe!important;color:#1d4ed8!important}


/* V730 - Modal comentario ADMIN completamente visible */
.quote-admin-comment-editor{
  display:flex;
  flex-direction:column;
  min-height:0;
  padding-bottom:14px;
}
.quote-admin-comment-editor .form-grid{
  padding-bottom:4px;
}
.quote-admin-comment-editor #quoteAdminCommentText{
  min-height:110px;
  max-height:220px;
}
.quote-admin-comment-actions{
  position:sticky;
  bottom:0;
  z-index:5;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  margin-top:8px;
  padding:10px 0 8px;
  background:linear-gradient(180deg,rgba(255,255,255,.94),#fff 28%);
  border-top:1px solid #eef2f7;
}
.quote-admin-comment-actions .btn-outline,
.quote-admin-comment-actions .btn-primary{
  min-height:36px;
}
#entityModal .entity-form:has(.quote-admin-comment-editor){
  padding-bottom:18px!important;
  overscroll-behavior:contain;
}
@media(max-height:650px){
  .quote-admin-comment-editor #quoteAdminCommentText{min-height:90px;max-height:140px}
  .quote-admin-comment-actions{padding-bottom:12px}
}

.quote-admin-comment-edit{border:0;background:transparent;color:#2563eb;font-size:10px;font-weight:800;padding:2px 5px;border-radius:6px;cursor:pointer;display:inline-flex;align-items:center;gap:4px}.quote-admin-comment-edit:hover{background:#dbeafe;color:#1d4ed8}.quote-admin-comment-head .quote-admin-comment-edit+span{margin-left:auto}


/* V733 - Paginación ligera de Solicitud de Cotización */
#cotizInfo{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:12px!important;padding:10px 14px!important;color:#334155!important;font-size:12px!important}
.cotiz-page-info{white-space:nowrap}.cotiz-pager{display:inline-flex;align-items:center;gap:7px}.cotiz-pager button{width:30px;height:30px;border:1px solid #dbe4f0;border-radius:8px;background:#fff;color:#2563eb;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.cotiz-pager button:hover:not(:disabled){background:#eef4ff}.cotiz-pager button:disabled{opacity:.35;cursor:not-allowed}.cotiz-pager span{min-width:48px;text-align:center;font-weight:700;color:#475569}

#attendanceAdminPermissionBtn{border:1px solid #f59e0b;background:#fff7ed;color:#9a3412;border-radius:9px;padding:8px 11px;font-weight:800;cursor:pointer;display:inline-flex;align-items:center;gap:7px}#attendanceAdminPermissionBtn:hover{background:#ffedd5}

/* === Órdenes de Compra: editor HTML profesional de correo === */
.order-detail-head-actions{display:flex;align-items:center;gap:10px}.order-email-html-btn{white-space:nowrap}
.order-email-modal-box{width:min(96vw,1480px)!important;max-width:1480px!important;height:min(92vh,980px);display:flex;flex-direction:column;overflow:hidden}.order-email-modal-hdr{flex:0 0 auto}.order-email-modal-hdr h2{display:flex;align-items:center;gap:9px}.order-email-modal-hdr p{margin:5px 0 0;color:#64748b}.order-email-workspace{padding:18px;overflow:auto;background:#f6f8fc;flex:1}.order-email-toolbar-card,.order-email-test-card{background:#fff;border:1px solid #dbe4ef;border-radius:14px;padding:16px;box-shadow:0 5px 16px rgba(15,23,42,.04)}.order-email-toolbar-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px 16px;align-items:end}.order-email-toolbar-card .full{margin:0}.order-email-toolbar-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.order-email-meta{grid-column:1/-1;display:flex;gap:18px;flex-wrap:wrap;color:#64748b;font-size:12px;padding-top:4px}.order-email-meta i{color:#2563eb;margin-right:4px}.order-email-editor-grid{display:grid;grid-template-columns:minmax(420px,.9fr) minmax(520px,1.1fr);gap:16px;margin-top:16px}.order-email-code-panel,.order-email-preview-panel{background:#fff;border:1px solid #dbe4ef;border-radius:14px;overflow:hidden;min-height:560px}.order-email-panel-title{height:48px;padding:0 14px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #e5e7eb;background:#fbfdff;font-weight:800;color:#0f172a}.order-email-panel-title small{font-weight:500;color:#64748b}.order-email-panel-title span{display:flex;align-items:center;gap:7px}.order-email-code-panel textarea{width:100%;height:560px;min-height:560px;border:0!important;border-radius:0!important;resize:vertical;padding:16px;background:#0f172a;color:#dbeafe;font-family:Consolas,'Courier New',monospace;font-size:12px;line-height:1.55;outline:none}.order-email-code-panel textarea[readonly]{background:#172033;color:#cbd5e1}.order-email-preview-panel iframe{width:100%;height:560px;border:0;background:#fff;display:block}.order-email-test-card{margin-top:16px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;align-items:center}.order-email-test-card h3{margin:0 0 5px;font-size:15px;display:flex;align-items:center;gap:7px}.order-email-test-card p{margin:0;color:#64748b;font-size:12px;line-height:1.5}.order-email-test-controls{display:flex;gap:8px;align-items:center}.order-email-test-controls input{min-width:310px}.order-email-toolbar-card input[readonly]{background:#f8fafc;color:#334155}
@media(max-width:1100px){.order-email-editor-grid{grid-template-columns:1fr}.order-email-toolbar-card,.order-email-test-card{grid-template-columns:1fr}.order-email-test-controls{flex-wrap:wrap}.order-email-test-controls input{min-width:0;flex:1}.order-email-modal-box{height:94vh}}
@media(max-width:720px){.order-detail-head-actions{gap:6px}.order-email-html-btn{font-size:0;padding:10px}.order-email-html-btn i{font-size:14px}.order-email-workspace{padding:10px}.order-email-test-controls{display:grid;grid-template-columns:1fr}.order-email-editor-grid{grid-template-columns:1fr}.order-email-code-panel,.order-email-preview-panel{min-height:430px}.order-email-code-panel textarea,.order-email-preview-panel iframe{height:430px;min-height:430px}}


/* === V747 Configuración global de correo de Órdenes === */
.order-email-config-box{width:min(1500px,96vw);max-width:1500px;height:min(900px,92vh);display:flex;flex-direction:column;overflow:hidden}
.order-email-config-box .modal-hdr{flex:0 0 auto}.order-email-config-grid{display:grid;grid-template-columns:minmax(520px,1fr) minmax(520px,1fr);gap:18px;padding:18px;overflow:auto;flex:1;background:#f8fafc}
.order-email-config-editor,.order-email-config-preview{background:#fff;border:1px solid #dbe4ef;border-radius:16px;padding:18px;min-width:0}.order-email-config-html{width:100%;min-height:420px;resize:vertical;font-family:Consolas,Monaco,monospace;font-size:12px;line-height:1.55;white-space:pre;border:1px solid #cbd5e1;border-radius:12px;padding:14px}
.order-email-config-preview{display:flex;flex-direction:column}.order-email-preview-title{font-weight:800;margin-bottom:10px;color:#0f172a}.order-email-config-preview iframe{width:100%;min-height:650px;flex:1;border:1px solid #dbe4ef;border-radius:12px;background:#eef3f9}
.order-email-token-help{font-size:12px;line-height:1.6;color:#475569;background:#eff6ff;border:1px solid #bfdbfe;border-radius:10px;padding:10px 12px;margin:10px 0}.order-email-token-help span{color:#64748b}.order-email-config-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;margin-top:12px}
.order-email-test-box{margin-top:18px;border-top:1px solid #e2e8f0;padding-top:16px}.order-email-test-box h3{margin:0 0 12px}.order-email-test-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.order-email-test-box small{display:block;margin-top:8px;color:#64748b}
@media(max-width:1050px){.order-email-config-grid{grid-template-columns:1fr}.order-email-config-preview iframe{min-height:520px}}
/* V755 Dispositivos vinculados */
#lpwDevicesOverlay{position:fixed;inset:0;background:rgba(15,23,42,.68);z-index:1000000;display:grid;place-items:center;padding:20px}.lpwd-head{display:flex;align-items:center;justify-content:space-between;padding:20px 22px;border-bottom:1px solid #e5e7eb}.lpwd-head b{font-size:20px;color:#10233f}.lpwd-head small{display:block;color:#64748b;margin-top:3px}.lpwd-head button{border:0;background:#f1f5f9;width:34px;height:34px;border-radius:10px;font-size:20px;cursor:pointer}#lpwDevicesModal{width:min(900px,96vw);max-height:88vh;overflow:auto;background:#fff;border-radius:20px;box-shadow:0 25px 80px #0005}.lpwd-body{padding:20px}.lpwd-summary{background:#eff6ff;border:1px solid #bfdbfe;border-radius:14px;padding:14px 16px;color:#1e3a8a;margin-bottom:18px}.lpwd-summary small{display:block;margin-top:4px;color:#64748b}.lpwd-section{border:1px solid #e2e8f0;border-radius:16px;padding:14px;margin-top:14px}.lpwd-title{font-weight:800;color:#10233f;margin:2px 0 12px}.lpwd-row{display:grid;grid-template-columns:42px minmax(0,1fr) auto auto;gap:12px;align-items:center;padding:11px 8px;border-top:1px solid #eef2f7}.lpwd-row:first-of-type{border-top:0}.lpwd-icon{width:38px;height:38px;border-radius:12px;display:grid;place-items:center}.lpwd-icon.phone{background:#ecfdf3;color:#059669}.lpwd-icon.pc{background:#eff6ff;color:#2563eb}.lpwd-main b,.lpwd-main small{display:block}.lpwd-main small{color:#64748b;margin-top:3px}.lpwd-state{font-size:12px;font-weight:800;padding:6px 9px;border-radius:999px;white-space:nowrap}.lpwd-state.on{background:#dcfce7;color:#15803d}.lpwd-state.off{background:#fee2e2;color:#b91c1c}.lpwd-state.none{background:#f1f5f9;color:#64748b}.lpwd-codebtn,.lpwd-secondary,.lpwd-primary{border:0;border-radius:10px;padding:9px 12px;font-weight:800;cursor:pointer}.lpwd-codebtn,.lpwd-primary{background:#2563eb;color:#fff}.lpwd-secondary{background:#eef2ff;color:#1d4ed8;margin-top:12px}.lpwd-center{text-align:center}.lpwd-code{font-size:46px;letter-spacing:9px;font-weight:900;background:#0b3b86;color:white;border-radius:16px;padding:18px;margin:20px auto;max-width:350px}.lpwd-bigico{font-size:34px;color:#2563eb}.lpwd-primary{display:block;margin:20px auto 0}.lpwd-empty{padding:16px;color:#64748b;background:#f8fafc;border-radius:12px}.lpwd-error{padding:16px;background:#fff1f2;color:#be123c;border-radius:12px}.lpwd-loading{padding:30px;text-align:center;color:#64748b}@media(max-width:700px){.lpwd-row{grid-template-columns:40px 1fr}.lpwd-state,.lpwd-codebtn{grid-column:2}.header-right #lpwCallTopStatus .lpw-call-top-label{display:none}}

/* V756 ADMIN tambien puede vincular sus propios dispositivos */
.lpwd-row.lpwd-own{background:#f8fbff;border-radius:12px;padding-left:10px;padding-right:10px}.lpwd-me{font-size:10px;color:#2563eb;background:#eff6ff;border:1px solid #bfdbfe;border-radius:999px;padding:2px 7px;margin-left:6px;vertical-align:middle}

/* V758 - descargas de instaladores en Dispositivos vinculados */
.lpwd-title-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.lpwd-title-actions>span{display:inline-flex;align-items:center;gap:5px}
.lpwd-download{display:inline-flex;align-items:center;justify-content:center;gap:7px;text-decoration:none!important;background:#2563eb;color:#fff!important;border:0;border-radius:10px;padding:9px 13px;font-size:12px;font-weight:800;line-height:1.15;box-shadow:0 4px 10px rgba(37,99,235,.18);cursor:pointer}
.lpwd-download:hover{filter:brightness(.96);transform:translateY(-1px)}
.lpwd-download.secondary{background:#eff6ff;color:#1d4ed8!important;border:1px solid #bfdbfe;box-shadow:none}
.lpwd-download-note{font-size:11px;color:#64748b;margin:-2px 0 10px 27px}
.lpwd-section-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:10px}
@media(max-width:640px){.lpwd-title-actions{align-items:flex-start}.lpwd-download{width:100%}.lpwd-download-note{margin-left:0}.lpwd-section-actions>*{width:100%}}

/* =========================================================
   SIDEBAR CATEGORIZADO / PLEGABLE v838
   ========================================================= */
.sidebar-nav.lpw-categorized-nav{gap:7px;padding:8px 8px 12px;}
.lpw-nav-category{display:block;border-radius:10px;overflow:visible;}
.lpw-category-toggle{
  width:100%;height:30px;border:0;background:transparent;color:#7f90ad;cursor:pointer;
  display:flex;align-items:center;justify-content:space-between;padding:4px 8px;
  font:700 9.5px/1 Inter,system-ui,sans-serif;letter-spacing:1.05px;text-transform:uppercase;
  border-radius:8px;transition:background .18s ease,color .18s ease;
}
.lpw-category-toggle:hover{background:rgba(255,255,255,.05);color:#b8c7df;}
.lpw-category-left{display:flex;align-items:center;gap:7px;min-width:0;}
.lpw-category-left>i{width:14px;text-align:center;font-size:10px;opacity:.9;}
.lpw-category-chevron{font-size:9px;transition:transform .2s ease;}
.lpw-nav-category.is-collapsed .lpw-category-chevron{transform:rotate(-90deg);}
.lpw-category-body{display:flex;flex-direction:column;gap:2px;}
.lpw-nav-category.is-collapsed .lpw-category-body{display:none;}
.lpw-recent-shortcuts{display:flex;flex-direction:column;gap:2px;margin-top:2px;}
.lpw-recent-link{position:relative;}
.lpw-recent-link::before{content:"";position:absolute;left:4px;top:50%;width:3px;height:3px;border-radius:50%;background:#60a5fa;opacity:.75;transform:translateY(-50%);}
.lpw-categorized-nav .nav-link{min-height:36px;}
.lpw-categorized-nav .nav-link .nav-ico{flex:0 0 22px;}

/* Sidebar general plegado: conservar solo iconos de categorías y módulos. */
body.sidebar-collapsed .lpw-category-toggle,
.sidebar.lpw-sidebar-collapsed-final .lpw-category-toggle,
.sidebar.lpw-left-collapsed .lpw-category-toggle{
  justify-content:center;padding:4px 0;height:28px;
}
body.sidebar-collapsed .lpw-category-left span,
body.sidebar-collapsed .lpw-category-chevron,
.sidebar.lpw-sidebar-collapsed-final .lpw-category-left span,
.sidebar.lpw-sidebar-collapsed-final .lpw-category-chevron,
.sidebar.lpw-left-collapsed .lpw-category-left span,
.sidebar.lpw-left-collapsed .lpw-category-chevron{display:none!important;}
body.sidebar-collapsed .lpw-category-left,
.sidebar.lpw-sidebar-collapsed-final .lpw-category-left,
.sidebar.lpw-left-collapsed .lpw-category-left{justify-content:center;gap:0;}
body.sidebar-collapsed .lpw-category-left>i,
.sidebar.lpw-sidebar-collapsed-final .lpw-category-left>i,
.sidebar.lpw-left-collapsed .lpw-category-left>i{font-size:11px;width:20px;}

@media(max-width:900px){
  .lpw-category-toggle{height:32px;}
}

/* SIDEBAR v840: ocultar elementos que no deben verse */
.sidebar .nav-link[data-page="correo"],
.sidebar .nav-link[data-page="licitaciones"],
.sidebar > .nav-section{display:none!important;}

/* LAPROWORLD UI v846 fallback: active dashboard generated as #gerencialPBI281 */
body.lpw-ui-v846 #gerencialPBI281 .pbi281-header{border-radius:16px!important}
body.lpw-ui-v846 #gerencialPBI281 .pbi281-kpi{border-radius:15px!important}
body.lpw-ui-v846 #gerencialPBI281 .pbi281-card{border-radius:15px!important}

/* ===== v851 responsive header/dashboard fix ===== */
.main,
.header,
.content,
#page-dashboard,
#gerencialPBI281{
  min-width:0;
}

.header{
  overflow:visible;
}

.header-left{
  min-width:0;
  flex:0 1 auto;
}

.global-search{
  flex:0 1 420px;
  width:clamp(220px,28vw,420px);
  max-width:100%;
  min-width:190px;
}

.header-right{
  min-width:0;
  flex:0 1 auto;
}

.header-right > *{
  flex-shrink:0;
}

.hdr-datetime{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-width:76px;
}

@media (max-width:1760px){
  .header{
    height:auto !important;
    min-height:var(--header-h);
    padding:8px 14px !important;
    gap:10px !important;
    flex-wrap:wrap;
    align-items:center;
  }

  .header-left{
    flex:0 1 auto !important;
  }

  .global-search{
    flex:1 1 320px !important;
    width:auto !important;
    min-width:220px !important;
    order:2;
  }

  .header-right{
    width:100%;
    flex:1 1 100% !important;
    display:flex !important;
    flex-wrap:wrap !important;
    justify-content:flex-start !important;
    gap:8px !important;
    order:3;
  }

  .hdr-profile{
    margin-left:auto;
  }

  .btn-new,
  .btn-map-clientes,
  .btn-alertas-global,
  .btn-whatsapp-top,
  .btn-correo-top,
  #lpwCallTopStatus{
    padding:8px 12px;
    font-size:12px;
  }

  .content{
    padding:20px !important;
  }
}

@media (max-width:1450px){
  .global-search{
    flex:1 1 100% !important;
    max-width:none !important;
    width:100% !important;
    order:3;
  }

  .header-right{
    order:4;
  }

  .header-right .btn-new,
  .header-right .btn-map-clientes,
  .header-right .btn-alertas-global,
  #lpwCallTopStatus{
    padding:8px 10px;
    gap:6px;
  }

  .header-right .btn-new span,
  .header-right .btn-map-clientes span,
  .header-right .btn-alertas-global span,
  #lpwCallTopStatus .lpw-call-top-label{
    white-space:nowrap;
  }
}

@media (max-width:1220px){
  .header-right .btn-new span,
  .header-right .btn-map-clientes span,
  .header-right .btn-alertas-global span,
  #lpwCallTopStatus .lpw-call-top-label,
  .hdr-profile-info,
  .hdr-profile-caret{
    display:none !important;
  }

  .btn-new,
  .btn-map-clientes,
  .btn-alertas-global,
  #lpwCallTopStatus,
  .hdr-profile{
    padding:8px 10px !important;
  }
}

@media (max-width:900px){
  .header{
    padding:8px 12px !important;
  }

  .breadcrumb{
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .header-right{
    justify-content:flex-start !important;
  }
}

/* ===== v852: quitar buscador global del header ===== */
.header > .global-search,
.header .global-search{
  display:none !important;
}
.header-left{
  flex:1 1 auto !important;
}
.header-right{
  margin-left:auto;
}

/* ===== v853: header desktop realmente responsive (80/90/100% zoom) ===== */
@media (min-width:1101px){
  .header{
    height:64px !important;
    min-height:64px !important;
    padding:0 clamp(10px,1.2vw,20px) !important;
    gap:clamp(6px,.65vw,12px) !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    overflow:visible !important;
  }

  .header-left{
    flex:1 1 auto !important;
    min-width:90px !important;
    max-width:220px !important;
    order:initial !important;
  }

  .breadcrumb{
    min-width:0 !important;
    max-width:100% !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
  }

  .header-right{
    width:auto !important;
    flex:0 1 auto !important;
    min-width:0 !important;
    margin-left:auto !important;
    display:flex !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    justify-content:flex-end !important;
    gap:clamp(5px,.48vw,9px) !important;
    order:initial !important;
    overflow:visible !important;
  }

  .header-right > *{
    flex:0 0 auto !important;
    min-width:0 !important;
  }

  .hdr-datetime{
    min-width:72px !important;
    max-width:82px !important;
    font-size:11px !important;
    line-height:1.15 !important;
  }

  .hdr-btn{
    width:34px !important;
    height:34px !important;
  }

  .header-right .btn-new,
  .header-right .btn-map-clientes,
  .header-right .btn-alertas-global,
  .header-right .btn-whatsapp-top,
  .header-right .btn-correo-top,
  #lpwCallTopStatus{
    min-height:36px !important;
    padding:7px clamp(8px,.65vw,12px) !important;
    gap:6px !important;
    border-radius:9px !important;
    font-size:clamp(10.5px,.72vw,12.5px) !important;
    white-space:nowrap !important;
  }

  .hdr-profile{
    margin-left:0 !important;
    padding:4px 8px !important;
    gap:7px !important;
    white-space:nowrap !important;
  }

  .hdr-profile-name{font-size:11px !important}
  .hdr-profile-role{font-size:9px !important}
  .hdr-avatar-pro,.hdr-profile .user-avatar{width:34px !important;height:34px !important;flex-basis:34px !important}
}

/* En laptops/viewport efectivo estrecho, compactar sin crear una segunda fila */
@media (min-width:1101px) and (max-width:1500px){
  .header-left{max-width:150px !important}
  .header{padding-left:10px !important;padding-right:10px !important}
  .header-right{gap:5px !important}
  .header-right .btn-new,
  .header-right .btn-map-clientes,
  .header-right .btn-alertas-global,
  .header-right .btn-whatsapp-top,
  .header-right .btn-correo-top,
  #lpwCallTopStatus{padding-left:8px !important;padding-right:8px !important;font-size:10.5px !important}
  .hdr-profile{padding-left:5px !important;padding-right:5px !important}
}

@media (min-width:1101px) and (max-width:1320px){
  .header-left{max-width:110px !important}
  .breadcrumb span:first-child{display:none !important}
  .hdr-datetime{min-width:62px !important;max-width:66px !important;font-size:9.5px !important}
  .header-right .btn-new span,
  .header-right .btn-map-clientes span,
  .header-right .btn-alertas-global span,
  .header-right .btn-whatsapp-top span,
  .header-right .btn-correo-top span,
  #lpwCallTopStatus .lpw-call-top-label{
    display:none !important;
  }
  .header-right .btn-new,
  .header-right .btn-map-clientes,
  .header-right .btn-alertas-global,
  .header-right .btn-whatsapp-top,
  .header-right .btn-correo-top,
  #lpwCallTopStatus{
    width:36px !important;
    height:36px !important;
    min-width:36px !important;
    padding:0 !important;
    justify-content:center !important;
  }
  .hdr-profile-info,.hdr-profile-caret{display:none !important}
}

/* Tablet/móvil: permitir reflujo controlado, nunca overflow horizontal */
@media (max-width:1100px){
  .header{
    height:auto !important;
    min-height:58px !important;
    padding:8px 10px !important;
    gap:7px !important;
    flex-wrap:wrap !important;
  }
  .header-left{flex:1 1 auto !important;min-width:0 !important}
  .header-right{
    width:100% !important;
    margin-left:0 !important;
    display:flex !important;
    flex-wrap:wrap !important;
    justify-content:flex-start !important;
    gap:6px !important;
  }
  .hdr-profile{margin-left:auto !important}
}

html,body{max-width:100%;overflow-x:hidden}

/* =========================================================
   V854 - SOLICITUD DE COTIZACIÓN RESPONSIVE (90% / 100%)
   Evita que Observaciones se comprima letra por letra.
   ========================================================= */
#page-cotizaciones,
#page-cotizaciones .table-card,
#page-cotizaciones .table-wrap{
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}

#page-cotizaciones .table-wrap{
  overflow-x:auto!important;
  overflow-y:visible!important;
  -webkit-overflow-scrolling:touch;
}

#page-cotizaciones .quote-observation{
  min-width:0!important;
  width:100%!important;
  white-space:normal!important;
  overflow-wrap:break-word!important;
  word-break:normal!important;
  line-height:1.4!important;
}

#page-cotizaciones .quote-actions-inline{
  min-width:0!important;
  max-width:100%!important;
}

/* Desktop / laptop: conservar tabla, pero dar prioridad a Observaciones. */
@media (min-width:701px) and (max-width:1500px){
  #page-cotizaciones .data-table{
    width:100%!important;
    min-width:920px!important;
    table-layout:fixed!important;
  }

  #page-cotizaciones .data-table th:nth-child(1),
  #page-cotizaciones .data-table td:nth-child(1){
    width:70px!important;
    min-width:70px!important;
    max-width:70px!important;
  }

  #page-cotizaciones .data-table th:nth-child(2),
  #page-cotizaciones .data-table td:nth-child(2){
    width:235px!important;
    min-width:235px!important;
    max-width:235px!important;
  }

  #page-cotizaciones .data-table th:nth-child(3),
  #page-cotizaciones .data-table td:nth-child(3){
    width:105px!important;
    min-width:105px!important;
    max-width:105px!important;
  }

  #page-cotizaciones .data-table th:nth-child(4),
  #page-cotizaciones .data-table td:nth-child(4){
    width:auto!important;
    min-width:290px!important;
    max-width:none!important;
  }

  #page-cotizaciones .data-table th:nth-child(5),
  #page-cotizaciones .data-table td:nth-child(5){
    width:100px!important;
    min-width:100px!important;
    max-width:100px!important;
  }

  #page-cotizaciones .data-table th:nth-child(6),
  #page-cotizaciones .data-table td:nth-child(6){
    width:110px!important;
    min-width:110px!important;
    max-width:110px!important;
  }

  #page-cotizaciones .quote-observation-line{
    display:block!important;
    width:100%!important;
  }

  #page-cotizaciones .quote-actions-inline{
    display:flex!important;
    flex-wrap:wrap!important;
    justify-content:flex-start!important;
    gap:7px!important;
    width:100%!important;
    margin-top:8px!important;
  }

  #page-cotizaciones .quote-actions-inline .mini-btn{
    min-width:0!important;
    width:auto!important;
    height:32px!important;
    padding:7px 10px!important;
    font-size:10.5px!important;
    white-space:nowrap!important;
  }

  #page-cotizaciones .quote-request-meta{
    gap:5px!important;
  }

  #page-cotizaciones .quote-request-meta > span{
    font-size:9.5px!important;
    padding:3px 6px!important;
  }

  #page-cotizaciones .quote-org-name{
    -webkit-line-clamp:3!important;
    max-height:3.66em!important;
  }
}

/* Ventanas más estrechas: la tabla puede desplazarse horizontalmente,
   pero nunca comprime el texto verticalmente. */
@media (min-width:701px) and (max-width:1150px){
  #page-cotizaciones .data-table{
    min-width:960px!important;
  }
  #page-cotizaciones .table-wrap{
    scrollbar-gutter:stable;
  }
}

/* Móvil: mantener el layout de tarjetas existente sin forzar min-width. */
@media (max-width:700px){
  #page-cotizaciones .data-table{
    min-width:0!important;
  }
  #page-cotizaciones .table-wrap{
    overflow-x:hidden!important;
  }
  #page-cotizaciones .quote-observation{
    word-break:normal!important;
    overflow-wrap:anywhere!important;
  }
}

/* =========================================================
   V855 - FIX DEFINITIVO OBSERVACIONES EN SOLICITUD DE COTIZACIÓN
   En 90%/100% no se comprime la columna ni se apila letra por letra.
   Si falta ancho, la tabla conserva proporciones y usa scroll horizontal.
   ========================================================= */
@media (min-width:701px){
  #page-cotizaciones .table-wrap{
    overflow-x:auto!important;
    overflow-y:visible!important;
    max-width:100%!important;
  }

  #page-cotizaciones .data-table{
    width:100%!important;
    min-width:1280px!important;
    table-layout:auto!important;
  }

  #page-cotizaciones .data-table th,
  #page-cotizaciones .data-table td{
    box-sizing:border-box!important;
  }

  #page-cotizaciones .data-table th:nth-child(1),
  #page-cotizaciones .data-table td:nth-child(1){
    width:82px!important;
    min-width:82px!important;
    max-width:82px!important;
  }

  #page-cotizaciones .data-table th:nth-child(2),
  #page-cotizaciones .data-table td:nth-child(2){
    width:300px!important;
    min-width:300px!important;
    max-width:300px!important;
  }

  #page-cotizaciones .data-table th:nth-child(3),
  #page-cotizaciones .data-table td:nth-child(3){
    width:130px!important;
    min-width:130px!important;
    max-width:130px!important;
  }

  #page-cotizaciones .data-table th:nth-child(4),
  #page-cotizaciones .data-table td:nth-child(4){
    width:540px!important;
    min-width:540px!important;
    max-width:540px!important;
  }

  #page-cotizaciones .data-table th:nth-child(5),
  #page-cotizaciones .data-table td:nth-child(5){
    width:125px!important;
    min-width:125px!important;
    max-width:125px!important;
  }

  #page-cotizaciones .data-table th:nth-child(6),
  #page-cotizaciones .data-table td:nth-child(6){
    width:125px!important;
    min-width:125px!important;
    max-width:125px!important;
  }

  #page-cotizaciones .quote-main-cell{
    width:540px!important;
    min-width:540px!important;
    max-width:540px!important;
    white-space:normal!important;
    overflow:visible!important;
  }

  #page-cotizaciones .quote-observation-line{
    display:grid!important;
    grid-template-columns:minmax(180px,1fr) auto!important;
    align-items:center!important;
    gap:10px!important;
    width:100%!important;
    min-width:0!important;
  }

  #page-cotizaciones .quote-observation{
    display:block!important;
    width:auto!important;
    min-width:180px!important;
    max-width:100%!important;
    white-space:normal!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    hyphens:none!important;
    line-height:1.35!important;
  }

  #page-cotizaciones .quote-actions-inline{
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:7px!important;
    width:auto!important;
    min-width:250px!important;
    max-width:330px!important;
    margin-top:0!important;
  }

  #page-cotizaciones .quote-files,
  #page-cotizaciones .quote-request-meta,
  #page-cotizaciones .reject-box{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
}

@media (min-width:701px) and (max-width:1180px){
  #page-cotizaciones .data-table{
    min-width:1180px!important;
  }
  #page-cotizaciones .data-table th:nth-child(4),
  #page-cotizaciones .data-table td:nth-child(4),
  #page-cotizaciones .quote-main-cell{
    width:460px!important;
    min-width:460px!important;
    max-width:460px!important;
  }
  #page-cotizaciones .quote-observation-line{
    grid-template-columns:minmax(160px,1fr) auto!important;
  }
  #page-cotizaciones .quote-actions-inline{
    min-width:235px!important;
    max-width:290px!important;
  }
}

/* ===== v856 · Solicitud de Cotización: botones siempre en una sola fila ===== */
@media (min-width:701px){
  #page-cotizaciones .data-table{
    min-width:1320px !important;
  }

  #page-cotizaciones .data-table th:nth-child(4),
  #page-cotizaciones .data-table td:nth-child(4),
  #page-cotizaciones .quote-main-cell{
    width:650px !important;
    min-width:650px !important;
    max-width:650px !important;
  }

  #page-cotizaciones .quote-observation-line{
    display:grid !important;
    grid-template-columns:minmax(190px,1fr) max-content !important;
    align-items:center !important;
    gap:10px !important;
    width:100% !important;
  }

  #page-cotizaciones .quote-actions-inline{
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    justify-content:flex-start !important;
    gap:7px !important;
    width:max-content !important;
    min-width:max-content !important;
    max-width:none !important;
    white-space:nowrap !important;
  }

  #page-cotizaciones .quote-actions-inline .mini-btn,
  #page-cotizaciones .quote-actions-inline [data-ai-quote-process]{
    flex:0 0 auto !important;
    width:auto !important;
    min-width:auto !important;
    height:34px !important;
    padding:7px 10px !important;
    font-size:11px !important;
    white-space:nowrap !important;
  }
}


/* =========================================================
   CHAT V3 - LISTA DE PERSONAS + CONVERSACIÓN PRIVADA
   ========================================================= */
.chat-panel{
  width:390px!important;
  height:560px!important;
  max-width:calc(100vw - 28px)!important;
  border-radius:16px!important;
}
.chat-panel-head{
  min-height:68px!important;
  padding:14px 18px!important;
  background:#fff!important;
  color:#111827!important;
  border-bottom:1px solid #e5e7eb!important;
}
.chat-panel-head h3{font-size:18px!important;color:#111827!important}
.chat-panel-head p{font-size:12px!important;color:#6b7280!important;opacity:1!important}
.chat-close{background:transparent!important;color:#a100ff!important;font-size:22px!important}
.chat-body{display:block!important;position:relative!important;flex:1!important;min-height:0!important}
.chat-users,.chat-room{position:absolute!important;inset:0!important;width:100%!important;height:100%!important}
.chat-users{
  display:flex!important;
  border:0!important;
  background:#fff!important;
}
.chat-room{
  display:none!important;
  background:#fff!important;
}
.chat-panel.chat-room-mode .chat-users{display:none!important}
.chat-panel.chat-room-mode .chat-room{display:flex!important}
.chat-panel.chat-list-mode .chat-users{display:flex!important}
.chat-panel.chat-list-mode .chat-room{display:none!important}
.chat-search{
  margin:0!important;
  padding:0 18px!important;
  height:52px!important;
  border:0!important;
  border-bottom:1px solid #e5e7eb!important;
  border-radius:0!important;
}
.chat-conversation-list{padding:8px 10px 14px!important;overflow-y:auto!important}
.chat-user{padding:10px 8px!important;border-radius:12px!important;gap:12px!important}
.chat-user:hover,.chat-user.active{background:#f3f4f6!important}
.chat-user .chat-avatar{width:42px!important;height:42px!important;flex:0 0 42px!important}
.chat-user-main b{font-size:15px!important;font-weight:700!important}
.chat-user-main small{font-size:11.5px!important}
.chat-room-head{height:66px!important;flex:0 0 66px!important;padding:0 14px!important;background:#fff!important}
.chat-back{width:34px!important;height:34px!important;border:0!important;border-radius:50%!important;background:#f3f4f6!important;color:#2563eb!important;display:flex!important;align-items:center!important;justify-content:center!important;cursor:pointer!important;flex:0 0 34px!important}
.chat-room-head .chat-avatar{width:40px!important;height:40px!important;flex:0 0 40px!important}
.chat-room-head b{font-size:14px!important}
.chat-messages{background:#fff!important;padding:14px!important}
.chat-input-row{height:64px!important;flex:0 0 64px!important}
.chat-empty-head{display:none!important}
@media(max-width:520px){
  .chat-panel{right:8px!important;left:auto!important;width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important;height:72vh!important;bottom:84px!important}
}

/* Orden de compra: edición por ADMIN/SUPERVISOR */
.order-detail-header-actions{display:flex;align-items:center;gap:10px;margin-left:auto}
.order-edit-btn{height:36px!important;padding:0 14px!important;border-radius:10px!important;display:inline-flex!important;align-items:center!important;gap:7px!important;font-size:12px!important;font-weight:800!important;white-space:nowrap!important}
.order-edit-form .form-field label{font-weight:800!important;color:#334155!important}
@media(max-width:700px){.order-detail-header-actions{gap:6px}.order-edit-btn{padding:0 10px!important}.order-edit-btn{font-size:0!important}.order-edit-btn i{font-size:13px!important}}
