/* ===== Base ===== */
:root{
  --bg: #eef3f8;
  --card: #ffffff;
  --border: #e7edf4;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --sidebar:#101728;
  --accent:#4f8cff;
}

.bg-dash{
  background: radial-gradient(1200px 600px at 10% -10%, #cfe3ff33, transparent 60%),
              radial-gradient(1200px 600px at 90% -10%, #c9ffe533, transparent 60%),
              var(--bg);
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.dash-sidebar{
  width: 82px;
  min-height: 100vh;
  background: var(--sidebar);
  color: #cdd6ff;
  box-shadow: inset -1px 0 0 rgba(255,255,255,.04);
  transition: width .25s ease;
  overflow: hidden;
}
.dash-sidebar:hover{ width: 220px; }
.dash-brand{
  padding:0 12px;
  color:#fff;
}
.dash-brand .brand-logo{
  flex-shrink:0;
  width:44px;
  height:44px;
  border-radius:12px;
}
.dash-brand .brand-name{
  font-weight:700;
  font-size:1.05rem;
  opacity:0;
  max-width:0;
  white-space:nowrap;
  overflow:hidden;
  transition: opacity .2s ease, max-width .25s ease;
}
.dash-sidebar:hover .brand-name,
.dash-brand:focus .brand-name{
  opacity:1;
  max-width:140px;
}
.sb-btn{
  color:#cdd6ff;
  border-radius:12px;
  margin: 2px 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:.75rem;
  padding:.65rem .75rem;
  transition: background .2s ease, color .2s ease;
}
.dash-sidebar:hover .sb-btn{ justify-content:flex-start; }
.sb-btn:hover{ background: rgba(255,255,255,.08); color:#fff; }
.sb-btn.active{ background:#5d6bff; color:#fff; }
.sb-label{
  font-size:.82rem;
  opacity:0;
  max-width:0;
  transition: opacity .2s ease, max-width .25s ease;
  overflow:hidden;
  white-space:nowrap;
}
.dash-sidebar:hover .sb-label{
  opacity:1;
  max-width:160px;
}
.sb-btn:focus .sb-label{
  opacity:1;
  max-width:160px;
}

/* ===== Topbar ===== */
.dash-topbar{
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  min-height: 76px;
  position:relative;
  z-index:1200;
}
.search-wrap .input-group-text{ background:#fff; border-right:0; }
.search-wrap .form-control{ border-left:0; }
.search-wrap{ flex:1 1 260px; max-width:360px; }
.topbar-actions{ min-width:0; }
.topbar-quick{ display:flex; align-items:center; gap:.5rem; }
.user-menu{
  position:relative;
  padding-bottom:4px;
  z-index:2000;
}
.user-menu::after{
  content:"";
  position:absolute;
  top:100%;
  left:-8px;
  width:calc(100% + 16px);
  height:16px;
  pointer-events:auto;
}
.user-menu-trigger{
  border:0;
  background:transparent;
  padding:0;
  display:grid;
  place-items:center;
  cursor:pointer;
  transition: transform .15s ease;
}
.user-menu-trigger:focus{
  outline:2px solid rgba(79,140,255,.4);
  outline-offset:4px;
}
.user-menu:hover .user-menu-trigger,
.user-menu:focus-within .user-menu-trigger{
  transform: scale(1.03);
}
.user-menu-panel{
  position:absolute;
  top:calc(100% + 6px);
  right:0;
  width:240px;
  max-width:calc(100vw - 2rem);
  background:#ffffff;
  border-radius:18px;
  box-shadow: var(--shadow);
  padding:1rem;
  opacity:0;
  visibility:hidden;
  transform:translateY(-8px);
  transition: opacity .18s ease, transform .18s ease;
  z-index:2200;
  pointer-events:none;
}
.user-menu-panel::before{
  content:"";
  position:absolute;
  top:-8px;
  right:22px;
  width:16px;
  height:16px;
  background:#ffffff;
  transform:rotate(45deg);
  box-shadow:-2px -2px 5px rgba(15, 23, 42, 0.05);
  pointer-events:none;
}
.user-menu:hover .user-menu-panel,
.user-menu:focus-within .user-menu-panel{
  opacity:1;
  visibility:visible;
  transform:translateY(0);
  pointer-events:auto;
}
.user-menu:hover,
.user-menu:focus-within{
  z-index:2000;
}
.user-menu-info{
  margin-bottom:.75rem;
}
.user-menu-info .name{
  font-weight:600;
  color:#0f172a;
}
.user-menu-info .email{
  font-size:.8rem;
  color:#64748b;
}
.user-menu-logout{
  margin:0;
}
.user-menu-logout .btn{
  border-radius:12px;
  font-weight:600;
}
.btn-logout{
  border:1px solid rgba(239,68,68,.4);
  background:rgba(239,68,68,.08);
  color:#dc2626;
}
.btn-logout:hover,
.btn-logout:focus{
  background:rgba(239,68,68,.12);
  border-color:rgba(239,68,68,.55);
  color:#b91c1c;
}
.dash-mobile-nav{
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.dash-mobile-nav .nav{ gap:.25rem; }
.mobile-link{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:.15rem;
  font-size:.75rem;
  padding:.6rem .4rem;
  border-radius:14px;
  color:#1c2b4a;
  background:transparent;
  transition: background .15s ease, color .15s ease;
}
.mobile-link i{ font-size:1.05rem; }
.mobile-link.active,
.mobile-link:hover{
  background:#e8f0ff;
  color:#355bff;
}
.flash-messages .alert{
  border-radius:14px;
  box-shadow: var(--shadow);
}
.btn-new-lead{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  padding:.45rem .95rem;
  border-radius:14px;
  background: linear-gradient(135deg, rgba(79,140,255,1) 0%, rgba(90,108,255,1) 100%);
  color:#fff;
  font-weight:600;
  font-size:.9rem;
  border:0;
  box-shadow:0 12px 24px rgba(85,120,248,.28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-new-lead:hover,
.btn-new-lead:focus{
  color:#fff;
  transform: translateY(-1px);
  box-shadow:0 16px 28px rgba(85,120,248,.32);
}
.btn-new-lead:active{
  transform: translateY(0);
  box-shadow:0 10px 20px rgba(85,120,248,.25);
}
.avatar-mini{
  width:34px; height:34px; display:grid; place-items:center;
  font-size:.75rem;
}

@media (max-width: 991.98px){
  .dash-topbar{
    padding-top:1rem;
    padding-bottom:1rem;
  }
  .topbar-actions{
    width:100%;
    justify-content:flex-start;
    gap:.75rem;
  }
  .search-wrap{
    flex:1 1 100%;
    max-width:none;
    order:-1;
  }
  .topbar-quick{
    width:100%;
    justify-content:flex-start;
    flex-wrap:wrap;
  }
}

@media (max-width: 575.98px){
  .topbar-title{
    width:100%;
  }
  .topbar-quick{
    width:100%;
    justify-content:space-between;
    gap:.35rem;
  }
  .dash-mobile-nav{
    position:sticky;
    top:0;
    z-index:1010;
  }
  .btn-new-lead span{
    display:none;
  }
  .btn-new-lead{
    padding:.45rem;
    border-radius:12px;
  }
  .avatar-mini{
    width:32px;
    height:32px;
    font-size:.7rem;
  }
}

/* ===== Cards de vidrio ===== */
.glass{ background: var(--card); box-shadow: var(--shadow); border-radius: 18px; }
.kpi-ico{
  width:46px; height:46px; border-radius:12px; display:grid; place-items:center; color:#fff; font-size:1.1rem;
}
.kpi-blue{ background:#3a86ff; }
.kpi-orange{ background:#ff9f1c; }
.kpi-green{ background:#2ec971; }
.kpi-purple{ background:#7a5af8; }

/* ===== Chart ===== */
.chart-wrap{ width:100%; overflow:hidden; }
.chart-svg{ width:100%; height:auto; display:block; }

/* ===== Donut ===== */
.donut-wrap{ width: 220px; }
.donut{ width:100%; height:auto; }
.legend .dot{
  display:inline-block; width:10px; height:10px; border-radius:99px; margin-right:6px;
}

/* ===== Tabla ===== */
.table > :not(caption) > * > *{ border-bottom-color: var(--border); }
.table-hover tbody tr:hover{ background:#f7faff; }

/* ===== Auth ===== */
.auth-bg{
  min-height:100vh;
  background: radial-gradient(1200px 600px at 10% -10%, #cfe3ff33, transparent 60%),
              radial-gradient(1200px 600px at 90% -10%, #c9ffe533, transparent 60%),
              var(--bg);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:2rem 1rem;
}
.auth-shell{
  width:min(960px, 100%);
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap:1.5rem;
  align-items:stretch;
}
.auth-brand-panel{
  background: linear-gradient(135deg, #0f172a, #3d4a77);
  color:#fff;
  border-radius:22px;
  padding:2.5rem 2rem;
  box-shadow: var(--shadow);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  min-height:100%;
}
.auth-brand-panel .auth-brand{
  align-items:flex-start;
}
.auth-brand-panel .auth-brand h1{
  color:#fff;
}
.brand-eyebrow{
  font-size:.75rem;
  letter-spacing:.18em;
  color:rgba(255,255,255,.7);
}
.brand-copy{
  font-size:.95rem;
  color:rgba(255,255,255,.85);
  margin-top:2rem;
}
.auth-card{
  width: min(440px, 100%);
  background: rgba(255,255,255,.92);
  border-radius:20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  padding:2.5rem 2rem;
}
.auth-brand{
  display:flex;
  align-items:center;
  gap:1rem;
  margin-bottom:2rem;
}
.auth-brand img{
  width:48px;
  height:48px;
  border-radius:14px;
  box-shadow:0 12px 24px rgba(79,140,255,.3);
}
.auth-brand h1{
  font-size:1.4rem;
  margin:0;
  font-weight:700;
  color:#101728;
}
.auth-card h2{
  font-weight:700;
  font-size:1.15rem;
}
.auth-card .form-label{
  color:#51607c;
  font-size:.8rem;
  letter-spacing:.02em;
}
.auth-card .form-control{
  border-radius:12px;
  padding:.65rem .9rem;
}
.auth-card .btn-primary{
  border-radius:14px;
  padding:.65rem 1.1rem;
  font-weight:600;
}
.auth-footer{
  margin-top:1.5rem;
  font-size:.85rem;
  color:#6b7a99;
}
.auth-footer a{
  color:var(--accent);
  font-weight:600;
}

/* ===== Offers list ===== */
.offers-hero .card-body{
  background: linear-gradient(125deg, rgba(255,126,46,.08), rgba(79,140,255,.08));
  border-radius: 14px;
}
.offers-toolbar .card-body{
  border-radius: 24px;
}
.offers-list{
  border-radius: 24px;
  overflow: hidden;
}
.offers-table{
  border-collapse:separate;
  border-spacing:0;
  width:100%;
}
.offers-table thead th{
  text-transform:uppercase;
  font-size:.75rem;
  letter-spacing:.08em;
  color:#94a3b8;
  font-weight:600;
  border-bottom:1px solid rgba(15,23,42,.08);
  padding:1.1rem 1.5rem;
  background:rgba(248,250,252,.85);
}
.offers-table tbody tr{
  transition:background .2s ease;
}
.offers-table tbody tr:hover{
  background:rgba(79,140,255,.04);
}
.offers-table td{
  padding:1.25rem 1.5rem;
  border-top:1px solid rgba(15,23,42,.05);
  color:#0f172a;
}
.offers-table td:first-child{
  min-width:220px;
}
.offer-name__title{
  font-weight:700;
  letter-spacing:.04em;
  color:#0f172a;
}
.offer-name__meta{
  font-size:.78rem;
  color:#94a3b8;
  margin-top:.15rem;
}
.offer-action{
  color:#2563eb;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:32px;
  height:32px;
  border-radius:999px;
  transition:background .2s ease,color .2s ease;
}
.offer-action:hover{
  background:rgba(37,99,235,.12);
  color:#1d4ed8;
}
.offer-actions{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.35rem;
}
.offer-action--pdf{
  border:1px solid rgba(15,23,42,.2);
  background:#ffffff;
  font-weight:700;
  font-size:.75rem;
  letter-spacing:.05em;
  text-transform:uppercase;
  padding:0 .9rem;
  width:auto;
  min-width:64px;
}
.offer-action--pdf:hover{
  background:#1d4ed8;
  color:#fff;
}
.offer-action--edit{
  font-size:1rem;
  color:#1d4ed8;
}
.offer-action--edit.disabled,
.offer-action--disabled{
  opacity:.35;
  pointer-events:none;
  cursor:not-allowed;
}
.status-bar{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:120px;
  padding:.25rem 1rem;
  border-radius:999px;
  font-weight:600;
  font-size:.75rem;
  color:#fff;
  letter-spacing:.08em;
  text-transform:uppercase;
  background:#94a3b8;
  box-shadow:0 6px 20px rgba(15,23,42,.15);
}
.status-bar.status-primary{
  background:#e0edff;
  color:#1e3a8a;
  border:1px solid rgba(59,130,246,.35);
  box-shadow:0 4px 14px rgba(59,130,246,.2);
}
.status-bar.status-info{
  background:#cff4fc;
  color:#055160;
  border:1px solid rgba(13,202,240,.35);
  box-shadow:0 4px 14px rgba(13,202,240,.2);
}
.status-bar.status-warning{ background:#fbbf24; color:#111; }
.status-bar.status-success{ background:#16a34a; color:#fff; }
.status-bar.status-danger{ background:#dc2626; color:#fff; }
.status-badge{
  display:inline-flex;
  align-items:center;
  padding:.2rem 1rem;
  border-radius:4px;
  font-weight:700;
  letter-spacing:.05em;
  color:#fff;
  background:#9ca3af;
}
.status-badge.status-primary{ background:#3b82f6; color:#fff; }
.status-badge.status-info{ background:#0dcaf0; color:#000; }
.status-badge.status-warning{ background:#f59e0b; color:#111; }
.status-badge.status-success{ background:#16a34a; color:#fff; }
.status-badge.status-danger{ background:#dc2626; color:#fff; }

.offer-card{
  padding: 1.5rem;
  border-bottom: 1px solid rgba(15,23,42,.08);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.offer-card:last-child{
  border-bottom: 0;
}
.offer-title{
  font-size: 1rem;
  letter-spacing: .05em;
  color:#ff6b00;
  font-weight:700;
}
.offer-meta{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(160px,1fr));
  gap:.75rem;
}
.status-pill{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  padding:.15rem .75rem;
  border-radius:999px;
  font-weight:600;
  font-size:.8rem;
  text-transform:uppercase;
  letter-spacing:.05em;
}
.status-primary{
  background:#cbd5f51f;
  color:#1e3a8a;
}
.status-info{
  background:#cff4fc1f;
  color:#055160;
}
.status-warning{
  background:#fbbf241f;
  color:#a16207;
}
.status-success{
  background:#22c55e1a;
  color:#14833d;
}
.status-danger{
  background:#f871711a;
  color:#b91c1c;
}
