:root {
  --azul-principal: #1565c0;
  --azul-sec: #2196f3;
  --gris-bg: #f7fafd;
  --gris-bar: #e9eef6;
  --gris-txt: #555;
  --azul-sidebar: #1565c0;
  --azul-hover: #0d47a1;
  --shadow: 0 6px 24px -4px rgba(80,80,100,0.11), 0 1.5px 8px rgba(20,44,60,0.06);
  --borde-radius: 18px;
  --espacio: 18px;
  --font: 'Segoe UI', Arial, sans-serif;
}body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f7fa;
}
.main-layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 220px;
  background: #154577;
  color: white;
  padding: 30px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sidebar .logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
}
.sidebar .logo img {
  width: 60px;
  border-radius: 50%;
  margin-bottom: 8px;
}
.sidebar nav ul {
  list-style: none;
  padding: 0;
  width: 100%;
}
.sidebar nav ul li {
  padding: 12px 10px;
  margin: 10px 0;
  cursor: pointer;
  border-radius: 6px;
  transition: background .2s;
}
.sidebar nav ul li.active,
.sidebar nav ul li:hover {
  background: #3162a5;
  font-weight: bold;
}
.main-content {
  flex: 1;
  padding: 40px;
}
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #e6eef7;
  border-radius: 8px;
  margin-bottom: 35px;
  padding: 14px 22px;
}
.login-card {
  max-width: 400px;
  margin: 80px auto;
  background: white;
  border-radius: 15px;
  box-shadow: 0 6px 22px #bccae0aa;
  padding: 40px;
}
h2, h3 {
  color: #154577;
}
input[type="text"], input[type="password"], input[type="file"], input[placeholder] {
  margin: 7px 3px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #bbb;
  width: 98%;
  max-width: 320px;
}
button, .btn-main {
  margin: 3px;
  padding: 7px 18px;
  border-radius: 6px;
  background: #246dd4;
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
}
.btn-main:hover { background: #194ea0; }
.btn-sm {
  background: #3162a5;
  font-size: 13px;
  padding: 4px 10px;
  margin: 0 2px;
}
.btn-del { background: #e54d4d; }
.btn-del:hover { background: #9c2323; }
.btn-sec { background: #bbb; color: #123; }
.btn-out { background: #bbb; color: #123; font-size: 14px; }
.dashboard-cards {
  display: flex; gap: 35px; margin: 25px 0 38px 0;
}
.card.stat {
  flex: 1; background: #3162a5;
  color: white; border-radius: 12px;
  box-shadow: 0 2px 6px #0002;
  text-align: center; padding: 30px 0;
  min-width: 120px;
}
.stat-title { font-size: 1.08em; margin-bottom: 8px; }
.stat-value { font-size: 2.6em; font-weight: bold; }
.table-users, .table-archivos, .table-activity {
  width: 100%;
  border-collapse: collapse;
  background: white;
  margin: 30px 0;
}
.table-users th, .table-users td,
.table-archivos th, .table-archivos td,
.table-activity th, .table-activity td {
  padding: 9px 14px;
  border-bottom: 1px solid #e3e3e3;
  text-align: left;
}
.carpeta-card {
  background: #e7eff9;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 12px 0;
  display: flex; align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 7px #cad5e7aa;
  font-size: 1.1em;
}
.carpeta-nombre { font-weight: 600; color: #3162a5;}
.estado-ok { color: #26ad5c; font-weight: bold; }
.estado-mal { color: #e54d4d; font-weight: bold; }
.estado-revisando { color: #ce9e3a; font-weight: bold; }
.upload-form { margin: 18px 0; }
.modal {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: #233d60cc; z-index: 10;
  display: flex; justify-content: center; align-items: center;
}
.modal-content {
  background: white; padding: 32px 40px;
  border-radius: 10px; min-width: 320px;
  box-shadow: 0 4px 16px #13325255;
}
.modal-actions { margin-top: 20px; }
.error { color: #e54d4d; margin-top: 10px; }
@media (max-width: 800px) {
  .main-layout { flex-direction: column; }
  .sidebar { flex-direction: row; width: 100vw; height: auto; }
  .main-content { padding: 10px; }
  .dashboard-cards { flex-direction: column; }
}
.breadcrumb-bar { margin: 12px 0 15px 0; font-size: 1.04em; }
.breadcrumb-link { color: #154577; cursor: pointer; text-decoration: underline; }
.breadcrumb-link:hover { color: #3162a5; }
.logo-login {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.logo-login img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  box-shadow: 0 0 14px #cbe8ff;
  background: #fff;
  object-fit: contain;
}
.carpetas-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
  margin-top: 12px;
}
.carpeta-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f5f8fb;
  border-radius: 18px;
  padding: 16px 6px 12px 6px;
  box-shadow: 0 2px 8px #0001;
  transition: box-shadow 0.2s;
}
.carpeta-card:hover {
  box-shadow: 0 4px 16px #2196f340;
}
.icono-carpeta {
  margin-bottom: 8px;
}
.carpeta-nombre {
  font-weight: 600;
  font-size: 1.14em;
  margin-bottom: 8px;
  text-align: center;
  color: #175fa4;
  word-break: break-all;
}
.carpeta-acciones {
  display: flex;
  gap: 8px;
}
.btn-carpeta-ver {
  background: #1976d2;
  color: #fff;
}
@media (max-width: 1200px) {
  .carpetas-grid { grid-template-columns: repeat(3, 1fr);}
}
@media (max-width: 850px) {
  .carpetas-grid { grid-template-columns: repeat(2, 1fr);}
}
@media (max-width: 600px) {
  .carpetas-grid { grid-template-columns: repeat(1, 1fr);}
  .sidebar {
    position: fixed;
    z-index: 12;
    left: 0;
    top: 0;
    width: 82vw;
    height: 100vh;
    background: #175fa4;
    transition: transform 0.25s;
    transform: translateX(-100%);
    box-shadow: 2px 0 14px #0005;
  }
  .sidebar.abierto { transform: translateX(0);}
  .main-layout { flex-direction: column; }
  .main-content { padding: 14px; }
  .menu-btn {
    display: block;
    position: fixed;
    left: 16px; top: 18px;
    z-index: 99;
    background: #175fa4;
    border: none;
    border-radius: 12px;
    width: 46px; height: 46px;
    justify-content: center;
    align-items: center;
    cursor: pointer;
  }
  .menu-btn span {
    display: block;
    width: 28px;
    height: 5px;
    margin: 4px auto;
    background: #fff;
    border-radius: 4px;
  }
}
@media (min-width: 601px) {
  .menu-btn { display: none;}
}
/* ===== RESPONSIVO MOBILE ===== */
@media (max-width: 900px) {
  .main-content {
    margin-left: 0 !important;
    padding: 15px 2vw !important;
    min-width: 0 !important;
  }
  .sidebar {
    width: 85vw !important;
    min-width: 0 !important;
    max-width: 97vw !important;
    left: 0 !important;
  }
}

@media (max-width: 700px) {
  .dashboard-cards {
    flex-direction: column !important;
    gap: 13px !important;
  }
  .dashboard-cards .card.stat {
    min-width: 0 !important;
    max-width: 99vw !important;
    margin: 0 auto !important;
    padding: 15px 0 13px 0 !important;
    font-size: 0.97em !important;
  }
  .carpetas-grid {
    grid-template-columns: repeat(auto-fit, minmax(138px,1fr)) !important;
    gap: 10px !important;
    padding: 0 1vw !important;
  }
  .carpeta-card {
    max-width: 96vw !important;
    padding: 14px 5px 12px 5px !important;
  }
}

@media (max-width: 600px) {
  .table-archivos,
  .table-users,
  .table-activity {
    display: block !important;
    width: 100% !important;
    background: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    font-size: 0.97em !important;
    padding: 0 !important;
    overflow-x: auto !important;
  }
  .table-archivos thead,
  .table-users thead,
  .table-activity thead {
    display: none !important;
  }
  .table-archivos tbody tr,
  .table-users tbody tr,
  .table-activity tbody tr {
    display: block !important;
    background: #fff !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 7px 0 rgba(30,50,70,.06) !important;
    margin-bottom: 14px !important;
    margin-top: 3px !important;
    padding: 8px 6px 8px 9px !important;
  }
  .table-archivos td,
  .table-users td,
  .table-activity td {
    display: flex !important;
    align-items: center !important;
    font-size: 1em !important;
    white-space: normal !important;
    padding: 7px 6px !important;
    border-bottom: 0 !important;
  }
  /* Etiquetas por columna */
  .table-archivos td:before,
  .table-users td:before,
  .table-activity td:before {
    content: attr(data-label);
    font-weight: bold;
    color: #1976d2;
    width: 94px;
    flex-shrink: 0;
    display: inline-block;
    font-size: 0.97em;
  }
  .table-archivos td:nth-child(1):before { content: "Archivo:"; }
  .table-archivos td:nth-child(2):before { content: "Fecha:"; }
  .table-archivos td:nth-child(3):before { content: "Descripción:"; }
  .table-archivos td:nth-child(4):before { content: "Estado:"; }
  .table-archivos td:nth-child(5):before { content: "Comentario:"; }
  .table-archivos td:nth-child(6):before { content: "Acciones:"; }
  .table-activity td:nth-child(1):before { content: "Usuario:"; }
  .table-activity td:nth-child(2):before { content: "Archivo:"; }
  .table-activity td:nth-child(3):before { content: "Fecha:"; }
  .table-activity td:nth-child(4):before { content: "Descripción:"; }
  .table-users td:nth-child(1):before { content: "Nombre:"; }
  .table-users td:nth-child(2):before { content: "Usuario:"; }
  .table-users td:nth-child(3):before { content: "Admin:"; }
  .table-users td:nth-child(4):before { content: "Acciones:"; }
  /* Botones Acciones */
  .table-archivos td:last-child,
  .acciones, .acciones-archivos, .botones-acciones {
    flex-wrap: wrap !important;
    gap: 5px 0 !important;
    margin-top: 4px !important;
    justify-content: flex-start !important;
  }
  .table-archivos td:last-child > button,
  .acciones button, .acciones-archivos button, .botones-acciones button {
    min-width: 90px !important;
    font-size: 0.96em !important;
    padding: 7px 0 !important;
    margin-bottom: 3px !important;
  }
}

/* Para que el eliminar siempre quede visible */
.table-archivos td:last-child > .btn-del {
  margin-top: 2px;
}

@media (max-width: 450px) {
  .dashboard-cards .card.stat {
    min-width: 0 !important;
    padding: 10px 0 8px 0 !important;
    font-size: 0.94em !important;
  }
  .carpeta-card { padding: 10px 2px 8px 2px !important; }
  .main-content { padding: 8px 2vw !important; }
}

/* Detalle: icono descargar más pequeño y alineado */
.icon-descargar {
  width: 16px !important;
  height: 16px !important;
  margin-right: 4px !important;
  top: 2px !important;
}

/* Scrollbar mobile minimal */
::-webkit-scrollbar { width: 6px; background: #f4f4f7;}
::-webkit-scrollbar-thumb { background: #e3e8ef; border-radius: 8px;}
/* ====== RESPONSIVE NAVBAR + MENSAJE BIENVENIDO + MENU HAMBURGUESA ====== */
@media (max-width: 800px) {
  .main-layout { flex-direction: column; }
  .sidebar {
    position: fixed;
    z-index: 99;
    left: 0;
    top: 0;
    width: 84vw;
    height: 100vh;
    background: #175fa4;
    transition: transform 0.25s;
    transform: translateX(-105%);
    box-shadow: 2px 0 14px #0004;
    border-radius: 0 18px 18px 0;
    align-items: flex-start;
    padding-top: 35px;
    padding-bottom: 30px;
  }
  .sidebar.abierto { transform: translateX(0); }
  .menu-btn {
    display: flex !important;
    position: fixed;
    left: 16px; top: 16px;
    z-index: 120;
    background: #175fa4;
    border: none;
    border-radius: 10px;
    width: 48px; height: 48px;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    box-shadow: 0 3px 8px #0002;
  }
  .menu-btn span {
    display: block;
    width: 28px;
    height: 4.5px;
    margin: 5px 0;
    background: #fff;
    border-radius: 4px;
    transition: all .2s;
  }
  .sidebar .logo { margin-bottom: 23px; }
}

@media (min-width: 801px) {
  .menu-btn { display: none !important; }
}

/* ====== HEADER BIENVENIDA Y AJUSTE EN MOBILE ====== */
.header-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: #e6eef7;
  border-radius: 12px;
  margin-bottom: 20px;
  min-height: 72px;
  padding: 10px 16px;
  font-size: 1.05em;
  position: relative;
  box-shadow: 0 2px 8px 0 rgba(21,101,192,0.09);
}
.header-bar .bienvenida,
.header-bar span.bienvenida {
  margin-top: 8px;
  margin-bottom: 2px;
  font-weight: 600;
  color: #1760a5;
  font-size: 1.09em;
  width: 100%;
  letter-spacing: .1px;
  text-align: left;
  display: block;
}
@media (max-width: 700px) {
  .header-bar {
    padding-top: 57px;
    min-height: 98px;
    align-items: flex-start;
    font-size: 1.01em;
  }
  .header-bar .bienvenida,
  .header-bar span.bienvenida {
    margin-top: 0;
    font-size: 1.01em;
  }
}

/* ====== DASHBOARD CARDS AJUSTADAS RESPONSIVO ====== */
.dashboard-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin: 17px 0 28px 0;
  justify-content: flex-start;
}
.dashboard-cards .card.stat {
  min-width: 140px;
  max-width: 240px;
  width: 98%;
  margin: 0;
  padding: 23px 0 20px 0;
  font-size: 1.09em;
  background: linear-gradient(133deg, #2196f3 60%, #1565c0 100%);
  border-radius: 13px;
  color: #fff;
  box-shadow: 0 3px 10px #1d72b226;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: box-shadow .17s;
}
.dashboard-cards .stat-title { font-size: 1.09em; margin-bottom: 7px; }
.dashboard-cards .stat-value { font-size: 2.2em; font-weight: 800; line-height: 1.03; }

@media (max-width: 700px) {
  .dashboard-cards { flex-direction: column; gap: 14px;}
  .dashboard-cards .card.stat {
    min-width: 98vw;
    max-width: 99vw;
    width: 100%;
    padding: 15px 0 12px 0;
    font-size: 0.99em;
    margin: 0 auto;
  }
}

/* ====== TABLAS ANCHAS EN MOBILE ====== */
@media (max-width: 600px) {
  .table-archivos,
  .table-users,
  .table-activity {
    display: block !important;
    width: 100% !important;
    background: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    font-size: 1em !important;
    padding: 0 !important;
    overflow-x: auto !important;
  }
  .table-archivos tbody tr,
  .table-users tbody tr,
  .table-activity tbody tr {
    display: block !important;
    background: #fff !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 7px 0 rgba(30,50,70,.06) !important;
    margin-bottom: 18px !important;
    margin-top: 6px !important;
    padding: 12px 8px 12px 12px !important;
  }
  .table-archivos td,
  .table-users td,
  .table-activity td {
    display: flex !important;
    align-items: center !important;
    font-size: 1.03em !important;
    white-space: normal !important;
    padding: 9px 7px !important;
    border-bottom: 0 !important;
  }
  .table-archivos td:before,
  .table-users td:before,
  .table-activity td:before {
    font-weight: bold;
    color: #1976d2;
    width: 114px !important;   /* MÁS ANCHO */
    flex-shrink: 0;
    display: inline-block;
    font-size: 1.04em;
  }
  /* Etiquetas de columnas */
  .table-archivos td:nth-child(1):before { content: "Archivo:"; }
  .table-archivos td:nth-child(2):before { content: "Fecha:"; }
  .table-archivos td:nth-child(3):before { content: "Descripción:"; }
  .table-archivos td:nth-child(4):before { content: "Estado:"; }
  .table-archivos td:nth-child(5):before { content: "Comentario:"; }
  .table-archivos td:nth-child(6):before { content: "Acciones:"; }
  .table-activity td:nth-child(1):before { content: "Usuario:"; }
  .table-activity td:nth-child(2):before { content: "Archivo:"; }
  .table-activity td:nth-child(3):before { content: "Fecha:"; }
  .table-activity td:nth-child(4):before { content: "Descripción:"; }
  .table-users td:nth-child(1):before { content: "Nombre:"; }
  .table-users td:nth-child(2):before { content: "Usuario:"; }
  .table-users td:nth-child(3):before { content: "Admin:"; }
  .table-users td:nth-child(4):before { content: "Acciones:"; }
}

/* ====== ICONO DESCARGAR AJUSTADO ====== */
.icon-descargar {
  width: 16px !important;
  height: 16px !important;
  margin-right: 4px !important;
  vertical-align: middle !important;
}

::-webkit-scrollbar { width: 7px; background: #f4f4f7;}
::-webkit-scrollbar-thumb { background: #e3e8ef; border-radius: 8px;}
/* SIDEBAR ORGANIZADO EN VERTICAL MOBILE */
.sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 26px;
}

@media (max-width: 800px) {
  .sidebar {
    position: fixed;
    z-index: 99;
    left: 0; top: 0;
    width: 85vw;
    height: 100vh;
    background: #175fa4;
    transition: transform 0.22s;
    transform: translateX(-104%);
    box-shadow: 2px 0 14px #0004;
    border-radius: 0 17px 17px 0;
    align-items: center;
    padding-top: 36px;
    padding-bottom: 40px;
  }
  .sidebar.abierto { transform: translateX(0);}
  .sidebar .logo {
    margin-bottom: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  .sidebar nav ul {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .sidebar nav ul li {
    width: 100%;
    text-align: left;
    margin: 8px 0;
    padding: 13px 22px;
    font-size: 1.07em;
    border-radius: 7px;
  }
}

/* Corrige espaciado sólo mobile */
@media (max-width: 500px) {
  .sidebar {
    width: 97vw;
    padding-top: 22px;
  }
  .sidebar .logo img {
    width: 53px;
  }
  .sidebar .logo span {
    font-size: 1.08em;
  }
}
.header-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  background: #e6eef7;
  border-radius: 12px;
  margin-bottom: 20px;
  min-height: 68px;
  padding: 17px 18px 12px 18px;
  position: relative;
  box-shadow: 0 2px 8px 0 rgba(21,101,192,0.09);
  gap: 18px;
}

.header-bar .bienvenida,
.header-bar span.bienvenida {
  font-weight: 600;
  color: #1760a5;
  font-size: 1.09em;
  width: auto;
  letter-spacing: .1px;
  margin: 0;
  flex: 1;
  text-align: left;
  display: block;
  /* Para que baje debajo del menú hamburguesa */
  margin-top: 8px;
}

.header-bar .btn-out,
.header-bar button.btn-out {
  margin-left: auto;
  margin-right: 2px;
  margin-top: 0;
  background: #c4d4e7;
  color: #195088;
  font-weight: bold;
  padding: 8px 17px;
  border-radius: 6px;
  font-size: 1em;
  border: none;
  transition: background .15s;
}
.header-bar .btn-out:hover { background: #b6c7dd; color: #0d47a1; }

@media (max-width: 700px) {
  .header-bar {
    flex-direction: row;
    align-items: center;
    padding-top: 60px;  /* deja espacio extra por menú hamburguesa */
    min-height: 90px;
    gap: 12px;
  }
  .header-bar .bienvenida,
  .header-bar span.bienvenida {
    margin-top: 2px;
    font-size: 1em;
  }
}
.link-download {
  background: none; border: none; color: #1760a5; text-decoration: underline; cursor: pointer; font-family: inherit; padding: 0;
}
.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #ddd;
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}
.progress-bar {
  height: 100%;
  background: #4caf50;
  transition: width 0.3s;
}
/* Ajustes de compatibilidad para que la demo reutilice exactamente el estilo visual del frontend. */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.login-card p {
  color: var(--gris-txt);
  margin-top: -4px;
  text-align: center;
}
.password-field {
  position: relative;
  max-width: 320px;
}
.password-field input {
  padding-right: 42px;
}
.icon-btn.password-toggle {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 38px;
  padding: 8px 0;
  margin: 0;
  background: #e7eff9;
  color: #154577;
}
.eye-icon {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 12px;
  border: 2px solid #154577;
  border-radius: 50%;
}
.eye-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #154577;
}
.eye-icon.closed::after {
  content: "";
  position: absolute;
  left: -4px;
  top: 4px;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: #154577;
  transform: rotate(-35deg);
}
.quick-logins {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}
.quick-logins button,
.breadcrumb-bar button {
  background: transparent;
  color: #154577;
  padding: 0;
  text-decoration: underline;
}
.sidebar nav button {
  display: block;
  width: 100%;
  padding: 12px 10px;
  margin: 10px 0;
  text-align: left;
  background: transparent;
  border-radius: 6px;
  transition: background .2s;
}
.sidebar nav button.active,
.sidebar nav button:hover {
  background: #3162a5;
  font-weight: bold;
}
.section-head,
.head-actions,
.files-title,
.upload-row,
.toolbar,
.preview-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.files-section,
.upload-box,
.toolbar {
  margin-top: 18px;
}
.upload-box {
  padding: 14px;
  border: 1px dashed #9db9dc;
  border-radius: 8px;
  background: #f8fbff;
}
.file-picker input { display: none; }
.file-picker span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  background: #154577;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.preview-card,
.thumb {
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #fff;
}
.preview-card {
  position: relative;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
}
.preview-card img,
.thumb img {
  width: 58px;
  height: 46px;
  object-fit: cover;
  border-radius: 6px;
}
.remove-preview {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  background: #e54d4d;
}
.status.ok,
.status.revisando,
.status.mal {
  font-weight: bold;
}
.status.ok { color: #26ad5c; }
.status.revisando { color: #ce9e3a; }
.status.mal { color: #e54d4d; }
.preview-modal { max-width: 90vw; }
.large-preview { max-width: 80vw; max-height: 75vh; border-radius: 10px; }
.document-preview,
.file-chip {
  display: grid;
  place-items: center;
  min-width: 58px;
  min-height: 46px;
  border-radius: 6px;
  background: #e7eff9;
  color: #154577;
  font-weight: 800;
}

/* Logo demo sin binarios nuevos: conserva el espacio visual del isotipo del frontend. */
.logo-mark {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 50%;
  background: #fff;
  color: #154577;
  box-shadow: 0 0 14px #cbe8ff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .3px;
}
.logo-mark-login {
  width: 70px;
  height: 70px;
  margin: 0;
  font-size: 15px;
}

/* Pulido final de demo: carpetas visibles, ojo alineado y UI más cuidada. */
* { box-sizing: border-box; }
body {
  color: #0f2742;
  background: linear-gradient(180deg, #f6f9fd 0%, #eef3f8 100%);
}
.sidebar {
  flex: 0 0 250px;
  min-height: 100vh;
  padding: 28px 22px;
  background: linear-gradient(180deg, #164e83 0%, #123f6c 100%);
  box-shadow: 6px 0 22px rgba(15, 44, 80, .08);
}
.sidebar nav { width: 100%; }
.sidebar nav button {
  width: 100%;
  margin: 6px 0;
  padding: 13px 16px;
  border-radius: 9px;
  color: #fff;
  text-align: left;
}
.sidebar nav button.active,
.sidebar nav button:hover {
  background: rgba(255,255,255,.14);
  box-shadow: inset 3px 0 0 #90caf9;
}
.logo-mark {
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #f7fbff 62%, #e6f2ff 100%);
  border: 1px solid rgba(255,255,255,.8);
  box-shadow: 0 10px 28px rgba(144,202,249,.38), 0 0 0 5px rgba(255,255,255,.08);
}
.main-content {
  width: 100%;
  padding: 40px;
}
.header-bar {
  margin-bottom: 34px;
  padding: 24px 28px;
  border: 1px solid rgba(144, 177, 212, .16);
  border-radius: 16px;
  background: #e8f1fa;
  box-shadow: 0 10px 24px rgba(21, 69, 119, .08);
}
.page h2 {
  margin: 0 0 18px;
  color: #0f477d;
  font-size: 26px;
}
.section-head {
  align-items: flex-end;
  margin-bottom: 18px;
}
.head-actions select,
.toolbar select,
input,
select {
  min-height: 34px;
  border: 1px solid #bfd0e3;
  border-radius: 8px;
  background: #fff;
  color: #163d66;
}
.btn-main,
.btn-sm,
.btn-out,
.btn-sec,
.btn-del,
button {
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-main:hover,
.btn-sm:hover,
.btn-out:hover,
.btn-sec:hover,
.btn-del:hover,
button:hover {
  transform: translateY(-1px);
}
.carpetas-grid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  max-width: 820px;
  margin-top: 22px;
}
.carpeta-card {
  min-height: 164px;
  padding: 22px 16px 18px;
  border: 1px solid rgba(144, 177, 212, .25);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 10px 22px rgba(21, 69, 119, .08);
}
.carpeta-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(21, 101, 192, .14);
}
.icono-carpeta {
  position: relative;
  width: 68px;
  height: 48px;
  margin: 0 0 14px;
  border: 2px solid #1565c0;
  border-radius: 8px 8px 10px 10px;
  background: linear-gradient(180deg, #42a5f5 0%, #1976d2 100%);
  box-shadow: inset 0 -8px 0 rgba(13,71,161,.12), 0 8px 18px rgba(25,118,210,.18);
}
.icono-carpeta::before {
  content: "";
  position: absolute;
  left: 5px;
  top: -13px;
  width: 32px;
  height: 15px;
  border: 2px solid #1565c0;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: #90caf9;
}
.icono-carpeta::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 13px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255,255,255,.42);
}
.carpeta-nombre {
  color: #0f5da4;
  font-size: 1.18rem;
  line-height: 1.25;
}
.carpeta-acciones {
  justify-content: center;
  flex-wrap: wrap;
}
.login-wrap {
  min-height: 100vh;
  padding: 24px;
}
.login-card {
  width: min(430px, 94vw);
  margin: 0 auto;
  padding: 38px 42px;
  border: 1px solid rgba(144, 177, 212, .18);
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(21, 69, 119, .12);
}
.login-card h2 { margin-top: 18px; }
.login-card input,
.login-card .password-field {
  width: 100%;
  max-width: none;
}
.login-card input {
  height: 36px;
  margin: 7px 0;
  padding: 8px 11px;
}
.password-field {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
}
.password-field input {
  width: 100%;
  max-width: none;
  padding-right: 46px;
}
.icon-btn.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 32px;
  height: 28px;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border-radius: 7px;
  background: #e5eff9;
  color: #154577;
  transform: translateY(-50%);
  box-shadow: none;
}
.eye-icon {
  width: 16px;
  height: 10px;
  border-width: 2px;
}
.eye-icon.closed::after {
  left: -4px;
  top: 3px;
  width: 21px;
}
.quick-logins {
  justify-content: flex-start;
  margin-top: 12px;
}
.quick-logins button {
  padding: 5px 0;
  font-size: 14px;
}
.upload-box,
.toolbar,
.table-archivos,
.table-users,
.table-activity {
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(21,69,119,.05);
}
.upload-box {
  border-color: #9bbce3;
  background: rgba(255,255,255,.58);
}
.toolbar {
  padding: 12px 14px;
  background: rgba(255,255,255,.55);
}
.table-archivos,
.table-users,
.table-activity {
  overflow: hidden;
}
.table-archivos th,
.table-users th,
.table-activity th {
  background: #fff;
  color: #0f477d;
}
@media (max-width: 800px) {
  .sidebar { flex: none; }
  .main-content { padding: 24px 16px; }
  .header-bar { padding: 18px; }
  .carpetas-grid { max-width: none; }
}

/* El admin siempre ve las carpetas, pero los archivos se filtran por usuario seleccionado. */
.user-select {
  min-width: 180px;
  padding: 7px 12px;
  font-weight: 700;
}
.empty-state.user-required {
  max-width: 560px;
  margin: 22px 0;
  padding: 24px 28px;
  border: 1px dashed #8eb4dd;
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  color: #154577;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(21, 69, 119, .06);
}

/* Seguridad de carga local: avisos y errores de validación antes de previsualizar. */
.security-note {
  width: 100%;
  margin: 10px 0 0;
  color: #4b6380;
  font-size: 13px;
  line-height: 1.45;
}
.validation-errors {
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #ffc9c9;
  border-radius: 10px;
  background: #fff5f5;
  color: #9c2323;
}
.validation-errors ul {
  margin: 6px 0 0;
  padding-left: 18px;
}
.validation-errors li { margin: 3px 0; }
