  :root{
    --ink:#0B0B0B;
    --ink-soft:#1A1A1A;
    --panel-bg:#F4F6F8;
    --card-bg:#FFFFFF;
    --border:#DCE3E8;
    --text-primary:#1A1A1A;
    --text-secondary:#5C6B7A;
    --accent-teal:#62A3B4;
    --accent-teal-dark:#4A8494;
    --accent-blue:#4A8494;
    --accent-orange:#F2991E;
    --error:#B3543F;
    --error-bg:#FBEEEA;

    --c-autoservicios:#4A7A96;
    --c-departamentales:#6B5B95;
    --c-mayoreo:#8A9A5B;
    --c-conveniencia:#C97B4A;
    --c-farmacias:#4A9B8E;
    --c-clubes:#A65D6B;
  }

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

  body{
    font-family:'Inter', sans-serif;
    color:var(--text-primary);
    min-height:100vh;
    background:var(--panel-bg);
  }

  .layout{
    display:grid;
    grid-template-columns: 1.05fr 1fr;
    min-height:100vh;
  }

  /* ---------- PANEL IZQUIERDO (marca) ---------- */
  .brand-panel{
    background:
      radial-gradient(circle at 1px 1px, rgba(255,255,255,0.06) 1px, transparent 0) 0 0/28px 28px,
      linear-gradient(160deg, var(--ink) 0%, #16212F 100%);
    color:#EAF0F4;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    padding:56px 64px;
    position:relative;
    overflow:hidden;
  }

  .brand-top{ position:relative; z-index:2; }

  .eyebrow{
    font-family:'IBM Plex Mono', monospace;
    font-size:12px;
    letter-spacing:0.14em;
    text-transform:uppercase;
    color:#8FA3B3;
    margin-bottom:22px;
  }

  .headline{
    font-family:'Poppins', sans-serif;
    font-weight:600;
    font-size:clamp(32px, 3.6vw, 46px);
    line-height:1.12;
    max-width:520px;
    letter-spacing:-0.01em;
  }

  .subhead{
    margin-top:18px;
    font-size:15.5px;
    line-height:1.6;
    color:#B7C4CE;
    max-width:420px;
  }

  /* ambient sparkline */
  .pulse{
    position:relative;
    z-index:2;
    display:flex;
    align-items:flex-end;
    gap:6px;
    height:64px;
    margin-top:46px;
  }
  .pulse span{
    display:block;
    width:7px;
    border-radius:3px 3px 0 0;
    background:linear-gradient(180deg, rgba(46,125,107,0.85), rgba(46,125,107,0.15));
    animation: sway 5.5s ease-in-out infinite;
  }
  .pulse span:nth-child(1){height:38%; animation-delay:-0.2s;}
  .pulse span:nth-child(2){height:62%; animation-delay:-1.1s;}
  .pulse span:nth-child(3){height:44%; animation-delay:-2.4s;}
  .pulse span:nth-child(4){height:80%; animation-delay:-0.6s;}
  .pulse span:nth-child(5){height:52%; animation-delay:-3.2s;}
  .pulse span:nth-child(6){height:70%; animation-delay:-1.8s;}
  .pulse span:nth-child(7){height:34%; animation-delay:-2.9s;}
  .pulse span:nth-child(8){height:58%; animation-delay:-0.9s;}
  .pulse span:nth-child(9){height:46%; animation-delay:-3.7s;}
  .pulse span:nth-child(10){height:66%; animation-delay:-1.4s;}
  .pulse span:nth-child(11){height:40%; animation-delay:-2.1s;}
  .pulse span:nth-child(12){height:56%; animation-delay:-0.3s;}

  @keyframes sway{
    0%, 100%{ transform:scaleY(1); opacity:0.85; }
    50%{ transform:scaleY(1.18); opacity:1; }
  }

  @media (prefers-reduced-motion: reduce){
    .pulse span{ animation:none; }
  }

  /* franja de canales — elemento de firma */
  .channels{
    position:relative;
    z-index:2;
  }
  .channels-label{
    font-family:'IBM Plex Mono', monospace;
    font-size:11px;
    letter-spacing:0.1em;
    text-transform:uppercase;
    color:#7C90A0;
    margin-bottom:14px;
  }
  .channel-grid{
    display:grid;
    grid-template-columns: repeat(2, auto);
    gap:10px 24px;
  }
  .channel-item{
    display:flex;
    align-items:center;
    gap:9px;
    font-size:13px;
    color:#C7D2DA;
  }
  .channel-dot{
    width:8px; height:8px;
    border-radius:50%;
    flex-shrink:0;
  }

  /* ---------- PANEL DERECHO (login) ---------- */
  .login-panel{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:40px;
  }

  .login-card{
    width:100%;
    max-width:390px;
  }

  .mark{
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:38px;
  }
  .mark-logo{
    height:30px;
    width:auto;
    flex-shrink:0;
    display:block;
  }
  .mark-text{
    font-family:'Poppins', sans-serif;
    font-weight:600;
    font-size:15px;
    color:var(--text-primary);
  }
  .mark-text span{
    display:block;
    font-family:'Inter', sans-serif;
    font-weight:400;
    font-size:12px;
    color:var(--text-secondary);
    margin-top:1px;
  }

  .card-title{
    font-family:'Poppins', sans-serif;
    font-size:23px;
    font-weight:600;
    margin-bottom:6px;
  }
  .card-sub{
    font-size:13.5px;
    color:var(--text-secondary);
    margin-bottom:30px;
  }

  .field{ margin-bottom:18px; }
  .field label{
    display:block;
    font-size:12.5px;
    font-weight:600;
    color:var(--text-primary);
    margin-bottom:7px;
  }
  .field input{
    width:100%;
    padding:12px 14px;
    border:1.5px solid var(--border);
    border-radius:9px;
    font-family:'Inter', sans-serif;
    font-size:14.5px;
    color:var(--text-primary);
    background:#FCFDFD;
    transition:border-color .15s ease, box-shadow .15s ease;
  }
  .field input:focus{
    outline:none;
    border-color:var(--accent-blue);
    box-shadow:0 0 0 3px rgba(59,110,145,0.12);
  }

  .btn-primary{
    width:100%;
    padding:13px;
    border:none;
    border-radius:9px;
    background:var(--accent-teal);
    color:#fff;
    font-family:'Inter', sans-serif;
    font-weight:600;
    font-size:14.5px;
    cursor:pointer;
    margin-top:8px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:9px;
    transition:background .15s ease, transform .1s ease;
  }
  .btn-primary:hover{ background:var(--accent-teal-dark); }
  .btn-primary:active{ transform:translateY(1px); }
  .btn-primary:disabled{ opacity:0.65; cursor:default; }

  .spinner{
    width:15px; height:15px;
    border-radius:50%;
    border:2px solid rgba(255,255,255,0.4);
    border-top-color:#fff;
    animation:spin .7s linear infinite;
    display:none;
  }
  @keyframes spin{ to{ transform:rotate(360deg); } }

  .error-box{
    display:none;
    background:var(--error-bg);
    color:var(--error);
    border:1px solid rgba(179,84,63,0.25);
    padding:11px 13px;
    border-radius:8px;
    font-size:13px;
    margin-bottom:18px;
  }

  .card-footer{
    margin-top:28px;
    padding-top:18px;
    border-top:1px solid var(--border);
    font-family:'IBM Plex Mono', monospace;
    font-size:11px;
    color:#9AA8B3;
    display:flex;
    justify-content:space-between;
  }

  .config-banner{
    display:none;
    margin-top:22px;
    padding:12px 14px;
    background:#FFF7E8;
    border:1px solid #F0DBA8;
    border-radius:8px;
    font-size:12px;
    color:#8A6A1E;
    line-height:1.5;
  }
  .config-banner code{
    font-family:'IBM Plex Mono', monospace;
    background:rgba(0,0,0,0.06);
    padding:1px 5px;
    border-radius:4px;
  }

  /* =========================================================
   PANTALLA DE SESIÓN ACTIVA
   ========================================================= */

.session-card {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

/* Logo */
.session-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 28px;
}

.session-logo img {
    width: 82px;
    height: 82px;
    object-fit: contain;
    border-radius: 20px;
    background: #fff;
    padding: 10px;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Estado */
.session-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    background: #eaf7f2;
    color: var(--accent-teal-dark);

    font-size: 12px;
    font-weight: 700;

    padding: 7px 13px;
    border-radius: 30px;

    margin-bottom: 18px;

    border: 1px solid rgba(46, 125, 107, 0.10);
}

.session-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2e9d72;

    box-shadow:
        0 0 0 4px rgba(46, 157, 114, 0.13);

    animation: sessionPulse 2s infinite;
}

@keyframes sessionPulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(46, 157, 114, 0.12);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(46, 157, 114, 0.04);
    }
}

/* Nombre */
.session-name {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;

    color: var(--text-primary);

    margin-bottom: 6px;
}

/* Empresa / rol */
.session-company {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
}

/* =========================================================
   INFORMACIÓN DE SESIÓN
   ========================================================= */

.session-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;

    margin-bottom: 24px;
}

.session-stat {
    position: relative;

    background: var(--card-bg);

    border: 1px solid var(--border);
    border-radius: 14px;

    padding: 16px 17px;

    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease;
}

.session-stat:hover {
    transform: translateY(-2px);

    border-color: rgba(46, 125, 107, 0.25);

    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.06);
}

.session-stat-label {
    font-size: 10px;
    text-transform: uppercase;

    letter-spacing: .08em;

    color: var(--text-secondary);

    margin-bottom: 7px;

    font-weight: 700;
}

.session-stat-value {
    font-family: 'IBM Plex Mono', monospace;

    font-size: 14px;
    font-weight: 500;

    color: var(--text-primary);

    word-break: break-word;
}

/* =========================================================
   BOTÓN CERRAR SESIÓN
   ========================================================= */

.btn-secondary {
    width: 100%;

    padding: 13px 16px;

    border: 1.5px solid #e2e6eb;
    border-radius: 11px;

    background: #fff;
    color: var(--text-primary);

    font-family: 'Inter', sans-serif;

    font-weight: 600;
    font-size: 14px;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    transition:
        all .18s ease;
}

.btn-secondary:hover {
    border-color: #dc3545;
    color: #dc3545;

    background: #fff8f8;

    transform: translateY(-1px);

    box-shadow:
        0 6px 16px rgba(220, 53, 69, 0.08);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* =========================================================
   MENSAJE DE SEGURIDAD
   ========================================================= */

.placeholder-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    margin-top: 18px;

    padding: 13px 15px;

    background: #f7faf9;

    border: 1px solid #e7eeeb;
    border-radius: 11px;

    font-size: 12px;

    color: var(--text-secondary);

    line-height: 1.5;
}

.placeholder-note::before {
    content: "\f023";

    font-family: "Font Awesome 7 Free";
    font-weight: 900;

    color: var(--accent-teal);

    font-size: 13px;

    margin-top: 2px;
}

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

@media (max-width: 880px) {

    .layout {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        padding: 40px 32px;
        min-height: 280px;
    }

    .headline {
        font-size: 28px;
    }

    .channel-grid {
        grid-template-columns: repeat(2, auto);
    }

    .login-panel {
        padding: 32px 24px 56px;
    }

    .session-card {
        max-width: 100%;
    }
}

@media (max-width: 520px) {

    .session-logo img {
        width: 68px;
        height: 68px;
        border-radius: 17px;
    }

    .session-name {
        font-size: 24px;
    }

    .session-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .session-stat {
        padding: 14px;
    }

    .session-status {
        margin-bottom: 14px;
    }
}
/* =========================================================
   REDIRECCIÓN DE SESIÓN
   ========================================================= */

.session-redirect {
    margin-top: 20px;

    padding: 16px 17px 13px;

    background: #f8fbfa;

    border: 1px solid #e3eeea;
    border-radius: 14px;

    overflow: hidden;
}

/* Parte superior */
.session-redirect-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Icono */
.session-redirect-icon {
    flex: 0 0 38px;

    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background: #e6f5ef;
    color: var(--accent-teal);

    font-size: 15px;

    box-shadow:
        0 3px 8px rgba(46, 125, 107, 0.08);
}

/* Contenido */
.session-redirect-content {
    flex: 1;
    min-width: 0;
}

.session-redirect-text {
    color: var(--text-primary);

    font-family: 'Inter', sans-serif;

    font-size: 13px;
    font-weight: 700;

    line-height: 1.3;
}

.session-redirect-message {
    margin-top: 3px;

    color: var(--text-secondary);

    font-size: 11.5px;

    line-height: 1.4;
}

/* Contador */
.session-countdown {
    flex: 0 0 auto;

    min-width: 48px;

    padding: 7px 8px;

    border-radius: 9px;

    background: #ffffff;

    border: 1px solid #e4ebe8;

    text-align: center;

    color: var(--accent-teal-dark);
}

.session-countdown span {
    font-family: 'IBM Plex Mono', monospace;

    font-size: 15px;

    font-weight: 600;
}

.session-countdown small {
    font-family: 'Inter', sans-serif;

    font-size: 9px;

    color: var(--text-secondary);
}

/* =========================================================
   BARRA DE PROGRESO
   ========================================================= */

.session-progress {
    width: 100%;
    height: 4px;

    margin-top: 15px;

    background: #e6eeeb;

    border-radius: 20px;

    overflow: hidden;
}

.session-progress div {
    width: 0%;
    height: 100%;

    background: var(--accent-teal);

    border-radius: inherit;

    transition: width 1s linear;
}

/* =========================================================
   FOOTER
   ========================================================= */

.session-redirect-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 10px;

    margin-top: 9px;

    font-size: 9.5px;

    color: var(--text-secondary);
}

.session-redirect-footer span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.session-redirect-footer i {
    color: var(--accent-teal);
}

/* =========================================================
   ESTADO AUTENTICADO
   ========================================================= */

.session-authenticated {
    display: flex;
    align-items: center;
    gap: 6px;

    color: #278563;
}

.session-authenticated span {
    width: 7px;
    height: 7px;

    display: inline-block;

    border-radius: 50%;

    background: #2e9d72;

    box-shadow:
        0 0 0 3px rgba(46, 157, 114, 0.10);
}

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

@media (max-width: 520px) {

    .session-redirect {
        padding: 14px;
    }

    .session-redirect-icon {
        width: 34px;
        height: 34px;

        flex-basis: 34px;

        border-radius: 9px;
    }

    .session-redirect-message {
        font-size: 10.5px;
    }

    .session-countdown {
        min-width: 43px;
    }

    .session-redirect-footer {
        font-size: 9px;
    }
}