/* CZL-Docs */
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --hover: #eef3fb;
  --sel: #e1ebfb;
  --borde: #e2e7ef;
  --borde-fuerte: #c9d2df;
  --texto: #18202d;
  --texto-2: #566275;
  --texto-3: #8792a3;
  --acento: #2457c5;
  --acento-hover: #1c48a8;
  --acento-suave: #e6eefc;
  --lateral: #fbfcfe;
  --ok: #157a3f; --ok-bg: #e7f6ed;
  --alerta: #a35a00; --alerta-bg: #fff4e0;
  --error: #b42318; --error-bg: #fdecea;
  --word: #2b579a; --excel: #217346; --ppt: #c43e1c; --pdf: #d93025; --carpeta: #e0a526;
  --sombra: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --sombra-2: 0 16px 40px rgba(16, 24, 40, .18);
  --radio: 10px;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --bg: #0f1218; --panel: #171b23; --panel-2: #1c212b; --hover: #222937; --sel: #24324d;
    --borde: #2a3140; --borde-fuerte: #3a4356; --texto: #e5e9f0; --texto-2: #a6b0c0; --texto-3: #758095;
    --acento: #6d9cff; --acento-hover: #8bb0ff; --acento-suave: #1d2a45; --lateral: #13171e;
    --ok: #4ade80; --ok-bg: #12301f; --alerta: #fbbf24; --alerta-bg: #33270f; --error: #f87171; --error-bg: #3a1717;
    --sombra: 0 1px 2px rgba(0,0,0,.4); --sombra-2: 0 16px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-tema="oscuro"] {
  --bg: #0f1218; --panel: #171b23; --panel-2: #1c212b; --hover: #222937; --sel: #24324d;
  --borde: #2a3140; --borde-fuerte: #3a4356; --texto: #e5e9f0; --texto-2: #a6b0c0; --texto-3: #758095;
  --acento: #6d9cff; --acento-hover: #8bb0ff; --acento-suave: #1d2a45; --lateral: #13171e;
  --ok: #4ade80; --ok-bg: #12301f; --alerta: #fbbf24; --alerta-bg: #33270f; --error: #f87171; --error-bg: #3a1717;
  --sombra: 0 1px 2px rgba(0,0,0,.4); --sombra-2: 0 16px 40px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body, #raiz { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--texto);
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--acento); }
svg { flex: none; }
.oculto { display: none !important; }

/* ---------- Botones y campos ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px;
  border: 1px solid var(--borde-fuerte); background: var(--panel); border-radius: 8px; cursor: pointer;
  white-space: nowrap; font-weight: 500; transition: background .12s, border-color .12s; text-decoration: none; color: inherit;
}
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 17px; height: 17px; }
.btn.primario { background: var(--acento); border-color: var(--acento); color: #fff; }
.btn.primario:hover { background: var(--acento-hover); }
.btn.peligro { color: var(--error); }
.btn.peligro.lleno { background: var(--error); border-color: var(--error); color: #fff; }
.btn.chico { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.icono { width: 34px; padding: 0; justify-content: center; }
.btn.plano { border-color: transparent; background: transparent; }
.btn.plano:hover { background: var(--hover); }
.campo { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.campo > span { font-size: 12.5px; font-weight: 600; color: var(--texto-2); }
.campo small { color: var(--texto-3); font-size: 12px; }
input[type=text], input[type=password], input[type=email], input[type=search], input[type=number], input[type=date], select, textarea {
  height: 36px; padding: 0 11px; border: 1px solid var(--borde-fuerte); border-radius: 8px; background: var(--panel); width: 100%;
}
textarea { height: auto; padding: 8px 11px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--acento); outline-offset: -1px; border-color: var(--acento); }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; cursor: pointer; }
.fila { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fila.fin { justify-content: flex-end; }
.crece { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 12px; background: var(--panel-2); border: 1px solid var(--borde); color: var(--texto-2); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.chip.alerta { background: var(--alerta-bg); color: var(--alerta); border-color: transparent; }
.chip.error { background: var(--error-bg); color: var(--error); border-color: transparent; }
.chip.acento { background: var(--acento-suave); color: var(--acento); border-color: transparent; }
.nota { padding: 10px 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--borde); color: var(--texto-2); font-size: 13px; margin: 0 0 14px; }
.nota.alerta { background: var(--alerta-bg); border-color: transparent; color: var(--alerta); }
.nota.error { background: var(--error-bg); border-color: transparent; color: var(--error); }
.nota.ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.mono { font-family: var(--mono); }
.tenue { color: var(--texto-3); }

/* ---------- Ingreso ---------- */
.ingreso { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 500px at 15% -10%, var(--acento-suave), transparent 60%), var(--bg); }
.tarjeta-ingreso { width: 100%; max-width: 390px; background: var(--panel); border: 1px solid var(--borde); border-radius: 16px; padding: 32px 30px 26px; box-shadow: var(--sombra-2); }
.marca { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.2px; }
.marca .logo { width: 34px; height: 34px; border-radius: 9px; background: var(--acento); color: #fff; display: grid; place-items: center; }
.marca .logo svg { width: 20px; height: 20px; }
.marca .logo-img { height: 34px; max-width: 120px; object-fit: contain; border-radius: 6px; flex: none; }
.barra .marca .logo-img { height: 30px; max-width: 100px; }
.marca .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tarjeta-ingreso h1 { font-size: 22px; margin: 22px 0 4px; letter-spacing: -.3px; }
.tarjeta-ingreso p.sub { margin: 0 0 22px; color: var(--texto-2); }
.tarjeta-ingreso .btn.primario { width: 100%; justify-content: center; height: 40px; margin-top: 4px; }
.pie-ingreso { margin-top: 18px; font-size: 12px; color: var(--texto-3); display: flex; align-items: center; gap: 6px; }
.pie-ingreso svg { width: 14px; height: 14px; }
.codigo-2fa { font-family: var(--mono); font-size: 22px; letter-spacing: 6px; text-align: center; height: 48px !important; }
.qr { display: block; margin: 6px auto 12px; border-radius: 8px; background: #fff; padding: 6px; }

/* ---------- Estructura ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; grid-template-rows: 56px 1fr; height: 100%; }
.barra { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 0 14px 0 16px; background: var(--panel); border-bottom: 1px solid var(--borde); }
.barra .marca { font-size: 16px; min-width: 216px; }
.barra .marca .logo { width: 30px; height: 30px; }
.buscador { flex: 1; max-width: 620px; position: relative; }
.buscador svg { position: absolute; left: 11px; top: 9px; width: 17px; height: 17px; color: var(--texto-3); }
.buscador input { padding-left: 36px; background: var(--panel-2); border-color: var(--borde); border-radius: 99px; }
.usuario-btn { display: flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; padding: 4px 6px 4px 4px; border-radius: 99px; }
.usuario-btn:hover { background: var(--hover); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 13px; flex: none; }
.lateral { background: var(--lateral); border-right: 1px solid var(--borde); padding: 12px 10px; overflow-y: auto; }
.lateral .nuevo { width: 100%; justify-content: center; height: 40px; margin-bottom: 14px; box-shadow: var(--sombra); }
.nav-titulo { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--texto-3); margin: 16px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--texto); text-decoration: none; margin-bottom: 1px; }
.nav a svg { width: 18px; height: 18px; color: var(--texto-2); }
.nav a:hover { background: var(--hover); }
.nav a.activo { background: var(--sel); color: var(--acento); font-weight: 600; }
.nav a.activo svg { color: var(--acento); }
.nav a .cnt { margin-left: auto; font-size: 12px; color: var(--texto-3); }
.uso-disco { margin: 18px 10px 4px; font-size: 12px; color: var(--texto-3); }
.principal { overflow-y: auto; padding: 18px 26px 40px; position: relative; }
.principal.soltar::after { content: 'Soltá los archivos para subirlos'; position: absolute; inset: 10px; border: 2px dashed var(--acento); border-radius: 14px; background: color-mix(in srgb, var(--acento-suave) 80%, transparent); display: grid; place-items: center; font-size: 18px; font-weight: 600; color: var(--acento); pointer-events: none; }

/* ---------- Encabezado de vista ---------- */
.encabezado { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; min-height: 40px; flex-wrap: wrap; }
.encabezado h1 { font-size: 21px; margin: 0; letter-spacing: -.3px; font-weight: 650; }
.migas { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; font-size: 20px; font-weight: 600; letter-spacing: -.3px; min-width: 0; }
.migas a { color: var(--texto-2); text-decoration: none; padding: 2px 6px; border-radius: 6px; }
.migas a:hover { background: var(--hover); color: var(--texto); }
.migas span.actual { padding: 2px 6px; color: var(--texto); }
.migas svg { width: 16px; height: 16px; color: var(--texto-3); }
.acciones-vista { margin-left: auto; display: flex; gap: 8px; }

/* ---------- Lista de archivos ---------- */
.lista { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; }
.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; font-size: 12px; font-weight: 600; color: var(--texto-2); padding: 9px 12px; border-bottom: 1px solid var(--borde); background: var(--panel-2); white-space: nowrap; }
.tabla td { padding: 7px 12px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr:hover { background: var(--hover); }
.tabla td.num, .tabla th.num { text-align: right; white-space: nowrap; }
.tabla .tenue { white-space: nowrap; }
.nombre-celda { display: flex; align-items: center; gap: 11px; min-width: 0; }
.nombre-celda a, .nombre-celda button.nombre { color: var(--texto); text-decoration: none; font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nombre-celda a:hover, .nombre-celda button.nombre:hover { color: var(--acento); text-decoration: underline; }
.icono-tipo { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .2px; flex: none; }
.icono-tipo svg { width: 18px; height: 18px; }
.icono-tipo.carpeta { background: none; color: var(--carpeta); }
.icono-tipo.carpeta svg { width: 28px; height: 28px; }
.icono-tipo.word { background: var(--word); }
.icono-tipo.cell { background: var(--excel); }
.icono-tipo.slide { background: var(--ppt); }
.icono-tipo.pdf { background: var(--pdf); }
.icono-tipo.img { background: #7b4fd6; }
.icono-tipo.otro { background: var(--texto-3); }
.marcas { display: inline-flex; gap: 6px; margin-left: 4px; }
.marcas svg { width: 15px; height: 15px; color: var(--texto-3); }
.editando { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ok); background: var(--ok-bg); border-radius: 99px; padding: 1px 8px 1px 6px; white-space: nowrap; }
.editando::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: latido 1.6s infinite; }
@keyframes latido { 50% { opacity: .35; } }
.vacio { padding: 60px 20px; text-align: center; color: var(--texto-2); }
.vacio svg { width: 56px; height: 56px; color: var(--texto-3); margin-bottom: 10px; }
.vacio h3 { margin: 0 0 4px; color: var(--texto); font-size: 16px; }
.col-acc { width: 46px; text-align: right; }

/* ---------- Tarjetas de inicio ---------- */
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 26px; }
.tarjeta-doc { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 10px; transition: border-color .12s, box-shadow .12s; }
.tarjeta-doc:hover { border-color: var(--acento); box-shadow: var(--sombra); }
.tarjeta-doc .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tarjeta-doc .m { font-size: 12px; color: var(--texto-3); }
.crear-rapido { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.crear-rapido button { display: flex; align-items: center; gap: 10px; padding: 12px 16px 12px 12px; background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); cursor: pointer; font-weight: 500; }
.crear-rapido button:hover { border-color: var(--acento); }
h2.seccion { font-size: 15px; margin: 0 0 10px; }
.panel { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 18px 20px; margin-bottom: 16px; }
.panel h2 { font-size: 16px; margin: 0 0 4px; }
.panel > p { margin: 0 0 14px; color: var(--texto-2); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px 16px; }
.kpi .l { font-size: 12px; color: var(--texto-2); }
.kpi .v { font-size: 22px; font-weight: 650; margin-top: 2px; letter-spacing: -.3px; }
.barra-uso { height: 6px; border-radius: 99px; background: var(--borde); overflow: hidden; margin-top: 8px; }
.barra-uso > div { height: 100%; background: var(--acento); }

/* ---------- Menús, modales, avisos ---------- */
.menu { position: fixed; z-index: 60; min-width: 210px; background: var(--panel); border: 1px solid var(--borde); border-radius: 10px; box-shadow: var(--sombra-2); padding: 5px; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; text-align: left; }
.menu button:hover, .menu button:focus-visible { background: var(--hover); outline: none; }
.menu button svg { width: 17px; height: 17px; color: var(--texto-2); }
.menu button .icono-tipo { width: 22px; height: 22px; font-size: 8px; border-radius: 5px; }
.menu button .icono-tipo.carpeta svg { width: 22px; height: 22px; }
.menu button.peligro { color: var(--error); }
.menu button.peligro svg { color: var(--error); }
.menu hr { border: 0; border-top: 1px solid var(--borde); margin: 5px 0; }
.velo { position: fixed; inset: 0; background: rgba(10, 15, 25, .45); z-index: 50; display: grid; place-items: center; padding: 16px; animation: aparecer .12s; }
@keyframes aparecer { from { opacity: 0; } }
.modal { background: var(--panel); border-radius: 14px; box-shadow: var(--sombra-2); width: 100%; max-width: 480px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.ancho { max-width: 680px; }
.modal header { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px; }
.modal header h2 { font-size: 17px; margin: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal .cuerpo { padding: 10px 20px 4px; overflow-y: auto; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; }
.avisos { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #1d2533; color: #fff; padding: 10px 16px; border-radius: 9px; box-shadow: var(--sombra-2); max-width: min(560px, calc(100vw - 32px)); display: flex; gap: 10px; align-items: center; animation: subir .18s; }
.toast.error { background: #a3261b; }
.toast svg { width: 18px; height: 18px; }
@keyframes subir { from { transform: translateY(10px); opacity: 0; } }
.subidas { position: fixed; right: 18px; bottom: 18px; width: 340px; max-width: calc(100vw - 32px); background: var(--panel); border: 1px solid var(--borde); border-radius: 12px; box-shadow: var(--sombra-2); z-index: 55; overflow: hidden; }
.subidas header { display: flex; align-items: center; padding: 10px 12px 10px 16px; font-weight: 600; border-bottom: 1px solid var(--borde); }
.subidas ul { list-style: none; margin: 0; padding: 4px 0; max-height: 260px; overflow-y: auto; }
.subidas li { padding: 7px 16px; font-size: 13px; }
.subidas li .n { display: flex; justify-content: space-between; gap: 10px; }
.subidas li .n span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progreso { height: 4px; background: var(--borde); border-radius: 99px; margin-top: 5px; overflow: hidden; }
.progreso > div { height: 100%; background: var(--acento); transition: width .2s; }
.lista-sel { border: 1px solid var(--borde); border-radius: 8px; max-height: 300px; overflow-y: auto; }
.lista-sel button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--borde); background: none; cursor: pointer; text-align: left; }
.lista-sel button:last-child { border-bottom: 0; }
.lista-sel button:hover { background: var(--hover); }
.lista-sel button.sel { background: var(--sel); }
.lista-sel button svg { width: 20px; height: 20px; color: var(--carpeta); }
.permiso { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--borde); }
.permiso:last-child { border-bottom: 0; }
.permiso .avatar { width: 30px; height: 30px; font-size: 12px; }
.permiso select { width: auto; height: 32px; }
.permiso .q { line-height: 1.25; }
.permiso .q small { display: block; color: var(--texto-3); font-size: 12px; }
.pestanas { display: flex; gap: 4px; border-bottom: 1px solid var(--borde); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.pestanas a { padding: 9px 14px; text-decoration: none; color: var(--texto-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.pestanas a.activo { color: var(--acento); border-color: var(--acento); }
.desplazable { overflow-x: auto; }

/* ---------- Editor ---------- */
.pagina-editor { height: 100%; overflow: hidden; }
#editor { height: 100%; }
.editor-aviso { height: 100%; display: grid; place-items: center; padding: 20px; }

/* ---------- Pantallas chicas ---------- */
.solo-movil { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: fixed; top: 56px; bottom: 0; left: 0; width: 270px; z-index: 40; transform: translateX(-100%); transition: transform .18s; box-shadow: var(--sombra-2); }
  .app.menu-abierto .lateral { transform: none; }
  .barra .marca { min-width: 0; }
  .barra .marca .txt { display: none; }
  .solo-movil { display: inline-flex; }
  .principal { padding: 14px 16px 40px; }
  .oculta-movil { display: none; }
  .usuario-btn .nom { display: none; }
}
