/* ══════════════════════════════════════════════════════════
   ACCESO / LOGIN PORTAL
   ══════════════════════════════════════════════════════════ */
.login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-hero);
  position: relative;
  padding: 24px;
}
.login-bg::before {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.login-card {
  background: var(--white);
  border-radius: 24px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 40px;
  position: relative;
  z-index: 2;
}
.login-card-wide {
  max-width: 520px;
}
.login-logo {
  justify-content: center;
  font-weight: 800;
  font-size: 26px;
  color: var(--navy);
  margin-bottom: 28px;
}
.login-logo .logo-score { color: var(--accent); }
.login-title {
  text-align: center;
  color: var(--navy);
  margin-bottom: 12px;
}
.login-title-sm {
  text-align: center;
  color: var(--navy);
  font-size: 18px;
  margin-bottom: 10px;
}
.login-lead {
  text-align: center;
  color: var(--gray);
  font-size: 14px;
  margin-bottom: 28px;
}
.role-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
  padding: 6px;
  border-radius: 12px;
  margin-bottom: 24px;
}
.role-tab {
  padding: 12px;
  border: none;
  background: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  color: var(--gray);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.role-tab.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 4px 12px rgba(13, 43, 78, 0.08);
}
.login-field {
  margin-bottom: 18px;
}
.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}
.login-field input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--navy);
  outline: none;
  transition: all 0.2s;
}
.login-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 196, 140, 0.1);
}
.form-hint {
  font-size: 12px;
  color: var(--gray);
  margin-top: 6px;
  line-height: 1.4;
}
.login-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 10px;
}
.login-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  accent-color: var(--accent);
}
.login-field-check { margin-bottom: 20px; }
.login-field-check .login-remember { font-size: 13px; color: var(--gray); align-items: flex-start; }
.login-submit { width: 100%; justify-content: center; padding: 14px; }
.login-footnote { font-size: 13px; color: var(--gray); text-align: center; margin-top: 24px; }
.login-link { color: var(--blue); font-weight: 700; }
#recovery-panel { margin-top: 8px; }

/* ══════════════════════════════════════════════════════════
   DASHBOARD PRIVADO COMÚN
   ══════════════════════════════════════════════════════════ */
.priv-body {
  background: var(--bg);
  min-height: 100vh;
}
.priv-header {
  background: var(--navy);
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.priv-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.priv-logo { color: var(--white); }
.priv-logo .logo-score { color: var(--accent); }
.priv-logo-icon { background: var(--white); }
.user-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}
.user-avatar-transportista { background: var(--accent); color: var(--white); }
.user-info {
  display: flex;
  flex-direction: column;
}
.user-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
}
.user-role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}
.btn-logout { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, 0.2); padding: 8px 14px; }

/* ─── BANNER DE ESTADO DE PERFIL ─────────────────────────── */
.profile-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; border-radius: var(--radius-md); margin-bottom: 24px; flex-wrap: wrap;
}
.profile-banner-incompleto { background: var(--warning-light); border: 1px solid rgba(224,123,57,0.3); }
.profile-banner-revision { background: var(--blue-light); border: 1px solid rgba(26,111,181,0.25); }
.profile-banner-activo { background: var(--accent-light); border: 1px solid rgba(0,196,140,0.3); }
.profile-banner-text h4 { margin-bottom: 2px; }
.profile-banner-text p { font-size: 13px; color: var(--gray); margin: 0; }
.profile-form { margin-top: 16px; display: none; }
.profile-form.open { display: block; }
.profile-form .form-grid { margin-bottom: 16px; }
.action-locked {
  opacity: 0.6; cursor: not-allowed; pointer-events: none;
}
.action-locked-note { font-size: 12px; color: var(--gray-light); text-align: center; margin-top: 8px; }
.priv-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 28px;
  padding: 40px 0;
}
.priv-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.priv-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.priv-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 4px 20px -8px rgba(13, 43, 78, 0.05);
}
.priv-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.priv-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.priv-stat-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
}
.priv-stat-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
}
.priv-stat-lbl {
  font-size: 12px;
  color: var(--gray-light);
  font-weight: 600;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.priv-stat-box-accent { background: var(--accent-light); }
.priv-stat-box-accent .priv-stat-val,
.priv-stat-box-accent .priv-stat-lbl { color: var(--accent-dark); }
.priv-stat-box-accent .priv-stat-lbl { font-weight: 700; }
.priv-stat-val-muted { color: var(--gray-light); font-size: 18px; }

/* ─── TRACKING / PROGRESO ────────────────────────────────── */
.tracking-bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; position: relative; }
.tracking-bar-fill { height: 100%; border-radius: 99px; }
.tracking-bar-fill-accent { background: var(--accent); }
.tracking-bar-fill-blue { background: var(--blue); animation: pulse 1.6s infinite; }

/* ─── ITEM PRICE / META ──────────────────────────────────── */
.priv-item-meta-price { color: var(--accent-dark); font-weight: 700; margin-top: 4px; }
.priv-item-title-lg { font-size: 16px; }
.priv-card-mb { margin-bottom: 16px; }
.priv-item-main-mb { margin-bottom: 12px; }
.priv-item-mb { margin-bottom: 8px; }
.priv-form-submit { width: 100%; justify-content: center; margin-top: 20px; font-size: 14px; padding: 12px; }

/* ─── DADORES DE CARGA / FORMULARIOS ─────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-field.full {
  grid-column: 1 / -1;
}
.form-field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-field input,
.form-field select,
.form-field textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: var(--white);
  color: var(--navy);
  transition: all 0.2s;
}
.form-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235A6A7A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 196, 140, 0.1);
}

/* ─── ENVIOS / RUTAS LISTS ───────────────────────────────── */
.priv-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.priv-item {
  display:grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  transition: all 0.2s;
}
.priv-item:hover {
  border-color: var(--accent);
}
.priv-item-main {
  display: flex;
  flex-direction: column;
}
.priv-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}
.priv-item-meta {
  font-size: 12px;
  color: var(--gray);
  margin-top: 2px;
}
.priv-item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Tracking map simulator style */
.tracking-visual {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--white);
  margin-top: 10px;
}
.tracking-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-light);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ─── RESPONSIVE PRIVADO ─────────────────────────────────── */
@media (max-width: 960px) {
  .priv-grid {
    grid-template-columns: 1fr;
  }
  .priv-stats {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 480px) {
  .login-card {
    padding: 24px;
  }
  .priv-stats {
    grid-template-columns: 1fr;
  }
}

/* ── Panel de fábrica (cableado real) ──────────────────── */
.form-msg { font-size: 13px; font-weight: 600; margin-top: 10px; }
.form-msg-ok { color: var(--accent); }
.form-msg-err { color: var(--warning); }
.priv-empty { color: var(--gray); font-size: 14px; padding: 8px 2px; line-height: 1.5; }
.carga-estado { margin: 6px 0 2px; }
.viaje-box { font-size: 13px; color: var(--navy); margin-top: 6px; }
.postul-list { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.postul-head { font-size: 12px; font-weight: 700; color: var(--gray); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 8px; }
.postul-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.postul-item:last-child { border-bottom: none; }
.postul-nombre { font-weight: 700; color: var(--navy); font-size: 14px; }
.postul-meta { font-size: 12.5px; color: var(--gray); margin-top: 2px; }
.postul-nota { color: var(--gray); font-weight: 400; }
.postul-vacio { margin-top: 12px; font-size: 13px; color: var(--gray); border-top: 1px solid var(--line); padding-top: 10px; }

/* ── Panel de transportista (perfil + tablero) ─────────── */
.check-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 12px;
  max-height: 180px; overflow-y: auto; padding: 10px; margin-top: 4px;
  border: 1px solid var(--line); border-radius: 10px;
}
.check-grid label, .dias-check label {
  display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--navy);
  cursor: pointer; font-weight: 500;
}
.check-grid input, .dias-check input { accent-color: var(--accent); }
.dias-check { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 4px; }
.check-grid legend, .dias-check legend { }
.postularme-box { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.contraoferta-input {
  flex: 1; min-width: 160px; padding: 10px 12px; border: 1.5px solid var(--line);
  border-radius: 10px; font-size: 14px; font-family: inherit; color: var(--navy); outline: none;
}
.contraoferta-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,196,140,0.1); }

/* ── Panel de staff ────────────────────────────────────── */
.staff-badge {
  font-size: 10px; font-weight: 800; letter-spacing: 1px; background: var(--accent);
  color: var(--white); padding: 2px 8px; border-radius: 6px; margin-left: 8px; vertical-align: middle;
}
.staff-count {
  font-size: 13px; font-weight: 800; background: var(--navy); color: var(--white);
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.staff-tag {
  font-size: 11px; font-weight: 700; background: var(--bg); color: var(--gray);
  padding: 2px 8px; border-radius: 6px; margin-left: 6px; text-transform: uppercase; letter-spacing: 0.4px;
}
.staff-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.priv-item-col { flex-direction: column; align-items: stretch; }

/* ── Reputación desglosada + documentos del perfil ─────── */
.dtag-red { background:rgba(224,57,57,0.12); color:#B81A1A; }
.dtag-gray { background:var(--bg); color:var(--gray); }
.aspecto-row {
  display:flex; align-items:center; justify-content:space-between;
  padding:8px 0; border-bottom:1px solid var(--line); font-size:13px; color:var(--navy);
}
.aspecto-row:last-child { border-bottom:none; }
.aspecto-total { font-weight:700; }
.aspecto-total strong { color:var(--accent-dark); }

.staff-doc-links { margin-top: 4px; font-size: 12.5px; }
.staff-doc-links .link-btn { margin-right: 4px; }
