/* Zona de clientes — Tecno Smart Soluciones (misma paleta del sitio) */
:root {
  --primary: #0B3B5E; --primary-dark: #072a44; --primary-soft: #e8eff5;
  --secondary: #f4a261; --secondary-dark: #e76f2d;
  --bg: #f5f7fa; --white: #ffffff; --text: #1a2a3a; --muted: #6c757d; --border: #e3e8ee;
  --ok: #2E9E5B; --danger: #d64545; --danger-soft: #fdecec; --warn-soft: #fff4e6;
  --radius: 14px; --shadow: 0 4px 14px rgba(11, 59, 94, 0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }

/* Barra superior */
.zbar { background: var(--primary); color: #fff; padding: 0.9rem 5%; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.zbar-in { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.zmarca { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; line-height: 1.2; }
.zmarca span { display: block; font-size: 0.75rem; font-weight: 500; color: var(--secondary); letter-spacing: 0.04em; }
.zacciones { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.zacciones a, .zacciones button { background: transparent; border: 1px solid rgba(255,255,255,0.35); color: #fff; padding: 0.4rem 0.9rem; border-radius: 40px; font-size: 0.85rem; cursor: pointer; text-decoration: none; transition: background 0.2s, border-color 0.2s; }
.zacciones a:hover, .zacciones button:hover { background: rgba(255,255,255,0.12); border-color: #fff; }
.zacciones .destacado { border-color: var(--secondary); color: var(--secondary); }

.zmain { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 2rem 5% 3rem; }
.zpie { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 1.5rem; }

/* Tarjetas y formularios */
.tarjeta { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.tarjeta + .tarjeta { margin-top: 1.25rem; }
h1.titulo { font-size: 1.6rem; color: var(--primary); line-height: 1.25; }
h2.subtitulo { font-size: 1.15rem; color: var(--primary); margin-bottom: 0.75rem; }
.texto-suave { color: var(--muted); font-size: 0.92rem; }
.campo { margin-bottom: 0.9rem; }
.campo label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 0.3rem; }
.campo input, .campo textarea, .campo select { width: 100%; padding: 0.65rem 0.8rem; border: 1px solid #cfd8e1; border-radius: 10px; background: #fff; }
.campo input:focus, .campo textarea:focus { outline: 2px solid var(--secondary); outline-offset: 1px; border-color: var(--secondary); }
.fila-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 1rem; }
.con-boton { display: flex; gap: 0.5rem; }
.con-boton input { flex: 1; min-width: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.6rem 1.2rem; border-radius: 40px; border: none; font-weight: 600; font-size: 0.9rem; cursor: pointer; text-decoration: none; transition: background 0.2s, transform 0.15s, opacity 0.2s; white-space: nowrap; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primario { background: var(--secondary); color: var(--primary); }
.btn-primario:hover:not(:disabled) { background: var(--secondary-dark); color: #fff; }
.btn-oscuro { background: var(--primary); color: #fff; }
.btn-oscuro:hover:not(:disabled) { background: var(--primary-dark); }
.btn-borde { background: #fff; color: var(--primary); border: 1px solid #cfd8e1; }
.btn-borde:hover:not(:disabled) { border-color: var(--primary); }
.btn-peligro { background: #fff; color: var(--danger); border: 1px solid #f0c4c4; }
.btn-peligro:hover:not(:disabled) { background: var(--danger-soft); }
.btn-mini { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
.btn-bloque { width: 100%; }

.mensaje { padding: 0.7rem 0.9rem; border-radius: 10px; font-size: 0.9rem; margin-bottom: 0.9rem; }
.mensaje.error { background: var(--danger-soft); color: #9b2c2c; }
.mensaje.info { background: var(--primary-soft); color: var(--primary); }
.mensaje.alerta { background: var(--warn-soft); color: #8a4b0f; }

/* Login */
.login-envoltura { display: grid; place-items: center; min-height: 60vh; }
.login { width: 100%; max-width: 420px; }
.login .icono-candado { width: 52px; height: 52px; border-radius: 14px; background: var(--primary-soft); display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 1rem; }
.login p.texto-suave { margin: 0.35rem 0 1.25rem; }
.login .ayuda { margin-top: 1rem; text-align: center; font-size: 0.85rem; color: var(--muted); }

/* Portal */
.encabezado-portal { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.buscador { position: relative; width: 100%; max-width: 320px; }
.buscador input { width: 100%; padding: 0.6rem 0.9rem 0.6rem 2.2rem; border: 1px solid #cfd8e1; border-radius: 40px; background: #fff; }
.buscador::before { content: "⌕"; position: absolute; left: 0.85rem; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 1.05rem; }
.tema { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.25rem; overflow: hidden; }
.tema-cab { padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.tema-cab h2 { font-size: 1.1rem; color: var(--primary); }
.tema-cab p { color: var(--muted); font-size: 0.88rem; }
.contador { background: var(--primary-soft); color: var(--primary); font-size: 0.78rem; font-weight: 600; padding: 0.2rem 0.7rem; border-radius: 40px; white-space: nowrap; }
.lista-archivos { list-style: none; }
.archivo { display: flex; align-items: center; gap: 0.9rem; padding: 0.85rem 1.4rem; border-bottom: 1px solid var(--border); }
.archivo:last-child { border-bottom: none; }
.archivo:hover { background: #fafbfd; }
.archivo-info { flex: 1; min-width: 0; }
.archivo-nombre { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.archivo-meta { color: var(--muted); font-size: 0.8rem; }
.archivo-desc { color: var(--muted); font-size: 0.85rem; }
.archivo-acciones { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
.insignia { flex-shrink: 0; width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.03em; color: #fff; background: #8a96a3; }
.insignia.pdf { background: #d64545; }
.insignia.ppt { background: #e76f2d; }
.insignia.doc { background: #2f6db5; }
.insignia.xls { background: #2E9E5B; }
.insignia.zip { background: #6b5bd6; }
.vacio { text-align: center; padding: 2.5rem 1.5rem; color: var(--muted); }
.vacio .grande { font-size: 2rem; margin-bottom: 0.5rem; }
.vacio-fila { padding: 1rem 1.4rem; color: var(--muted); font-size: 0.9rem; }

/* Pestañas (admin) */
.pestanas { display: flex; gap: 0.25rem; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; overflow-x: auto; }
.pestanas button { background: none; border: none; padding: 0.7rem 1.1rem; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.pestanas button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--secondary); }
.pestanas .num { background: var(--primary-soft); color: var(--primary); font-size: 0.72rem; padding: 0.05rem 0.45rem; border-radius: 40px; margin-left: 0.3rem; }

/* Admin: temas */
details.tema > summary { list-style: none; cursor: pointer; }
details.tema > summary::-webkit-details-marker { display: none; }
details.tema > summary .flecha { transition: transform 0.2s; color: var(--muted); margin-right: 0.4rem; display: inline-block; }
details.tema[open] > summary .flecha { transform: rotate(90deg); }
.subida { padding: 1rem 1.4rem; background: #fafbfd; border-bottom: 1px solid var(--border); display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.subida input[type=file] { flex: 1; min-width: 200px; font-size: 0.85rem; }
.subida .estado { font-size: 0.85rem; color: var(--muted); width: 100%; }
.tema-herramientas { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* Admin: usuarios */
.usuarios-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.3fr); gap: 1.25rem; align-items: start; }
.usuarios-grid .tarjeta + .tarjeta { margin-top: 0; }
@media (max-width: 820px) { .usuarios-grid { grid-template-columns: 1fr; } }
.lista-usuarios { list-style: none; }
.lista-usuarios li button { width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--border); padding: 0.8rem 1rem; cursor: pointer; display: flex; justify-content: space-between; gap: 0.5rem; align-items: center; }
.lista-usuarios li:last-child button { border-bottom: none; }
.lista-usuarios li button:hover { background: #fafbfd; }
.lista-usuarios li button[aria-current="true"] { background: var(--primary-soft); }
.u-nombre { font-weight: 600; display: block; overflow-wrap: anywhere; }
.u-sub { font-size: 0.8rem; color: var(--muted); display: block; overflow-wrap: anywhere; }
.etiqueta { font-size: 0.7rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 40px; white-space: nowrap; }
.etiqueta.admin { background: #fff1e4; color: var(--secondary-dark); }
.etiqueta.inactivo { background: var(--danger-soft); color: var(--danger); }
.etiqueta.temas { background: var(--primary-soft); color: var(--primary); }
.permisos-lista { list-style: none; margin: 0.5rem 0 1.25rem; border: 1px solid var(--border); border-radius: 10px; }
.permisos-lista li { border-bottom: 1px solid var(--border); }
.permisos-lista li:last-child { border-bottom: none; }
.permisos-lista label { display: flex; gap: 0.7rem; align-items: center; padding: 0.65rem 0.9rem; cursor: pointer; }
.permisos-lista input { width: 18px; height: 18px; accent-color: var(--primary); }
.credenciales { background: var(--primary-soft); border-radius: 10px; padding: 1rem; margin-top: 1rem; font-size: 0.9rem; }
.credenciales pre { white-space: pre-wrap; font-family: Consolas, 'Courier New', monospace; font-size: 0.85rem; margin: 0.5rem 0 0.75rem; background: #fff; padding: 0.75rem; border-radius: 8px; overflow-wrap: anywhere; }
.acciones-fila { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Tablas */
.tabla-envoltura { overflow-x: auto; }
table.tabla { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.tabla th { text-align: left; background: var(--primary); color: #fff; padding: 0.6rem 0.8rem; font-weight: 600; white-space: nowrap; }
.tabla td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border); vertical-align: top; }

/* Diálogos */
dialog { border: none; border-radius: var(--radius); padding: 1.5rem; width: min(440px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0,0,0,0.25); color: var(--text); margin: auto; }
dialog::backdrop { background: rgba(7, 42, 68, 0.5); }
dialog h2 { font-size: 1.15rem; color: var(--primary); margin-bottom: 1rem; }
dialog .pie-dialogo { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }

/* Avisos */
.avisos { position: fixed; bottom: 20px; right: 20px; left: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; z-index: 200; pointer-events: none; }
.aviso { background: var(--primary); color: #fff; padding: 0.75rem 1.1rem; border-radius: 10px; box-shadow: 0 8px 20px rgba(0,0,0,0.2); font-size: 0.9rem; max-width: 380px; pointer-events: auto; animation: entra 0.25s ease; }
.aviso.ok { background: var(--ok); }
.aviso.error { background: var(--danger); }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.cargando { text-align: center; color: var(--muted); padding: 4rem 1rem; }

@media (max-width: 600px) {
  .zmain { padding: 1.25rem 16px 2.5rem; }
  .zbar { padding: 0.8rem 16px; }
  .archivo { flex-wrap: wrap; padding: 0.85rem 1rem; }
  .archivo-acciones { width: 100%; justify-content: flex-start; padding-left: calc(46px + 0.9rem); }
  .tema-cab, .subida { padding: 1rem; }
  h1.titulo { font-size: 1.35rem; }
  .buscador { max-width: none; }
  .avisos { align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
