/* /dashboard.css?v=10 */
body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  font-weight:400;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
  background:linear-gradient(135deg,#1e2a78,#1fb5a9);
  min-height:100vh;
}

/* LOGIN */
.login-wrapper{
  width:420px;
  background:#fff;
  padding:50px 40px;
  border-radius:24px;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
  text-align:center;
  animation:fadeIn .5s ease;

  position:fixed;
  inset:0;
  margin:auto;
  height:fit-content;
  max-height:90vh;
}
.logo{width:90px;margin:0 0 20px;}
.login-wrapper h1{margin:0;font-size:26px;font-weight:800;color:#1e2a78;}
.subtitle{font-size:14px;margin:8px 0 20px;color:#666;}
.hint{font-size:12px;color:#64748b;margin:14px 0 0;line-height:1.35;}
.error-msg{color:#d93025;font-size:13px;margin-top:10px;min-height:18px;}

.login-btn{
  width:100%;
  padding:14px;
  border-radius:30px;
  border:0;
  font-weight:600;
  cursor:pointer;
  margin:0 0 12px;
  font-size:14px;
  transition:.2s ease;
}

/* ✅ Para iconos inyectados desde JS */
.login-btn.has-icon{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
}
.login-btn .btn-ic{
  width:18px;height:18px;flex:0 0 18px;display:inline-block;
}

.google-btn{background:#fff;border:1px solid #ddd;color:#0f172a;}
.google-btn:hover{background:#f5f5f5;}
.apple-btn{background:#000;color:#fff;}
.apple-btn:hover{opacity:.85;}

/* ✅ LOADING SCREEN (post-login) */
.loading-screen{
  position:fixed;
  inset:0;
  background:#ffffff;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  z-index:1000;
}
.loading-card{
  width:min(560px, 100%);
  border:1px solid #e5e7eb;
  border-radius:20px;
  box-shadow:0 20px 60px rgba(15,23,42,.10);
  padding:26px 22px;
}
.loading-title{
  font-weight:900;
  font-size:20px;
  color:#0f172a;
  margin-bottom:6px;
}
.loading-sub{
  font-size:14px;
  color:#475569;
  margin-bottom:14px;
}
.loading-row{
  display:flex;
  align-items:center;
  gap:10px;
}
.loading-small{
  font-size:12px;
  color:#64748b;
}

/* Spinner */
.spinner{
  width:18px;height:18px;
  border-radius:999px;
  border:3px solid #e5e7eb;
  border-top-color:#3F6AE0;
  animation:spin .8s linear infinite;
}
.spinner.sm{
  width:16px;height:16px;
  border-width:3px;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* DASHBOARD */
.dashboard{
  display:none;
  width:100%;
  min-height:100vh;
  background:#f4f6fb;
  flex-direction:column;
}
.topbar{
  height:70px;
  background:#fff;
  border-bottom:1px solid #e5e7eb;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 30px;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  color:#1e2a78;
}

/* ✅ LOGO IZQUIERDA: MÁS GRANDE, SIN CAMBIAR ALTURA DE TOPBAR
   - Alto fijo (cabe en 70px)
   - Ancho dinámico (logos rectangulares se ven bien)
   - object-fit: contain (no recorta) */
.brand img{
  height:46px;       /* antes 36px */
  width:auto;        /* dinámico */
  max-width:150px;   /* evita que un logo muy ancho rompa el layout */
  border-radius:10px;
  object-fit:contain; /* antes cover (recortaba) */
  background:#fff;
  box-shadow:0 6px 18px rgba(15,23,42,.08);
  display:block;
}

.topbar-right{display:flex;align-items:center;gap:12px;}

/* ✅ Plan pill preparado para icono a la izquierda (si el HTML agrega <img>) */
.plan-pill{
  background:#0f172a;
  color:#fff;
  font-weight:700;
  font-size:12px;
  padding:8px 12px;
  border-radius:999px;

  display:inline-flex;
  align-items:center;
  gap:8px;
}
.plan-pill img{
  width:16px;
  height:16px;
  object-fit:contain;
  display:block;
}

.logout-btn{
  padding:10px 18px;
  border-radius:14px;
  border:0;
  background:linear-gradient(135deg,#3F6AE0,#27D3C3);
  color:#fff;
  font-weight:600;
  cursor:pointer;
  transition:.2s;
}
.logout-btn:hover{opacity:.85;}

.main{display:flex;flex:1;min-height:calc(100vh - 70px);}

.sidebar{
  width:300px;
  background:#1e2a78;
  color:#fff;
  padding:30px;
  overflow-y:auto;
}
/* Usuario (sidebar) + avatar circular con marco blanco */
.user-block{
  margin:0 0 18px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.user-block .avatar-wrap{
  width:72px;
  height:72px;
  border-radius:999px;
  background:#fff;
  padding:4px;
  box-shadow:0 10px 30px rgba(0,0,0,.18);
  overflow:hidden;
}

.user-block .avatar{
  width:100%;
  height:100%;
  border-radius:999px;
  object-fit:cover;
  display:block;
}

.user-block h3{margin:0;font-size:16px;}
.user-block p{margin:5px 0 0;font-size:13px;opacity:.85;}
.sidebar-tools{margin:0 0 14px;}
.search,.select{
  width:100%;
  border:0;
  outline:0;
  border-radius:12px;
  padding:10px;
  font-size:13px;
  margin:0 0 10px;
}

.count-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:6px;
}
.count{font-size:12px;opacity:.85;}
.mini-btn{
  padding:8px 10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.10);
  color:#fff;
  cursor:pointer;
  font-weight:700;
  font-size:12px;
}
.mini-btn:hover{background:rgba(255,255,255,.16);}

/* ✅ TAB (Auditorías) */
.tab-btn{
  width:100%;
  border:0;
  cursor:pointer;
  padding:12px 12px;
  border-radius:12px;
  background:#ffffff;
  color:#0f172a;
  font-weight:800;
  font-size:13px;
  text-align:left;
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-top:10px;
  transition:.15s ease;
}
.tab-btn:hover{transform:translateY(-1px);}
.tab-btn.active{
  outline:2px solid rgba(255,255,255,.35);
}

.tab-panel{
  margin-top:10px;
  border-radius:12px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.12);
  padding:10px;
}

.panel-loading{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px;
}
.panel-loading-text{
  font-size:12px;
  opacity:.9;
}

.audit-names{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.audit-name-item{
  padding:10px;
  border-radius:12px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.10);
  cursor:pointer;
  transition:.15s ease;
}
.audit-name-item:hover{background:rgba(255,255,255,.18);}
.audit-name-item.active{
  background:rgba(255,255,255,.22);
  border-color:rgba(255,255,255,.22);
}
.audit-name-t1{font-weight:900;font-size:13px;line-height:1.2;}
.audit-name-t2{font-size:12px;opacity:.9;margin-top:6px;line-height:1.25;}

.load-more{
  width:100%;
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(255,255,255,.12);
  color:#fff;
  cursor:pointer;
  font-weight:900;
  font-size:12px;
}
.load-more:hover{background:rgba(255,255,255,.18);}

.content{flex:1;padding:40px;overflow-y:auto;}
.content h2{margin:0 0 6px;font-size:22px;font-weight:900;color:#0f172a;}
.detail-sub{font-size:13px;color:#475569;margin-bottom:14px;}

.detail-panel{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:18px;
  box-shadow:0 10px 30px rgba(15,23,42,.06);
}

/* ✅ Estilo tipo app (texto en líneas, no cajas por campo) */
.audit-top{
  display:flex;
  gap:14px;
  align-items:flex-start;
  margin-bottom:14px;
}

.audit-company-logo{
  width:44px;
  height:44px;
  object-fit:contain;
  border-radius:10px;
  background:#fff;
  box-shadow:0 6px 18px rgba(15,23,42,.08);
  border:1px solid #eef2f7;
}

.audit-top-text{
  flex:1;
  min-width:0;
}

.audit-company-name{
  margin:0 0 6px;
  font-family:Poppins,Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  font-size:22px;
  font-weight:800;
  color:#0f172a;
  line-height:1.15;
}

.audit-lines{
  margin:0;
  padding:0;
}

.audit-line{
  margin:6px 0;
  font-size:14px;
  color:#0f172a;
  line-height:1.35;
}

.audit-label{
  font-weight:800;
}

.audit-value{
  font-weight:400;
  color:#0f172a;
}

.audit-box{
  margin-top:14px;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:14px;
  background:#fff;
}

.audit-box .audit-line{
  margin:5px 0;
}

/* Ajuste: no todo en “900” */
.content h2{
  margin:0 0 6px;
  font-size:22px;
  font-weight:800;
  font-family:Poppins,Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:#0f172a;
}
.detail-sub{
  font-size:13px;
  color:#475569;
  margin-bottom:14px;
  font-weight:400;
}

.actions{display:flex;gap:10px;justify-content:flex-end;margin-top:14px;flex-wrap:wrap;}
.btn{
  border:0;
  cursor:pointer;
  padding:12px 14px;
  border-radius:14px;
  font-weight:700;
  font-size:13px;
  transition:.15s ease;
}
.btn:hover{transform:translateY(-1px);}
.btn-outline{background:#fff;border:1px solid #e5e7eb;color:#0f172a;}
.btn-danger{background:#fff;border:1px solid #fecaca;color:#b91c1c;}

/* ✅ NUEVO: Adjuntos (preview/descarga) */
.attach{
  margin-top:14px;
  border-top:1px solid #e5e7eb;
  padding-top:14px;
}
.attach-title{
  font-weight:900;
  font-size:13px;
  color:#0f172a;
  margin-bottom:10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.attach-count{
  font-size:12px;
  color:#64748b;
  font-weight:800;
}
.attach-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.attach-item{
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:10px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.attach-left{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}
.attach-name{
  font-weight:900;
  font-size:13px;
  color:#0f172a;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:560px;
}
.attach-meta{
  font-size:12px;
  color:#64748b;
  font-weight:700;
}
.attach-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.btn-small{
  padding:10px 12px;
  border-radius:12px;
  font-weight:900;
  font-size:12px;
}
.btn-primary{
  background:linear-gradient(135deg,#3F6AE0,#27D3C3);
  color:#fff;
}
.btn-primary:hover{opacity:.9;}
.btn-ghost{
  background:#fff;
  border:1px solid #e5e7eb;
  color:#0f172a;
}
.btn-ghost:hover{background:#f8fafc;}

.empty{padding:22px 14px;text-align:center;}
.empty-title{font-weight:900;margin-bottom:6px;}
.empty-sub{font-size:13px;color:#475569;}

.toast{
  position:fixed;
  right:18px;
  bottom:18px;
  background:#0b1220;
  color:#fff;
  border-radius:14px;
  padding:12px 14px;
  font-size:13px;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
  max-width:min(520px,calc(100vw - 36px));
  z-index:999;
}

@keyframes fadeIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}

@media (max-width:980px){
  .main{flex-direction:column;}
  .sidebar{width:auto;}
  .detail-grid{grid-template-columns:1fr;}
  .attach-name{max-width:100%;}
}

/* =======================================================================
   READY2AUDIT — Adjuntos inline (PDF / Galería / Videos) + Lightbox
   (SOLO AÑADIR — no reemplaza tu CSS existente)
   ======================================================================= */

.r2a-attach-section { margin-top: 14px; }
.r2a-attach-h {
  font-weight: 800;
  font-size: 13px;
  color: #0f172a;
  margin: 10px 0 10px;
}

.r2a-pdf-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.r2a-pdf-card {
  width: 100%;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;

  padding: 10px 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 10px 24px rgba(0,0,0,.06);

  cursor: pointer;
  text-align: left;
}

.r2a-pdf-card:hover {
  border-color: rgba(63,106,224,.35);
  box-shadow: 0 16px 34px rgba(0,0,0,.08);
}

.r2a-pdf-ic { width: 40px; height: 40px; display: block; }
.r2a-pdf-t { min-width: 0; }
.r2a-pdf-n {
  font-weight: 900;
  font-size: 13px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.r2a-pdf-p {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(15,23,42,.60);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.r2a-pdf-open {
  font-weight: 900;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(63,106,224,.10);
  color: #1f3fb6;
}

/* Galería */
.r2a-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 1100px) {
  .r2a-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .r2a-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.r2a-thumb {
  padding: 0;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
}

.r2a-thumb:hover {
  border-color: rgba(39,211,195,.40);
  box-shadow: 0 16px 34px rgba(0,0,0,.08);
}

.r2a-thumb-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  background: #f1f5f9;
}

.r2a-thumb-cap {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(15,23,42,.70);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Videos */
.r2a-video-list { display: grid; gap: 12px; }
.r2a-video-row {
  padding: 10px 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
}
.r2a-video-title {
  font-weight: 900;
  font-size: 13px;
  color: #0f172a;
  margin-bottom: 8px;
}
.r2a-video {
  width: 100%;
  border-radius: 12px;
  background: #0b1220;
}

/* Lightbox */
.r2a-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.r2a-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
}
.r2a-lightbox-card {
  position: relative;
  z-index: 2;
  width: min(1100px, 96vw);
  height: min(720px, 90vh);
  border-radius: 18px;
  overflow: hidden;
  background: #0b1220;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.r2a-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.r2a-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.10);
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}
.r2a-lightbox-close:hover {
  background: rgba(255,255,255,.16);
}