/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --brand-dark:  #1E3A5F;
  --brand-mid:   #2563EB;
  --brand-light: #EFF6FF;
  --oil-green:   #2E7D32;
  --font-main:   'Segoe UI', Arial, sans-serif;
}

/* ── Base ──────────────────────────────────────────────────────── */
body {
  font-family: var(--font-main);
  background: #F1F5F9;
  color: #1E293B;
}

/* ── Navbar ────────────────────────────────────────────────────── */
.navbar {
  background: var(--brand-dark) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  padding: .5rem 1rem;
}
.navbar-brand { font-weight: 700; font-size: 1.05rem; letter-spacing: .3px; }
.nav-link.active { background: rgba(255,255,255,.15); border-radius: 6px; }

/* ── Login ─────────────────────────────────────────────────────── */
.login-wrapper {
  background: linear-gradient(135deg, var(--brand-dark) 0%, #1a5276 50%, var(--oil-green) 100%);
  min-height: 100vh;
}
.login-card {
  width: 100%;
  max-width: 420px;
  border: none;
  border-radius: 16px;
}
.login-icon {
  width: 72px; height: 72px;
  background: var(--brand-light);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--oil-green);
}

/* ── Stat cards ────────────────────────────────────────────────── */
.stat-card { border: none; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.08); transition: transform .15s; }
.stat-card:hover { transform: translateY(-2px); }
.stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: .7rem; color: #64748B; text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }

/* ── Form sections ─────────────────────────────────────────────── */
.form-section { border-top: 2px solid #E2E8F0; padding-top: 1.25rem; }
.form-section:first-child { border-top: none; padding-top: 0; }
.section-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--brand-dark);
  margin-bottom: .25rem;
}

/* ── Segment selector ──────────────────────────────────────────── */
.seg-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.seg-check { display: none; }
.seg-label {
  display: inline-flex;
  align-items: center;
  padding: .55rem 1rem;
  border: 2px solid #CBD5E1;
  border-radius: 50px;
  font-size: .875rem;
  font-weight: 600;
  background: white;
  color: #475569;
  transition: all .15s;
  user-select: none;
}
.seg-check:checked + .seg-label {
  border-color: var(--brand-mid);
  background: var(--brand-light);
  color: var(--brand-mid);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.seg-btn:hover .seg-label {
  border-color: var(--brand-mid);
  color: var(--brand-mid);
}

/* ── Product cards ─────────────────────────────────────────────── */
.prod-card {
  background: white;
  border-color: #E2E8F0 !important;
  transition: all .15s;
  cursor: pointer;
}
.prod-card:hover { border-color: #93C5FD !important; background: #F8FAFF; }
.prod-card-selected {
  border-color: var(--brand-mid) !important;
  background: var(--brand-light) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.qty-wrapper { animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }

/* ── Opportunity rating ────────────────────────────────────────── */
.btn-opp {
  width: 44px;
  padding: .4rem 0;
  font-size: .9rem;
  border-radius: 8px !important;
}
.btn-check:checked + .btn-opp {
  background: #F59E0B;
  border-color: #F59E0B;
  color: white;
}

/* ── Table ─────────────────────────────────────────────────────── */
.table-header-custom th {
  background: var(--brand-dark);
  color: white;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  border: none;
  padding: .7rem 1rem;
  white-space: nowrap;
}
.table td { border-color: #F1F5F9; padding: .65rem 1rem; font-size: .875rem; }
.table tbody tr:hover { background: #F8FAFC; }
.table-success-light { background: #F0FDF4 !important; }

/* ── Badges ────────────────────────────────────────────────────── */
.bg-success-subtle { background: #DCFCE7 !important; }
.bg-primary-subtle { background: #DBEAFE !important; }
.bg-warning-subtle { background: #FEF3C7 !important; }

/* ── Cards generic ─────────────────────────────────────────────── */
.card { border: none; border-radius: 12px; }
.card-header {
  background: white;
  border-bottom: 1px solid #E2E8F0;
  border-radius: 12px 12px 0 0 !important;
  padding: .75rem 1.25rem;
}

/* ── Forms ─────────────────────────────────────────────────────── */
.form-control:focus, .form-select:focus {
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 .2rem rgba(37,99,235,.15);
}
.form-label { font-size: .85rem; color: #374151; margin-bottom: .3rem; }

/* ── Tiny text ─────────────────────────────────────────────────── */
.tiny { font-size: .72rem; }

/* ── Detail collapse ───────────────────────────────────────────── */
tr[data-bs-toggle="collapse"]:hover td { background: #EEF2FF !important; }

/* ── Unit toggle buttons ───────────────────────────────────────── */
.unit-toggle-wrap {
  display: inline-flex;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  overflow: hidden;
}
.btn-unit {
  border: none !important;
  border-radius: 0 !important;
  padding: .3rem .7rem;
  font-size: .78rem;
  font-weight: 600;
  color: #64748B;
  background: white;
  transition: all .15s;
}
.btn-check:checked + .btn-unit {
  background: var(--brand-mid);
  color: white;
}
.unit-toggle-wrap .btn-unit:not(:last-child) {
  border-right: 1.5px solid #CBD5E1 !important;
}
.qty-input-group .input-group-text {
  font-size: .78rem;
  background: #F8FAFC;
  color: #64748B;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Vendedor section nav ──────────────────────────────────────── */
.vend-nav-btn {
  display: inline-flex;
  align-items: center;
  padding: .45rem 1.1rem;
  border-radius: 50px;
  font-size: .83rem;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid #CBD5E1;
  color: #64748B;
  background: white;
  transition: all .15s;
}
.vend-nav-btn:hover { border-color: var(--brand-mid); color: var(--brand-mid); }
.vend-nav-btn.active {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: white;
}

/* ── Nav tabs custom ───────────────────────────────────────────── */
.nav-tabs { border-color: #E2E8F0; }
.nav-tabs .nav-link {
  color: #64748B;
  border-color: transparent;
  padding: .5rem 1.1rem;
  font-size: .875rem;
}
.nav-tabs .nav-link.active {
  color: var(--brand-dark);
  border-color: #E2E8F0 #E2E8F0 white;
  font-weight: 700;
}
.nav-tabs .nav-link:hover { color: var(--brand-mid); }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  main { padding-bottom: 3rem; }
  .stat-value { font-size: 1.5rem; }
  .container-xl, .container-lg { padding-left: .75rem; padding-right: .75rem; }
  .btn-opp { width: 38px; font-size: .8rem; }

  /* Admin: botón exportar no debe partir el texto */
  a[href*="/admin/exportar"] { white-space: nowrap; flex-shrink: 0; font-size: .8rem; }

  /* Guía industrias: columna única en móvil */
  .guia-ind-grid { grid-template-columns: 1fr !important; }
}
@media (min-width: 769px) {
  .admin-export-txt { display: inline; }
}
