/* ============================================
   CIEN — Portal de Ofertas | Estilos Globales
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:       #00c853;
  --green-dark:  #00a040;
  --green-light: #e8f5e9;
  --black:       #0d0d0d;
  --gray-900:    #1a1a1a;
  --gray-700:    #444;
  --gray-500:    #777;
  --gray-300:    #ccc;
  --gray-100:    #f5f5f5;
  --white:       #ffffff;
  --blue:        #1565c0;
  --orange:      #e65100;
  --purple:      #6a1b9a;
  --red:         #c62828;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.14);
  --radius:      12px;
  --radius-sm:   8px;
  --font:        'Inter', sans-serif;
}

body {
  font-family: var(--font);
  background: var(--gray-100);
  color: var(--black);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== SCREENS ===== */
.screen { min-height: 100vh; }
.screen.hidden { display: none !important; }
.screen.active { display: block; }

/* ===== LOGIN ===== */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(145deg, #0a1f0a 0%, #0d2e14 30%, #0a2218 60%, #061a0e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
/* Orbe superior derecha — destello verde brillante */
.login-bg::before {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,200,83,.22) 0%, rgba(0,160,64,.08) 45%, transparent 70%);
  top: -280px; right: -220px;
  pointer-events: none;
}
/* Orbe inferior izquierda — resplandor suave */
.login-bg::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,200,83,.14) 0%, transparent 65%);
  bottom: -160px; left: -140px;
  pointer-events: none;
}
/* Textura de puntos sobre el fondo */
#screen-login::before {
  content: '';
  position: fixed; inset: 0;
  background-image: radial-gradient(rgba(0,200,83,.07) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none; z-index: 0;
}

.login-card {
  background: rgba(13,27,18,.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0,200,83,.22);
  border-radius: 22px;
  padding: 48px 42px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 0 0 1px rgba(0,200,83,.06), 0 32px 64px rgba(0,0,0,.55), 0 8px 24px rgba(0,200,83,.08);
  position: relative;
  z-index: 1;
}
/* Línea verde superior de la card */
.login-card::before {
  content: '';
  position: absolute; top: 0; left: 10%; right: 10%; height: 2px;
  background: linear-gradient(90deg, transparent, #00c853 30%, #5aba1e 70%, transparent);
  border-radius: 0 0 2px 2px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(0,200,83,.15);
}
.logo-icon {
  width: 44px; height: 44px;
  background: var(--green);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  box-shadow: 0 4px 16px rgba(0,200,83,.4);
}
.logo-icon.sm { width: 32px; height: 32px; font-size: 14px; border-radius: 7px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-cien { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; color: #ffffff; }
.logo-by   { font-size: 11px; color: rgba(255,255,255,.45); font-weight: 500; }

.login-title    { font-size: 26px; font-weight: 700; margin-bottom: 6px; color: #ffffff; }
.login-subtitle { color: rgba(255,255,255,.5); margin-bottom: 32px; font-size: 13px; }

.login-form .form-group { margin-bottom: 20px; }
.login-form label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; margin-bottom: 7px;
  color: rgba(255,255,255,.75);
}
.login-form input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font);
  transition: border-color .2s, box-shadow .2s;
  background: rgba(255,255,255,.06);
  color: #ffffff;
}
.login-form input::placeholder { color: rgba(255,255,255,.28); }
.login-form input:focus {
  outline: none;
  border-color: var(--green);
  background: rgba(0,200,83,.07);
  box-shadow: 0 0 0 3px rgba(0,200,83,.15);
}
.field-hint { display: block; font-size: 11px; color: rgba(255,255,255,.35); margin-top: 4px; }
.input-eye { position: relative; }
.input-eye input { padding-right: 42px; }
.btn-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.35); padding: 4px;
}
.btn-eye:hover { color: var(--green); }

.login-info {
  display: flex; align-items: flex-start; gap: 8px;
  background: rgba(0,200,83,.07);
  border: 1px solid rgba(0,200,83,.18);
  border-radius: var(--radius-sm);
  padding: 12px 14px; margin-top: 20px; font-size: 12px;
  color: rgba(255,255,255,.5);
}
.login-info i { margin-top: 2px; color: var(--green); }
.login-footer { text-align: center; font-size: 11px; color: rgba(255,255,255,.25); margin-top: 24px; }

/* Alert error dentro del login dark */
#screen-login .alert-error {
  background: rgba(198,40,40,.15);
  color: #ff7070;
  border-color: rgba(198,40,40,.3);
}

/* ===== BUTTONS ===== */
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; font-family: var(--font);
  cursor: pointer; border: none; transition: all .2s; text-decoration: none;
}
.btn-primary {
  background: var(--green); color: white;
}
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,200,83,.3); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--white); color: var(--gray-700);
  border: 1.5px solid var(--gray-300);
}
.btn-secondary:hover { background: var(--gray-100); border-color: var(--gray-500); }
.btn-full { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon {
  width: 34px; height: 34px; padding: 0; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gray-100); border: 1.5px solid var(--gray-300);
  cursor: pointer; font-size: 13px; color: var(--gray-700); transition: all .2s;
}
.btn-icon:hover { background: var(--green-light); color: var(--green); border-color: var(--green); }
.btn-icon.danger:hover { background: #ffebee; color: var(--red); border-color: var(--red); }

/* ===== ALERTS ===== */
.alert {
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 13px; display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px;
}
.alert-error   { background: #ffebee; color: var(--red); border: 1px solid #ffcdd2; }
.alert-success { background: var(--green-light); color: #1b5e20; border: 1px solid #a5d6a7; }
.alert-info    { background: #e3f2fd; color: #0d47a1; border: 1px solid #90caf9; }
.hidden { display: none !important; }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--black);
  display: flex; align-items: center; gap: 0;
  padding: 0 24px; height: 60px;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  margin-right: 32px; flex-shrink: 0;
}
.nav-brand .logo-cien { color: var(--white); font-size: 18px; }
.nav-brand .logo-by { color: var(--gray-500); }
.nav-menu { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  border: none; background: transparent; color: var(--gray-300);
  font-size: 13px; font-weight: 500; font-family: var(--font);
  cursor: pointer; transition: all .2s;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: var(--white); }
.nav-item.active { background: var(--green); color: var(--white); }
.nav-user {
  display: flex; align-items: center; gap: 10px; margin-left: auto;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--green); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-name  { font-size: 13px; font-weight: 600; color: var(--white); }
.user-email { font-size: 11px; color: var(--gray-500); }
.btn-logout {
  background: transparent; border: none; color: var(--gray-500);
  cursor: pointer; padding: 6px; border-radius: 6px; font-size: 16px;
  transition: color .2s;
}
.btn-logout:hover { color: #ef5350; }

/* ===== MAIN CONTENT ===== */
.main-content { padding: 28px; max-width: 1400px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }
.view-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.view-title { font-size: 24px; font-weight: 700; }
.view-subtitle { color: var(--gray-500); font-size: 13px; margin-top: 2px; }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ===== CARDS ===== */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid #ebebeb; overflow: hidden;
}
.card-header {
  padding: 18px 22px; border-bottom: 1px solid #f0f0f0;
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 {
  font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; color: var(--gray-700);
}
.card-header h3 i { color: var(--green); }
.card-body { padding: 22px; }

/* ===== KPI GRID ===== */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 24px;
}
.kpi-card {
  background: var(--white); border-radius: var(--radius); padding: 20px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm); border: 1px solid #ebebeb;
}
.kpi-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.kpi-data { display: flex; flex-direction: column; }
.kpi-value { font-size: 28px; font-weight: 800; line-height: 1; color: var(--black); }
.kpi-label { font-size: 12px; color: var(--gray-500); margin-top: 3px; }

/* ===== SEARCH & FILTERS ===== */
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm); padding: 8px 14px;
}
.search-box i { color: var(--gray-500); }
.search-box input { border: none; outline: none; font-family: var(--font); font-size: 13px; width: 200px; }
.select-filter {
  padding: 9px 12px; border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm); font-family: var(--font); font-size: 13px;
  background: var(--white); cursor: pointer;
}

/* ===== TABLE ===== */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
table th {
  text-align: left; padding: 10px 14px; background: var(--gray-100);
  color: var(--gray-500); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid #ebebeb;
}
table td {
  padding: 12px 14px; border-bottom: 1px solid #f5f5f5; vertical-align: middle;
}
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: #fafafa; }

/* ===== STATUS BADGES ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-borrador  { background: #f5f5f5; color: #757575; }
.badge-enviada   { background: #e3f2fd; color: #1565c0; }
.badge-vista     { background: #fff8e1; color: #f57f17; }
.badge-aceptada  { background: #e8f5e9; color: #2e7d32; }
.badge-rechazada { background: #ffebee; color: #c62828; }

/* ===== OFERTAS GRID ===== */
.ofertas-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px,1fr)); gap: 18px;
}
.oferta-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid #ebebeb;
  overflow: hidden; transition: box-shadow .2s, transform .2s;
}
.oferta-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.oferta-card-header {
  padding: 16px 18px; display: flex; align-items: flex-start; justify-content: space-between;
  border-bottom: 1px solid #f0f0f0;
}
.oferta-card-title { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.oferta-card-subtitle { font-size: 12px; color: var(--gray-500); }
.oferta-card-body { padding: 14px 18px; }
.oferta-card-meta {
  display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--gray-500);
}
.oferta-card-meta span { display: flex; align-items: center; gap: 6px; }
.oferta-card-meta i { color: var(--green); width: 14px; }
.oferta-card-footer {
  padding: 12px 18px; background: var(--gray-100); border-top: 1px solid #f0f0f0;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.modelo-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 6px; font-size: 11px; font-weight: 700;
}
.modelo-tag-a { background: #e8f5e9; color: #2e7d32; }
.modelo-tag-b { background: #e3f2fd; color: #1565c0; }
.modelo-tag-c { background: #f3e5f5; color: #6a1b9a; }
.modelo-tag-d { background: #fff8e1; color: #f57f17; }
.modelo-tag-e { background: #fef3c7; color: #b45309; }

/* ===== NUEVA OFERTA LAYOUT ===== */
.oferta-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start;
}
@media(max-width: 1100px) { .oferta-layout { grid-template-columns: 1fr; } }

/* ===== FORM SECTIONS ===== */
.form-section { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid #f0f0f0; }
.form-section:last-of-type { border-bottom: none; }
.section-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--gray-500); margin-bottom: 16px; display: flex; align-items: center; gap: 7px;
}
.section-label i { color: var(--green); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media(max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-group { margin-bottom: 14px; }
.form-group label {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--gray-300); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 13px; background: var(--white);
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(0,200,83,.1);
}
.req { color: var(--red); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }

/* ===== MODELO CARDS ===== */
.modelo-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
@media(max-width: 700px) { .modelo-cards { grid-template-columns: 1fr; } }
.modelo-card { cursor: pointer; }
.modelo-card input[type="radio"] { display: none; }
.modelo-card-inner {
  border: 2px solid var(--gray-300); border-radius: 10px; padding: 14px;
  display: flex; flex-direction: column; gap: 4px; transition: all .2s;
}
.modelo-card-inner strong { font-size: 13px; }
.modelo-card-inner span  { font-size: 11px; color: var(--gray-500); }
.modelo-card input:checked + .modelo-card-inner {
  border-color: var(--green); background: var(--green-light);
}
.modelo-card input:checked + .modelo-card-inner .modelo-badge { box-shadow: 0 2px 8px rgba(0,200,83,.4); }
.modelo-badge {
  width: 28px; height: 28px; border-radius: 8px; font-size: 14px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; color: white; margin-bottom: 6px;
}
.badge-a { background: #2e7d32; }
.badge-b { background: #1565c0; }
.badge-c { background: #6a1b9a; }

/* ===== PREVIEW PANEL ===== */
.preview-placeholder {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; color: var(--gray-300); text-align: center; gap: 12px;
}
.preview-placeholder i { font-size: 48px; }
.preview-placeholder p  { font-size: 13px; }

/* ===== OFERTA DOCUMENT ===== */
.oferta-doc { font-size: 13px; }
.oferta-doc-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 18px; margin-bottom: 20px; border-bottom: 2px solid var(--green);
}
.oferta-doc-brand { display: flex; align-items: center; gap: 10px; }
.oferta-doc-brand .logo-cien { font-size: 24px; font-weight: 800; }
.oferta-doc-meta { text-align: right; font-size: 11px; color: var(--gray-500); line-height: 1.8; }

.oferta-doc-titulo { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.oferta-doc-subtitulo { font-size: 12px; color: var(--gray-500); margin-bottom: 18px; }

.oferta-doc-section { margin-bottom: 20px; }
.oferta-doc-section h4 {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--green); border-bottom: 1px solid var(--green-light);
  padding-bottom: 5px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.cliente-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cliente-item label { font-size: 10px; color: var(--gray-500); display: block; margin-bottom: 1px; text-transform: uppercase; }
.cliente-item value { font-weight: 600; font-size: 13px; }

/* Matriz de Responsabilidades */
.matriz-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media(max-width: 700px) { .matriz-wrapper { grid-template-columns: 1fr; } }
.matriz-col {
  border: 1.5px solid #ebebeb; border-radius: 10px; overflow: hidden;
}
.matriz-col-header {
  padding: 10px 14px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}
.matriz-col-header .col-role { font-size: 11px; font-weight: 500; opacity: .75; margin-bottom: 2px; }
.matriz-col-header .col-title { font-size: 14px; font-weight: 800; }
.matriz-cien-header  { background: var(--green); color: white; }
.matriz-comercio-header { background: var(--black); color: white; }
.matriz-items { padding: 10px; }
.matriz-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 6px; border-bottom: 1px solid #f5f5f5;
}
.matriz-item:last-child { border-bottom: none; }
.item-icon {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.item-icon-cien     { background: var(--green-light); color: var(--green); }
.item-icon-comercio { background: var(--gray-100); color: var(--gray-700); }
.item-text strong { font-size: 12px; display: block; }
.item-text small  { font-size: 11px; color: var(--gray-500); }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px; backdrop-filter: blur(3px);
}
.modal {
  background: var(--white); border-radius: var(--radius);
  width: 100%; max-width: 520px; max-height: 90vh;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: modalIn .2s ease;
}
.modal-xl { max-width: 900px; }
@keyframes modalIn { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header {
  padding: 18px 22px; border-bottom: 1px solid #f0f0f0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.modal-header h3 i { color: var(--green); }
.modal-close {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--gray-500); line-height: 1; padding: 2px 8px;
}
.modal-close:hover { color: var(--red); }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 22px; border-top: 1px solid #f0f0f0;
  display: flex; justify-content: flex-end; gap: 10px;
}

.send-summary {
  background: var(--gray-100); border-radius: var(--radius-sm); padding: 14px;
  margin-bottom: 16px; font-size: 13px; line-height: 1.8;
}
.send-summary strong { color: var(--green); }

.emailjs-config-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fff8e1; border: 1px solid #ffe082; border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 16px; font-size: 12px; color: #795548;
}
.emailjs-config-note i { color: #f57f17; margin-top: 1px; }
.emailjs-config-note code { background: rgba(0,0,0,.07); padding: 1px 4px; border-radius: 3px; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 9999;
  background: var(--black); color: var(--white);
  padding: 14px 20px; border-radius: 10px;
  display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg); animation: toastIn .25s ease;
}
@keyframes toastIn { from { opacity:0; transform: translateY(16px); } to { opacity:1; transform: translateY(0); } }
.toast i { color: var(--green); font-size: 16px; }
.toast.toast-error i { color: #ef5350; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 40px; color: var(--gray-300); font-size: 13px; }
.empty-state i { font-size: 36px; display: block; margin-bottom: 10px; }
.empty-state-full {
  grid-column: 1/-1; text-align: center; padding: 80px 20px;
  color: var(--gray-300); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
}
.empty-state-full i { font-size: 52px; }
.empty-state-full p  { font-size: 14px; }

/* ===== TIMELINE DE EVENTOS ===== */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 0; bottom: 0;
  width: 2px; background: #f0f0f0;
}
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-dot {
  position: absolute; left: -20px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--white); box-shadow: 0 0 0 2px var(--green);
  background: var(--green);
}
.timeline-content { background: var(--gray-100); border-radius: 8px; padding: 10px 14px; }
.timeline-title   { font-weight: 600; font-size: 12px; }
.timeline-time    { font-size: 11px; color: var(--gray-500); margin-top: 2px; }

/* ===== NAV MODULES (Aliados / Ofertas) ===== */
.nav-modules {
  display: flex; align-items: center; gap: 2px;
  background: rgba(255,255,255,.07); border-radius: 10px;
  padding: 3px; margin-right: 20px; flex-shrink: 0;
}
.nav-module {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 8px; border: none;
  background: transparent; color: rgba(255,255,255,.6);
  font-size: 12px; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: all .2s; white-space: nowrap;
}
.nav-module:hover { background: rgba(255,255,255,.1); color: var(--white); }
.nav-module.active { background: var(--green); color: var(--white); box-shadow: 0 2px 8px rgba(0,200,83,.4); }
.nav-mod-admin { color: rgba(255,165,0,.8) !important; }
.nav-mod-admin.active { background: #e65100 !important; color: #fff !important; }

/* ===== FORM GRID ===== */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media(max-width:700px){ .form-grid-2 { grid-template-columns:1fr; } .form-grid-2 [style*="span 2"]{ grid-column:span 1 !important; } }

/* ===== ALIADOS LIST ===== */
.aliados-list { display: flex; flex-direction: column; }
.aliado-row {
  display: grid; grid-template-columns: 1fr 180px 140px 130px 140px;
  gap: 12px; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid #f0f0f0;
  transition: background .15s; cursor: pointer;
}
.aliado-row:hover { background: #f9fbff; }
.aliado-row:last-child { border-bottom: none; }
.aliado-row-header {
  display: grid; grid-template-columns: 1fr 180px 140px 130px 140px;
  gap: 12px; padding: 10px 20px 8px;
  background: #f8f9fa; border-bottom: 2px solid #e9ecef;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: #6b7c99;
}
.aliado-nombre { font-weight: 700; font-size: 14px; color: #0d1b2a; }
.aliado-nombre small { display: block; font-size: 11px; font-weight: 400; color: #6b7c99; margin-top: 2px; }
.aliado-actions { display: flex; gap: 6px; justify-content: flex-end; }
@media(max-width:900px){
  .aliado-row, .aliado-row-header { grid-template-columns: 1fr 120px 100px; }
  .aliado-row > *:nth-child(2), .aliado-row-header > *:nth-child(2) { display: none; }
  .aliado-row > *:nth-child(4), .aliado-row-header > *:nth-child(4) { display: none; }
}

/* ===== BADGE ESTADOS ALIADO ===== */
.badge-activo        { background: #e8f5e9; color: #2e7d32; }
.badge-inactivo      { background: #f5f5f5; color: #757575; }
.badge-en_negociacion{ background: #fff8e1; color: #f57f17; }

/* ===== ALIADO TABS ===== */
.ali-tabs { display: flex; gap: 4px; border-bottom: 2px solid #e9ecef; margin-bottom: 20px; }
.ali-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 18px; border: none; background: transparent;
  color: #6b7c99; font-size: 13px; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: all .2s; border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.ali-tab:hover { color: #1a73e8; }
.ali-tab.active { color: #1a73e8; border-bottom-color: #1a73e8; }
.ali-tab-content { display: none; }
.ali-tab-content.active { display: block; }

/* ===== DETALLE ALIADO INFO ===== */
.ali-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.ali-info-field { background: #f8f9fa; border-radius: 10px; padding: 12px 16px; }
.ali-info-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #6b7c99; margin-bottom: 4px; }
.ali-info-val { font-size: 14px; font-weight: 600; color: #0d1b2a; }
@media(max-width:640px){ .ali-info-grid { grid-template-columns:1fr; } }

/* ===== INFORMES LIST en detalle aliado ===== */
.informe-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border: 1.5px solid #e9ecef; border-radius: 10px; margin-bottom: 10px;
  transition: border-color .2s; cursor: pointer;
}
.informe-item:hover { border-color: #1a73e8; background: #f0f6ff; }
.informe-item-left { display: flex; flex-direction: column; gap: 3px; }
.informe-item-titulo { font-weight: 700; font-size: 14px; color: #0d1b2a; }
.informe-item-fecha { font-size: 11px; color: #6b7c99; }
.informe-item-right { display: flex; align-items: center; gap: 8px; }

/* ===== BADGE ESTADOS INFORME ===== */
.badge-pendiente      { background: #fff8e1; color: #f57f17; }
.badge-enviado        { background: #e3f2fd; color: #1565c0; }
.badge-aprobado       { background: #e8f5e9; color: #2e7d32; }
.badge-aprobado_con_factura { background: #e8f5e9; color: #1b5e20; font-weight: 700; }
.badge-rechazado      { background: #ffebee; color: #c62828; }

/* ===== PERMISOS TABLE ===== */
.permisos-table { width: 100%; border-collapse: collapse; }
.permisos-table th { background: #f8f9fa; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #6b7c99; padding: 10px 14px; text-align: left; border-bottom: 2px solid #e9ecef; }
.permisos-table td { padding: 12px 14px; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.permisos-table tr:last-child td { border-bottom: none; }
.perm-toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.perm-toggle input { opacity: 0; width: 0; height: 0; }
.perm-slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background: #ccc; border-radius: 22px; transition: .3s;
}
.perm-slider::before {
  content: ''; position: absolute; height: 16px; width: 16px;
  left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .3s;
}
input:checked + .perm-slider { background: var(--green); }
input:checked + .perm-slider::before { transform: translateX(18px); }

/* ===== ADMIN — Módulos leyenda ===== */
.admin-modulos-leyenda {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 4px;
}
.aml-item {
  background: var(--white);
  border: 1px solid #ebebeb;
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}
.aml-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.aml-label {
  font-size: 13px; font-weight: 700; color: var(--black); margin-bottom: 3px;
}
.aml-desc {
  font-size: 11px; color: var(--gray-500); line-height: 1.5;
}

/* ===== ADMIN — Tabla permisos mejorada ===== */
.permisos-table { width: 100%; border-collapse: collapse; }
.permisos-table thead th {
  background: #f8f9fa;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: #6b7c99;
  padding: 12px 16px; text-align: left;
  border-bottom: 2px solid #e9ecef;
  white-space: nowrap;
}
.permisos-table thead th .th-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 6px;
  font-size: 11px; margin-right: 5px;
}
.permisos-table tbody td { padding: 14px 16px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.permisos-table tbody tr:last-child td { border-bottom: none; }
.permisos-table tbody tr:hover td { background: #fafbff; }
.perm-user-name   { font-weight: 700; font-size: 13px; color: #0d1b2a; margin-bottom: 2px; }
.perm-user-email  { font-size: 11px; color: #6b7c99; }
.perm-user-rol    { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 12px; margin-top: 4px; }
.perm-rol-admin   { background: #fff3e0; color: #e65100; }
.perm-rol-comercial { background: #e3f2fd; color: #1565c0; }
.perm-rol-dev     { background: #e8f5e9; color: #2e7d32; }
.perm-rol-user    { background: #f5f5f5; color: #757575; }

/* Toggle mejorado con etiqueta */
.perm-toggle-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.perm-toggle-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; transition: color .2s;
}
.perm-toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.perm-toggle input { opacity: 0; width: 0; height: 0; }
.perm-slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background: #ddd; border-radius: 24px; transition: .25s;
}
.perm-slider::before {
  content: ''; position: absolute; height: 18px; width: 18px;
  left: 3px; bottom: 3px; background: white; border-radius: 50%;
  transition: .25s; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
input:checked + .perm-slider { background: var(--green); }
input:checked + .perm-slider::before { transform: translateX(20px); }

/* Badge estado usuario */
.adm-user-status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 10px;
}
.adm-status-activo   { background: #e8f5e9; color: #2e7d32; }
.adm-status-pendiente{ background: #fff8e1; color: #f57f17; }
.adm-status-inactivo { background: #f5f5f5; color: #757575; }

/* ===== MÓDULO LEADS ===== */
.leads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  padding-bottom: 24px;
}

.lead-card {
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 14px;
  padding: 18px;
  transition: box-shadow .2s, border-color .2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lead-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.1); border-color: #c3d8f0; }

.lead-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.lead-avatar {
  width: 44px; height: 44px; min-width: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00c853 0%, #009624 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
}

.lead-card-info  { flex: 1; min-width: 0; }
.lead-card-nombre {
  font-size: 14px; font-weight: 700; color: #1a2a3a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lead-card-empresa { font-size: 12px; color: #6b7c99; margin-top: 2px; }
.lead-card-empresa i { margin-right: 4px; }

.lead-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

.btn-icon-sm {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid #e0e8f0;
  background: #f8f9fa;
  color: #3c4043;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: all .2s;
}
.btn-icon-sm:hover       { background: #e8f5e9; border-color: #00c853; color: #00c853; }
.btn-danger-sm:hover     { background: #fce4ec !important; border-color: #e53935 !important; color: #e53935 !important; }

.lead-card-body  { display: flex; flex-direction: column; gap: 6px; }
.lead-card-row   { font-size: 12px; color: #6b7c99; display: flex; align-items: center; gap: 7px; }
.lead-card-row i { width: 14px; color: #1a73e8; flex-shrink: 0; }
.lead-card-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lead-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #f0f4f8;
}

.lead-tag {
  font-size: 11px; font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lead-fecha { font-size: 11px; color: #9aa5b4; white-space: nowrap; flex-shrink: 0; }

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

/* ── 1024px — tablet landscape ── */
@media(max-width: 1024px) {
  .main-content { padding: 20px; }
  .ofertas-grid { grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); }
  .aliado-row,
  .aliado-row-header { grid-template-columns: 1fr 150px 120px 110px 110px; }
}

/* ── 768px — tablet portrait ── */
@media(max-width: 768px) {
  /* Layout */
  .main-content { padding: 14px; }

  /* Navbar */
  .navbar { padding: 0 12px; height: 54px; }
  .nav-brand { margin-right: 12px; }
  .nav-brand .logo-cien { font-size: 16px; }
  .nav-menu { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 2px; }
  .nav-menu::-webkit-scrollbar { display: none; }
  .nav-item { padding: 6px 12px; font-size: 12px; white-space: nowrap; }
  .user-info { display: none; }
  .nav-modules { margin-right: 6px; }
  .nav-module  { padding: 5px 10px; font-size: 11px; }

  /* KPI */
  .kpi-grid { grid-template-columns: repeat(2,1fr); gap: 12px; margin-bottom: 18px; }
  .kpi-value { font-size: 22px; }
  .kpi-card  { padding: 16px; }

  /* Vista header */
  .view-header { flex-direction: column; align-items: flex-start; }
  .view-title   { font-size: 20px; }
  .header-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }

  /* Ofertas */
  .oferta-layout { grid-template-columns: 1fr; }
  .ofertas-grid  { grid-template-columns: 1fr; }
  .modal-xl      { max-width: 100%; margin: 0; border-radius: 0; max-height: 100vh; }

  /* Modales */
  .modal-overlay { padding: 10px; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: 14px 14px 0 0; }
  .modal-body { padding: 16px; }
  .modal-header, .modal-footer { padding: 14px 16px; }

  /* Formularios */
  .form-row   { grid-template-columns: 1fr; }
  .form-grid-2{ grid-template-columns: 1fr; }
  .form-actions { justify-content: stretch; }
  .form-actions .btn-primary,
  .form-actions .btn-secondary { flex: 1; justify-content: center; }

  /* Modelos cards */
  .modelo-cards { grid-template-columns: 1fr 1fr; }

  /* Tablas */
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 520px; }

  /* Timeline */
  .timeline { padding-left: 16px; }

  /* Aliados */
  .aliado-row,
  .aliado-row-header { grid-template-columns: 1fr 110px 90px; }
  .aliado-row > *:nth-child(2),
  .aliado-row-header > *:nth-child(2) { display: none; }
  .aliado-row > *:nth-child(4),
  .aliado-row-header > *:nth-child(4) { display: none; }

  /* Leads */
  .leads-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Toast */
  .toast { bottom: 16px; right: 16px; left: 16px; font-size: 12px; }

  /* Search */
  .search-box input { width: 140px; }

  /* Ali-info-grid */
  .ali-info-grid { grid-template-columns: 1fr; }

  /* Admin permisos */
  .permisos-table { font-size: 12px; }
  .permisos-table thead th { padding: 9px 10px; font-size: 10px; }
  .permisos-table tbody td { padding: 10px; }

  /* Login card */
  .login-card { padding: 32px 22px; }
}

/* ── 480px — mobile ── */
@media(max-width: 480px) {
  /* Navbar mínimo */
  .navbar { padding: 0 10px; height: 50px; }
  .nav-menu { display: none; }        /* ocultar menú — sólo brand + avatar */
  .nav-brand .logo-cien { font-size: 15px; }
  .nav-brand .logo-by   { display: none; }
  .nav-modules { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav-modules::-webkit-scrollbar { display: none; }
  .nav-module { padding: 4px 9px; font-size: 10px; }

  /* KPI 1 columna */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-value { font-size: 20px; }
  .kpi-icon  { width: 40px; height: 40px; font-size: 16px; }
  .kpi-card  { padding: 14px; gap: 12px; }

  /* Layout */
  .main-content { padding: 10px; }
  .view-title    { font-size: 18px; }
  .view-subtitle { font-size: 12px; }

  /* Modelos 1 col */
  .modelo-cards { grid-template-columns: 1fr; }

  /* Modal full-screen */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 95vh; }
  .modal-body  { padding: 14px; }
  .modal-footer { flex-direction: column; }
  .modal-footer .btn-primary,
  .modal-footer .btn-secondary { width: 100%; justify-content: center; }

  /* Cards oferta */
  .oferta-card-footer { flex-direction: column; align-items: flex-start; }

  /* Ofertas grid */
  .ofertas-grid { gap: 12px; }

  /* Send summary */
  .send-summary { font-size: 12px; padding: 10px 12px; }

  /* Tablas ultra-compact */
  table { font-size: 12px; }
  table th, table td { padding: 8px 10px; }

  /* Admin modulos leyenda */
  .admin-modulos-leyenda { grid-template-columns: 1fr; }

  /* Login */
  .login-card { padding: 24px 16px; border-radius: 16px; }
  .login-title { font-size: 22px; }

  /* Toast */
  .toast { bottom: 12px; right: 10px; left: 10px; padding: 12px 14px; }

  /* Buscador */
  .search-box input { width: 110px; font-size: 12px; }
  .select-filter    { font-size: 12px; padding: 8px 10px; }
}
