#adminView.admin-v2-enabled > :not(#adminV2Root){
  display:none !important;
}

#adminV2Root{
  --v2-blue:#1463ff;
  --v2-blue-dark:#0a3c9f;
  --v2-navy:#0d203f;
  --v2-text:#162b4d;
  --v2-muted:#6c7f9e;
  --v2-line:#e1eaf7;
  --v2-soft:#f5f8fd;
  --v2-green:#12844e;
  --v2-red:#b83a3a;
  --v2-amber:#a36500;

  color:var(--v2-text);
  width:100%;
}

#adminV2Root *{
  box-sizing:border-box;
}

.v2-shell{
  max-width:1440px;
  margin:0 auto;
  padding:18px 10px 60px;
}

.v2-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
  margin-bottom:22px;
}

.v2-header h1{
  margin:3px 0 5px;
  font-size:30px;
  line-height:1.15;
  color:var(--v2-navy);
}

.v2-header p{
  margin:0;
  color:var(--v2-muted);
  font-weight:600;
}

.v2-role{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  background:#eaf2ff;
  color:#0b54d4;
  font-size:11px;
  font-weight:900;
  letter-spacing:.07em;
  text-transform:uppercase;
}

.v2-header-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.v2-btn{
  min-height:40px;
  padding:0 15px;
  border:1px solid #cbdaf2;
  border-radius:11px;
  background:white;
  color:#163f7d;
  font-weight:850;
  cursor:pointer;
  transition:.15s ease;
}

.v2-btn:hover{
  border-color:#8cb3f5;
  transform:translateY(-1px);
}

.v2-btn.primary{
  background:var(--v2-blue);
  border-color:var(--v2-blue);
  color:white;
}

.v2-btn.danger{
  color:var(--v2-red);
  border-color:#efcaca;
}

.v2-btn.small{
  min-height:34px;
  padding:0 11px;
  font-size:12px;
}

.v2-stats{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin-bottom:20px;
}

.v2-stat{
  background:white;
  border:1px solid var(--v2-line);
  border-radius:15px;
  padding:16px;
}

.v2-stat span{
  display:block;
  color:var(--v2-muted);
  font-size:12px;
  font-weight:750;
  margin-bottom:6px;
}

.v2-stat strong{
  font-size:25px;
  color:var(--v2-navy);
}

.v2-tabs{
  display:flex;
  gap:7px;
  padding:5px;
  background:#edf3fb;
  border-radius:13px;
  width:max-content;
  max-width:100%;
  margin-bottom:18px;
}

.v2-tab{
  border:0;
  border-radius:9px;
  padding:9px 15px;
  color:#587090;
  background:transparent;
  font-weight:850;
  cursor:pointer;
}

.v2-tab.active{
  color:#113c7e;
  background:white;
  box-shadow:0 2px 8px rgba(28,57,104,.10);
}

.v2-panel{
  background:white;
  border:1px solid var(--v2-line);
  border-radius:17px;
  overflow:hidden;
}

.v2-panel-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  padding:18px 20px;
  border-bottom:1px solid var(--v2-line);
}

.v2-panel-head h2{
  margin:0;
  font-size:19px;
  color:var(--v2-navy);
}

.v2-panel-head p{
  margin:4px 0 0;
  color:var(--v2-muted);
  font-size:13px;
}

.v2-search{
  width:260px;
  max-width:100%;
  height:40px;
  border:1px solid #cddaf0;
  border-radius:10px;
  padding:0 12px;
  background:white;
}

.v2-list{
  width:100%;
}

.v2-row{
  display:grid;
  grid-template-columns:minmax(190px,1.6fr) 130px 120px 150px 150px 120px 110px;
  gap:12px;
  align-items:center;
  padding:14px 20px;
  border-bottom:1px solid #edf1f7;
}

.v2-row.header{
  background:#f6f9fd;
  color:#60728d;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.05em;
  font-weight:900;
}

.v2-row:last-child{
  border-bottom:0;
}

.v2-name{
  font-weight:900;
  color:var(--v2-navy);
}

.v2-sub{
  display:block;
  margin-top:3px;
  color:var(--v2-muted);
  font-size:12px;
  font-weight:650;
}

.v2-badge{
  display:inline-flex;
  align-items:center;
  width:max-content;
  padding:5px 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:900;
}

.v2-badge.active{
  color:#087443;
  background:#e8f7ef;
}

.v2-badge.suspended{
  color:#a14f00;
  background:#fff3df;
}

.v2-badge.blue{
  color:#0b53cc;
  background:#eaf2ff;
}

.v2-modules{
  display:flex;
  gap:5px;
  flex-wrap:wrap;
}

.v2-module{
  display:inline-flex;
  padding:4px 7px;
  border-radius:7px;
  background:#edf7f1;
  color:#087447;
  font-size:11px;
  font-weight:850;
}

.v2-empty{
  padding:40px 20px;
  text-align:center;
  color:var(--v2-muted);
}

.v2-grid-two{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

.v2-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.v2-field.full{
  grid-column:1 / -1;
}

.v2-field label{
  font-size:12px;
  color:#365176;
  font-weight:850;
}

.v2-field input,
.v2-field select{
  width:100%;
  height:42px;
  border:1px solid #cad8ed;
  border-radius:10px;
  padding:0 11px;
  color:#17345d;
  background:white;
  font-weight:700;
}

.v2-checks{
  display:flex;
  gap:18px;
  flex-wrap:wrap;
  padding-top:7px;
}

.v2-checks label{
  display:flex;
  align-items:center;
  gap:7px;
  font-weight:800;
  color:#294a76;
}

.v2-modal-backdrop{
  position:fixed;
  inset:0;
  z-index:99999;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(7,22,48,.52);
}

.v2-modal{
  width:min(680px,100%);
  max-height:90vh;
  overflow:auto;
  background:white;
  border-radius:18px;
  box-shadow:0 30px 90px rgba(0,0,0,.25);
}

.v2-modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  padding:18px 20px;
  border-bottom:1px solid var(--v2-line);
}

.v2-modal-head h3{
  margin:0;
  color:var(--v2-navy);
}

.v2-modal-body{
  padding:20px;
}

.v2-modal-foot{
  display:flex;
  justify-content:flex-end;
  gap:9px;
  padding:16px 20px;
  border-top:1px solid var(--v2-line);
}

.v2-ip-box{
  border:1px solid var(--v2-line);
  border-radius:12px;
  padding:12px;
  background:#f8fafd;
}

.v2-ip-box strong{
  display:block;
  color:var(--v2-navy);
  margin-bottom:5px;
}

.v2-ip{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  color:#294c79;
}

.v2-message{
  margin:0 0 14px;
  padding:11px 13px;
  border-radius:10px;
  background:#eef5ff;
  color:#174b96;
  font-weight:750;
  display:none;
}

.v2-message.show{
  display:block;
}

@media(max-width:1150px){
  .v2-row{
    grid-template-columns:minmax(180px,1.5fr) 110px 120px 130px 120px;
  }

  .v2-row > :nth-child(6),
  .v2-row > :nth-child(7){
    display:none;
  }
}

@media(max-width:800px){
  .v2-header{
    flex-direction:column;
  }

  .v2-stats{
    grid-template-columns:1fr 1fr;
  }

  .v2-row,
  .v2-row.header{
    grid-template-columns:1fr;
  }

  .v2-row.header{
    display:none;
  }

  .v2-grid-two{
    grid-template-columns:1fr;
  }
}


/* REDAC CLIENT MANAGE V2 */

.v2-help{
  display:block;
  margin-top:6px;
  color:#7488a5;
  font-size:11px;
  font-weight:700;
}

.v2-section{
  margin-top:8px;
  padding-top:18px;
  border-top:1px solid #e1eaf7;
}

.v2-section h4{
  margin:0 0 14px;
  color:#0d203f;
  font-size:16px;
}

.v2-ip-actions{
  margin-top:12px;
}

.v2-user-form{
  display:grid;
  grid-template-columns:
    minmax(120px,1fr)
    minmax(120px,1fr)
    150px
    minmax(180px,1.3fr)
    auto;
  gap:8px;
  margin-bottom:14px;
}

.v2-user-form input,
.v2-user-form select{
  min-width:0;
}

.v2-user-list{
  border:1px solid #e1eaf7;
  border-radius:12px;
  overflow:hidden;
}

.v2-user-row{
  display:grid;
  grid-template-columns:
    minmax(150px,1.2fr)
    150px
    120px
    minmax(160px,1fr)
    180px;
  gap:10px;
  align-items:center;
  padding:11px 13px;
  border-bottom:1px solid #edf1f7;
}

.v2-user-row:last-child{
  border-bottom:0;
}

.v2-user-header{
  background:#f6f9fd;
  color:#60728d;
  font-size:10px;
  font-weight:900;
  letter-spacing:.05em;
  text-transform:uppercase;
}

.v2-user-actions{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}

@media(max-width:900px){

  .v2-user-form{
    grid-template-columns:1fr;
  }

  .v2-user-row{
    grid-template-columns:1fr;
  }

  .v2-user-header{
    display:none;
  }
}


/* REDAC CLIENT MODAL LAYOUT V3 */

/*
 * Solo afecta al modal "Gestionar cliente".
 * No modifica otros formularios ni ventanas de REDAC.
 */

.v2-client-manage-modal{
  align-items:flex-start !important;
  justify-content:center !important;

  padding:24px !important;

  overflow-x:hidden !important;
  overflow-y:auto !important;

  box-sizing:border-box !important;
}

.v2-client-manage-panel{
  width:min(1080px, calc(100vw - 48px)) !important;
  max-width:1080px !important;

  max-height:calc(100vh - 48px) !important;

  margin:0 auto !important;

  overflow-x:hidden !important;
  overflow-y:auto !important;

  box-sizing:border-box !important;
}

.v2-client-manage-panel,
.v2-client-manage-panel *{
  box-sizing:border-box;
}

/* Evitar que el titulo quede pegado al borde superior */

.v2-client-manage-panel h2,
.v2-client-manage-panel h3{
  margin-top:0;
}

/* -------------------------------------------------------
   Servicios
   Corrige el checkbox gigante que se veia en IA
   ------------------------------------------------------- */

.v2-client-manage-modal .v2-checks{
  display:flex !important;
  align-items:center !important;
  flex-wrap:wrap !important;

  gap:14px 28px !important;

  width:100%;
}

.v2-client-manage-modal .v2-checks label{
  display:inline-flex !important;
  align-items:center !important;

  gap:8px !important;

  width:auto !important;
  min-width:0 !important;

  margin:0 !important;

  white-space:normal;
}

.v2-client-manage-modal
.v2-checks
input[type="checkbox"]{
  width:16px !important;
  height:16px !important;

  min-width:16px !important;
  max-width:16px !important;

  flex:0 0 16px !important;

  margin:0 !important;
  padding:0 !important;
}

/* -------------------------------------------------------
   Formulario para agregar usuarios
   ------------------------------------------------------- */

.v2-client-manage-modal .v2-user-form{
  display:grid !important;

  grid-template-columns:
    minmax(120px,1fr)
    minmax(140px,1fr)
    150px
    minmax(220px,1.45fr)
    auto !important;

  gap:10px !important;

  align-items:center !important;

  width:100% !important;

  overflow:visible !important;
}

.v2-client-manage-modal .v2-user-form input,
.v2-client-manage-modal .v2-user-form select{
  width:100% !important;
  min-width:0 !important;
}

.v2-client-manage-modal
.v2-user-form
#addClientUser{
  width:auto !important;

  min-width:105px !important;

  white-space:nowrap !important;
}

/* -------------------------------------------------------
   Tabla/listado de usuarios
   ------------------------------------------------------- */

.v2-client-manage-modal .v2-user-list{
  width:100% !important;

  overflow:hidden !important;
}

.v2-client-manage-modal .v2-user-row{
  display:grid !important;

  grid-template-columns:
    minmax(150px,1.25fr)
    145px
    120px
    minmax(150px,1fr)
    minmax(170px,auto) !important;

  gap:12px !important;

  align-items:center !important;

  width:100% !important;
}

.v2-client-manage-modal .v2-user-actions{
  display:flex !important;

  align-items:center !important;

  gap:7px !important;

  flex-wrap:wrap !important;

  min-width:0 !important;
}

/* No cortar botones de acciones */

.v2-client-manage-modal
.v2-user-actions
.v2-btn{
  white-space:nowrap !important;
}

/* -------------------------------------------------------
   Inputs principales
   ------------------------------------------------------- */

.v2-client-manage-modal .v2-grid-two{
  width:100% !important;
  min-width:0 !important;
}

.v2-client-manage-modal .v2-field{
  min-width:0 !important;
}

.v2-client-manage-modal .v2-field input,
.v2-client-manage-modal .v2-field select{
  max-width:100% !important;
}

/* -------------------------------------------------------
   Movil / pantallas pequenas
   ------------------------------------------------------- */

@media(max-width:900px){

  .v2-client-manage-modal{
    padding:10px !important;
  }

  .v2-client-manage-panel{
    width:calc(100vw - 20px) !important;

    max-width:calc(100vw - 20px) !important;

    max-height:calc(100vh - 20px) !important;
  }

  .v2-client-manage-modal .v2-user-form{
    grid-template-columns:1fr !important;
  }

  .v2-client-manage-modal .v2-user-row{
    grid-template-columns:1fr !important;

    gap:6px !important;
  }

  .v2-client-manage-modal .v2-user-header{
    display:none !important;
  }

  .v2-client-manage-modal
  .v2-user-form
  #addClientUser{
    width:100% !important;
  }
}



/* REDAC SPECIAL 28K UI CSS V1 */

.v2-special28k-modal{
  align-items:flex-start !important;
  justify-content:center !important;
  padding:24px !important;
  overflow-y:auto !important;
}

.v2-special28k-panel{
  width:min(920px,calc(100vw - 48px)) !important;
  max-width:920px !important;
  max-height:calc(100vh - 48px) !important;
  overflow-y:auto !important;
}

.v2-special28k{
  display:grid;
  gap:16px;
}

.v2-special28k-intro{
  display:grid;
  gap:5px;
}

.v2-special28k-intro strong{
  color:#0d203f;
  font-size:16px;
}

.v2-special28k-intro span{
  color:#687b98;
  font-size:12px;
  font-weight:700;
}

.v2-special28k-search{
  display:grid;
  grid-template-columns:minmax(260px,1fr) 110px auto;
  gap:9px;
}

.v2-special28k-search input{
  min-width:0;
  width:100%;
}

.v2-special28k-results{
  display:grid;
  gap:10px;
}

.v2-special28k-result{
  display:grid;
  grid-template-columns:minmax(240px,1fr) 125px auto;
  gap:14px;
  align-items:center;

  padding:14px;

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

  background:#fff;
}

.v2-special28k-target{
  display:grid;
  gap:4px;
  min-width:0;
}

.v2-special28k-target strong{
  color:#102341;
  font-size:14px;
}

.v2-special28k-target span{
  color:#687b98;
  font-size:11px;
  font-weight:700;
}

.v2-special28k-target code{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;

  color:#415b7d;
  font-size:10px;
}

.v2-special28k-uses{
  display:grid;
  gap:2px;
  text-align:center;
}

.v2-special28k-uses span{
  color:#71839c;
  font-size:10px;
  font-weight:800;
}

.v2-special28k-uses strong{
  color:#0d203f;
  font-size:23px;
}

.v2-special28k-actions{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

@media(max-width:800px){

  .v2-special28k-search{
    grid-template-columns:1fr;
  }

  .v2-special28k-result{
    grid-template-columns:1fr;
  }

  .v2-special28k-uses{
    text-align:left;
  }

  .v2-special28k-actions{
    justify-content:flex-start;
  }
}



/* REDAC SPECIAL 28K CAPACITY UI V2 */

.v2-special28k-panel{
  width:min(1180px,calc(100vw - 48px)) !important;
  max-width:1180px !important;
}

.v2-special28k-result{
  grid-template-columns:
    minmax(220px,1fr)
    minmax(390px,1.6fr)
    auto !important;
}

.v2-special28k-stats{
  display:grid;
  grid-template-columns:repeat(4,minmax(80px,1fr));
  gap:8px;
}

.v2-special28k-stats > div{
  display:grid;
  gap:3px;

  min-width:0;

  padding:9px 8px;

  border:1px solid #e3ebf6;
  border-radius:10px;

  background:#f8fafe;

  text-align:center;
}

.v2-special28k-stats span{
  color:#71839c;
  font-size:9px;
  font-weight:800;
}

.v2-special28k-stats strong{
  color:#0d203f;
  font-size:18px;
}

.v2-special28k-history-wrap{
  display:grid;
  gap:10px;

  margin-top:4px;
  padding-top:15px;

  border-top:1px solid #e1eaf7;
}

.v2-special28k-history-title{
  color:#102341;
  font-size:15px;
  font-weight:900;
}

.v2-special28k-history{
  display:grid;
  gap:10px;
}

.v2-special28k-history-summary{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:9px;
}

.v2-special28k-history-summary > div{
  display:grid;
  gap:3px;

  padding:11px;

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

  background:#f8fafe;
}

.v2-special28k-history-summary span{
  color:#71839c;
  font-size:10px;
  font-weight:800;
}

.v2-special28k-history-summary strong{
  color:#0d203f;
  font-size:19px;
}

.v2-special28k-history-list{
  display:grid;

  border:1px solid #e1eaf7;
  border-radius:12px;

  overflow:hidden;
}

.v2-special28k-history-row{
  display:grid;
  grid-template-columns:1fr auto;
  gap:15px;

  align-items:center;

  padding:11px 13px;

  border-bottom:1px solid #edf2f8;
}

.v2-special28k-history-row:last-child{
  border-bottom:0;
}

.v2-special28k-history-row > div{
  display:grid;
  gap:3px;
}

.v2-special28k-history-row strong{
  color:#102341;
  font-size:12px;
}

.v2-special28k-history-row span{
  color:#71839c;
  font-size:10px;
  font-weight:700;
}

.v2-special28k-history-row time{
  color:#71839c;
  font-size:10px;
  font-weight:700;

  white-space:nowrap;
}

.v2-special28k-actions .v2-btn:disabled{
  opacity:.45;
  cursor:not-allowed;
}

@media(max-width:950px){

  .v2-special28k-result{
    grid-template-columns:1fr !important;
  }

  .v2-special28k-stats{
    grid-template-columns:repeat(2,1fr);
  }

  .v2-special28k-history-summary{
    grid-template-columns:1fr;
  }

  .v2-special28k-history-row{
    grid-template-columns:1fr;
  }
}

