/* Nube de campaña — estilos */
:root {
  --pri: #1d4ed8; --sec: #f59e0b;
  --bg: #f4f6fa; --card: #fff; --ink: #0f172a; --ink2: #475569; --mut: #64748b;
  --line: #e2e8f0; --line2: #edf1f6; --hover: #f1f5f9;
  --ok: #16a34a; --err: #dc2626; --warn: #d97706;
  --r: 12px; --r-sm: 8px;
  --sh: 0 1px 2px rgba(15,23,42,.05), 0 1px 3px rgba(15,23,42,.06);
  --sh-lg: 0 10px 30px rgba(15,23,42,.14), 0 2px 6px rgba(15,23,42,.06);
  --pri-soft: color-mix(in srgb, var(--pri) 10%, #fff);
  --pri-dark: color-mix(in srgb, var(--pri) 80%, #000);
  --side: 260px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--pri); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 1.55rem; font-weight: 700; display: flex; align-items: center; gap: .4rem; }
h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; } h4 { font-size: .95rem; margin-top: 1.1em; }
img { max-width: 100%; }
code { background: var(--hover); padding: 1px 6px; border-radius: 5px; font-size: .85em; }
.ic { flex: none; vertical-align: -0.2em; }
.muted { color: var(--mut); } .small { font-size: .85rem; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.noscroll { overflow: hidden; }
[hidden] { display: none !important; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem .95rem; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: var(--r-sm); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; text-decoration: none !important; }
.btn:hover { background: var(--hover); }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--pri) 35%, transparent); outline-offset: 1px; }
.btn.pri { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.pri:hover { background: var(--pri-dark); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: #fef2f2; border-color: #fecaca; }
.btn.ok { color: #fff; background: var(--ok); border-color: var(--ok); }
.btn.wa { background: #25d366; border-color: #25d366; color: #fff; }
.btn.light { background: #fff; color: var(--pri); border-color: #fff; }
.btn.sm { padding: .35rem .65rem; font-size: .82rem; }
.btn.big { padding: .8rem 1.3rem; font-size: 1rem; width: 100%; }
.btn:disabled { opacity: .55; cursor: wait; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; color: var(--ink2); cursor: pointer; text-decoration: none !important; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn.light { color: #fff; } .icon-btn.light:hover { background: rgba(255,255,255,.15); }

/* ---------- Estructura ---------- */
.app { display: flex; min-height: 100vh; }
.side { width: var(--side); flex: none; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.1rem 1rem; color: var(--ink); text-decoration: none !important; border-bottom: 1px solid var(--line2); }
.brand img { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--pri), color-mix(in srgb, var(--pri) 55%, var(--sec))); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; flex: none; letter-spacing: .5px; }
.brand-mark.big { width: 64px; height: 64px; font-size: 1.5rem; border-radius: 16px; margin: 0 auto; }
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.brand-txt strong { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-txt small { color: var(--mut); font-size: .76rem; }
.nav { padding: .7rem .6rem; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a { display: flex; align-items: center; gap: .7rem; padding: .58rem .75rem; border-radius: 10px; color: var(--ink2); font-weight: 500; font-size: .93rem; text-decoration: none !important; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.on { background: var(--pri-soft); color: var(--pri); font-weight: 650; }
.nav-sep { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); padding: 1rem .75rem .3rem; font-weight: 600; }
.badge { margin-left: auto; background: var(--err); color: #fff; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.quota { padding: 1rem 1.1rem 1.2rem; border-top: 1px solid var(--line2); font-size: .8rem; color: var(--mut); }
.quota-t { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.bar { height: 6px; background: var(--line2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--pri); border-radius: 99px; transition: width .2s; }
.bar.sec i { background: var(--sec); }
.bar.big { height: 10px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .8rem; padding: .65rem 1.4rem; background: rgba(244,246,250,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.search { flex: 1; max-width: 640px; display: flex; align-items: center; gap: .5rem; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 0 1rem; color: var(--mut); }
.search:focus-within { border-color: var(--pri); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pri) 15%, transparent); }
.search input { border: 0; outline: 0; background: transparent; flex: 1; padding: .6rem 0; font: inherit; color: var(--ink); min-width: 0; }
.me { margin-left: auto; position: relative; display: flex; align-items: center; gap: .6rem; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 99px; }
.me:hover { background: #fff; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--sec); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.avatar.sm { width: 32px; height: 32px; font-size: .78rem; }
.me-txt { display: flex; flex-direction: column; line-height: 1.2; }
.me-txt strong { font-size: .88rem; } .me-txt small { font-size: .74rem; color: var(--mut); }
.me-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-lg); padding: .35rem; min-width: 230px; }
.me:focus-within .me-menu, .me:hover .me-menu { display: block; }
.me-menu a { display: flex; gap: .6rem; align-items: center; padding: .55rem .7rem; border-radius: 8px; color: var(--ink); font-size: .9rem; text-decoration: none; }
.me-menu a:hover { background: var(--hover); }
.content { padding: 1.4rem 1.6rem 4rem; max-width: 1500px; width: 100%; }
.only-m { display: none !important; }
.side-back { display: none; }

/* ---------- Cabecera de página ---------- */
.page-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.page-h p { margin: .1rem 0 0; }
.actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; font-size: .86rem; margin-bottom: .35rem; color: var(--mut); }
.crumbs a { color: var(--ink2); display: inline-flex; align-items: center; gap: .3rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: .45rem .6rem; cursor: pointer; color: var(--mut); display: grid; place-items: center; }
.seg button.on { background: var(--pri-soft); color: var(--pri); }
.dd { position: relative; }
.dd-menu { display: none; position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-lg); padding: .35rem; min-width: 240px; }
.dd.open .dd-menu { display: block; }
.dd-menu a, .dd-menu button, .ctx a, .ctx button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .7rem; border: 0; background: transparent; border-radius: 8px; font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; text-align: left; text-decoration: none !important; }
.dd-menu a:hover, .dd-menu button:hover, .ctx a:hover, .ctx button:hover { background: var(--hover); }
.ctx .danger { color: var(--err); }
.ctx { position: fixed; z-index: 90; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-lg); padding: .35rem; min-width: 220px; }
.ctx hr { border: 0; border-top: 1px solid var(--line2); margin: .3rem 0; }

/* ---------- Alertas ---------- */
.alert { padding: .8rem 1rem; border-radius: var(--r-sm); margin-bottom: 1rem; font-size: .92rem; border: 1px solid; display: flex; align-items: center; gap: .5rem; }
.alert.ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert.err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert.link { text-decoration: none; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: #0f172a; color: #fff; padding: .75rem 1.2rem; border-radius: 10px; font-size: .92rem; opacity: 0; pointer-events: none; transition: .25s; z-index: 200; max-width: calc(100vw - 32px); box-shadow: var(--sh-lg); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--err); }

/* ---------- Formularios ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.2rem 1.3rem; box-shadow: var(--sh); margin-bottom: 1.1rem; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-size: .86rem; font-weight: 600; color: var(--ink2); margin-bottom: .8rem; }
input, select, textarea { font: inherit; color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .58rem .75rem; background: #fff; width: 100%; font-weight: 400; }
textarea { resize: vertical; }
input[type=color] { padding: 2px; height: 40px; width: 70px; cursor: pointer; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--pri); }
input:focus, select:focus, textarea:focus { border-color: var(--pri); outline: 0; }
input:disabled, textarea:disabled { background: var(--hover); color: var(--ink2); }
.form label.chk-l, label.chk-l { flex-direction: row; align-items: center; gap: .55rem; font-weight: 500; }
label.inl { flex-direction: row !important; align-items: center; gap: .5rem; white-space: nowrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid2 .span2, .span2 { grid-column: 1 / -1; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: .45rem 1rem; margin: 0 0 .5rem; font-size: .9rem; }
.dl dt { color: var(--mut); } .dl dd { margin: 0; word-break: break-word; }
details summary { cursor: pointer; font-weight: 600; color: var(--ink2); margin: .6rem 0; font-size: .9rem; }
.pass-gen { display: flex; gap: .4rem; }
.row-act { display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.row-act form { display: inline; margin: 0; }
.tag { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; padding: 1px 7px; border-radius: 99px; background: var(--pri-soft); color: var(--pri); font-weight: 600; }
.pill { display: inline-block; font-size: .76rem; padding: 2px 9px; border-radius: 99px; background: var(--hover); color: var(--ink2); font-weight: 600; white-space: nowrap; }
.c-blue { background: #dbeafe; color: #1e40af; } .c-green { background: #dcfce7; color: #166534; } .c-red { background: #fee2e2; color: #991b1b; } .c-amber { background: #fef3c7; color: #92400e; } .c-purple { background: #f3e8ff; color: #6b21a8; }

/* ---------- Filtros ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: .7rem; margin-bottom: 1rem; }
.filters input, .filters select { width: auto; flex: 1 1 150px; padding: .45rem .6rem; font-size: .9rem; }
.filters label.inl { font-size: .85rem; color: var(--mut); flex: 0 1 auto; }
.filters label.inl input { flex: none; width: 150px; }
.sortbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; gap: 1rem; flex-wrap: wrap; }
.sort a { margin-left: .5rem; color: var(--mut); }
.sort a.on { color: var(--pri); font-weight: 700; }
.bulk { position: sticky; top: 64px; z-index: 20; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; background: var(--pri); color: #fff; padding: .5rem .5rem .5rem 1rem; border-radius: var(--r); margin-bottom: .8rem; box-shadow: var(--sh-lg); }
.bulk span { font-weight: 600; margin-right: auto; }
.bulk .btn { background: rgba(255,255,255,.15); border-color: transparent; color: #fff; }
.bulk .btn:hover { background: rgba(255,255,255,.28); }
.bulk .icon-btn { color: #fff; }

/* ---------- Elementos (cuadrícula / lista) ---------- */
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: .9rem; }
.item { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; transition: box-shadow .15s, border-color .15s, transform .15s; display: flex; flex-direction: column; color: var(--ink); text-decoration: none !important; user-select: none; }
.item:hover { box-shadow: var(--sh-lg); border-color: #cbd5e1; }
.item.sel { border-color: var(--pri); box-shadow: 0 0 0 2px var(--pri); }
.item .thumb { position: relative; aspect-ratio: 4 / 3; background: var(--hover); display: grid; place-items: center; color: var(--mut); overflow: hidden; }
.item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.item .thumb .ext { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); font-size: .68rem; font-weight: 800; letter-spacing: .05em; color: var(--mut); }
.item.t-pdf .thumb { color: #dc2626; } .item.t-video .thumb { color: #7c3aed; } .item.t-audio .thumb { color: #db2777; } .item.t-documento .thumb { color: #2563eb; } .item.t-hoja .thumb { color: #16a34a; } .item.t-presentacion .thumb { color: #ea580c; } .item.t-diseno .thumb { color: #0891b2; }
.folder-ic { color: var(--fc, #64748b) !important; background: color-mix(in srgb, var(--fc, #64748b) 9%, #fff) !important; }
.item .play { position: absolute; width: 42px; height: 42px; border-radius: 50%; background: rgba(15,23,42,.6); color: #fff; display: grid; place-items: center; font-size: .9rem; padding-left: 3px; }
.st { position: absolute; top: 8px; right: 8px; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.st.pend { background: #fef3c7; color: #92400e; } .st.rech { background: #fee2e2; color: #991b1b; }
.st-inline { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; text-transform: capitalize; background: var(--hover); }
.st-inline.pendiente { background: #fef3c7; color: #92400e; } .st-inline.rechazado { background: #fee2e2; color: #991b1b; } .st-inline.aprobado { background: #dcfce7; color: #166534; }
.item .meta { padding: .6rem .75rem .7rem; min-width: 0; padding-right: 2.2rem; }
.item .name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { font-size: .76rem; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub.path { font-size: .72rem; }
.item .more { position: absolute; right: 4px; bottom: 8px; width: 32px; height: 32px; }
.item .chk { position: absolute; top: 8px; left: 8px; z-index: 2; width: 26px; height: 26px; border-radius: 7px; background: rgba(255,255,255,.95); display: grid; place-items: center; opacity: 0; transition: opacity .15s; box-shadow: var(--sh); cursor: pointer; }
.item .chk input { width: 16px; height: 16px; margin: 0; cursor: pointer; }
.item:hover .chk, .item.sel .chk, .selecting .item .chk { opacity: 1; }
.item.folder { flex-direction: column; }
.item.folder .thumb { aspect-ratio: auto; height: 96px; }
.only-list { display: none; }
/* modo lista */
.items.list { grid-template-columns: 1fr; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.items.list .item { flex-direction: row; align-items: center; border: 0; border-bottom: 1px solid var(--line2); border-radius: 0; padding: .45rem .6rem .45rem 2.8rem; box-shadow: none; }
.items.list .item:last-child { border-bottom: 0; }
.items.list .item:hover { background: var(--hover); box-shadow: none; }
.items.list .item.sel { background: var(--pri-soft); box-shadow: none; }
.items.list .thumb, .items.list .item.folder .thumb { width: 44px; height: 44px; aspect-ratio: 1; border-radius: 8px; flex: none; }
.items.list .thumb .ic { width: 24px; height: 24px; }
.items.list .thumb .ext, .items.list .play, .items.list .st { display: none; }
.items.list .meta { flex: 1; padding: 0 2.5rem 0 .8rem; }
.items.list .only-list { display: inline; }
.items.list .chk { top: 50%; transform: translateY(-50%); left: 10px; opacity: 1; box-shadow: none; background: transparent; }
.items.list .more { bottom: auto; top: 50%; transform: translateY(-50%); }

/* ---------- Vacío ---------- */
.empty { text-align: center; padding: 4rem 1rem; color: var(--mut); }
.empty .ic { color: #cbd5e1; margin-bottom: .6rem; }
.empty h2 { color: var(--ink); }
.lockbox .ic { color: var(--pri); }
.unlock { display: flex; gap: .5rem; max-width: 360px; margin: 1rem auto 0; }

/* ---------- Subidas ---------- */
.dropzone { position: fixed; inset: 0; z-index: 150; background: color-mix(in srgb, var(--pri) 85%, transparent); color: #fff; display: none; place-items: center; text-align: center; pointer-events: none; }
.dropzone.on { display: grid; }
.dropzone > div { border: 3px dashed rgba(255,255,255,.7); border-radius: 24px; padding: 3rem 4rem; }
.uploads { position: fixed; right: 20px; bottom: 20px; width: 380px; max-width: calc(100vw - 24px); background: #fff; border-radius: var(--r); box-shadow: var(--sh-lg); z-index: 120; overflow: hidden; border: 1px solid var(--line); }
.uploads-h { display: flex; justify-content: space-between; align-items: center; padding: .6rem .6rem .6rem 1rem; background: #0f172a; color: #fff; }
.uploads-h .icon-btn { color: #fff; width: 30px; height: 30px; }
.uploads-list { max-height: 300px; overflow-y: auto; }
.up-row { padding: .6rem 1rem; border-bottom: 1px solid var(--line2); display: grid; grid-template-columns: 1fr auto; gap: .2rem .8rem; align-items: center; }
.up-n { font-size: .86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-row .bar { grid-column: 1 / -1; }
.up-s { grid-row: 1; grid-column: 2; }
.up-row.ok .bar i { background: var(--ok); } .up-row.ok .up-s { color: var(--ok); }
.up-row.err .bar i { background: var(--err); width: 100% !important; } .up-row.err .up-s { color: var(--err); grid-column: 1 / -1; grid-row: 3; }
.picker { border: 2px dashed var(--line); border-radius: var(--r); padding: 1.6rem; text-align: center; cursor: pointer; transition: .15s; }
.picker:hover { border-color: var(--pri); background: var(--pri-soft); }
.picker input { display: none; }
.picker span { display: flex; flex-direction: column; align-items: center; gap: .3rem; color: var(--ink2); }
.picker small { color: var(--mut); font-weight: 400; }
.picked { margin: -.3rem 0 .6rem; }

/* ---------- Diálogos ---------- */
.dlg { border: 0; border-radius: 16px; padding: 0; width: 560px; max-width: calc(100vw - 24px); max-height: calc(100vh - 40px); box-shadow: var(--sh-lg); color: var(--ink); }
.dlg.sm { width: 420px; } .dlg.md { width: 620px; }
.dlg::backdrop { background: rgba(15,23,42,.5); backdrop-filter: blur(2px); }
.dlg > form, .dlg > div > form, .dlg > div > div { padding: 1.2rem 1.4rem 1.3rem; }
.dlg-h { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .6rem; }
.dlg-h h3 { margin: 0; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; }
.dlg-f { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
.tree { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-sm); padding: .3rem 0; }
.tree-i { display: flex !important; flex-direction: row !important; align-items: center; gap: .5rem !important; padding: .4rem .6rem; margin: 0 !important; font-weight: 500 !important; cursor: pointer; }
.tree-i:hover { background: var(--hover); }
.tree-i.off { opacity: .45; cursor: not-allowed; }
.tree-f { font-size: .8rem; }
.perm { width: 100%; border-collapse: collapse; margin-bottom: .6rem; }
.perm td { padding: .35rem 0; border-bottom: 1px solid var(--line2); font-size: .9rem; }
.perm td:last-child { width: 55%; }
.perm select { padding: .4rem .5rem; font-size: .88rem; }
.link-row { display: flex; justify-content: space-between; gap: .8rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line2); color: var(--ink); }
.link-row small { display: block; color: var(--mut); margin-top: 2px; }
.link-row code { word-break: break-all; }
.link-row.venc { opacity: .55; }
.newlink { display: flex; gap: .4rem; margin: .4rem 0 .8rem; padding: .6rem; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--r-sm); }
.newlink input { flex: 1; font-size: .85rem; padding: .4rem .6rem; }
.hist { list-style: none; padding: 0; margin: 0; font-size: .84rem; max-height: 160px; overflow-y: auto; }
.hist li { padding: .3rem 0; border-bottom: 1px solid var(--line2); }
.hist b { text-transform: capitalize; }

/* ---------- Visor ---------- */
.viewer { position: fixed; inset: 0; z-index: 100; background: rgba(8,12,22,.94); display: flex; align-items: center; justify-content: center; }
.viewer-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem .8rem .6rem 1.2rem; color: #fff; background: linear-gradient(rgba(0,0,0,.55), transparent); z-index: 2; }
.viewer-name { min-width: 0; display: flex; flex-direction: column; }
.viewer-name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-name small { opacity: .7; font-size: .8rem; }
.viewer-act { display: flex; gap: .2rem; flex: none; }
.viewer-body { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 64px 64px 24px; }
.viewer-body img, .viewer-body video { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.viewer-body iframe { width: min(1000px, 100%); height: 100%; border: 0; background: #fff; border-radius: 6px; }
.v-audio, .v-none { text-align: center; color: #fff; }
.v-ic { width: 120px; height: 120px; margin: 0 auto 1rem; border-radius: 24px; background: rgba(255,255,255,.1); display: grid; place-items: center; font-size: 2.2rem; font-weight: 800; }
.v-none .v-ic { font-size: 1.3rem; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; }
.viewer-nav:hover { background: rgba(255,255,255,.25); }
.viewer-nav.prev { left: 14px; } .viewer-nav.next { right: 14px; }

/* ---------- Tablas ---------- */
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; box-shadow: var(--sh); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--mut); font-weight: 600; padding: .7rem 1rem; background: #fafbfd; border-bottom: 1px solid var(--line); }
.table td { padding: .7rem 1rem; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.off td, .table tr.venc td { opacity: .55; }
.table.compact td, .table.compact th { padding: .45rem .5rem; }
.table-wrap .table .ic { color: var(--mut); }
.usr { display: flex; align-items: center; gap: .7rem; }
.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1rem; }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .6rem 1rem; color: var(--ink2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: .4rem; align-items: center; text-decoration: none; }
.tabs a.on { color: var(--pri); border-color: var(--pri); }
.tabs .badge { margin: 0; }

/* ---------- Aprobaciones ---------- */
.review-list { display: flex; flex-direction: column; gap: .7rem; }
.review { display: flex; gap: 1rem; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: .8rem; box-shadow: var(--sh); }
.review-th { width: 110px; height: 82px; flex: none; border-radius: 8px; overflow: hidden; background: var(--hover); display: grid; place-items: center; color: var(--mut); }
.review-th img { width: 100%; height: 100%; object-fit: cover; }
.review-b { flex: 1; min-width: 0; }
.review-b strong { display: block; word-break: break-word; }
.review-b p { margin: .3rem 0; }
.review-c { margin-top: .4rem; font-size: .85rem; background: #fffbeb; border: 1px solid #fde68a; padding: .4rem .6rem; border-radius: 8px; }
.review-a { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Panel ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.1rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.2rem; box-shadow: var(--sh); display: flex; flex-direction: column; gap: .15rem; }
.kpi span { color: var(--mut); font-size: .84rem; display: flex; align-items: center; gap: .4rem; }
.kpi span .ic { color: var(--pri); }
.kpi b { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; }
.kpi small { color: var(--mut); font-size: .8rem; }
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.1rem; }
.dash .card { margin: 0; }
.dash h3 { display: flex; justify-content: space-between; align-items: baseline; }
.vbars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 18px; }
.vb { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.vb i { width: 100%; max-width: 30px; background: var(--pri); border-radius: 5px 5px 2px 2px; min-height: 2px; }
.vb span { font-size: .68rem; color: var(--mut); margin-top: 4px; }
.vb em { position: absolute; font-style: normal; font-size: .68rem; font-weight: 700; color: var(--ink2); top: 0; }
.hbars { display: flex; flex-direction: column; gap: .55rem; }
.hb { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: .7rem; font-size: .86rem; color: var(--ink); text-decoration: none !important; }
.hb span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb .bar { height: 9px; }
.toplist { list-style: none; padding: 0; margin: 0; counter-reset: t; }
.toplist li { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; border-bottom: 1px solid var(--line2); font-size: .88rem; }
.tl-th { width: 34px; height: 34px; border-radius: 6px; overflow: hidden; background: var(--hover); display: grid; place-items: center; flex: none; color: var(--mut); }
.tl-th img { width: 100%; height: 100%; object-fit: cover; }
.tl-n { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed { list-style: none; padding: 0; margin: 0; font-size: .85rem; }
.feed li { padding: .4rem 0; border-bottom: 1px solid var(--line2); }
.feed small { display: block; color: var(--mut); font-size: .74rem; }
.sec-t { margin: 1.6rem 0 .7rem; }
.recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; }
.rc { display: flex; flex-direction: column; gap: .2rem; color: var(--ink); text-decoration: none !important; min-width: 0; }
.rc-th { position: relative; aspect-ratio: 1; border-radius: 10px; background: #fff; border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; color: var(--mut); }
.rc-th img { width: 100%; height: 100%; object-fit: cover; }
.rc-n { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc small { font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Ajustes / equipo ---------- */
.settings { max-width: 880px; }
.logo-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.logo-row img { width: 80px; height: 80px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: #fff; }
.logo-row label { flex: 1; margin: 0; }
.sticky-save { position: sticky; bottom: 0; padding: 1rem 0; background: linear-gradient(transparent, var(--bg) 35%); }
.sticky-save .btn { width: auto; }
.invite textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; margin-bottom: .6rem; }
.invite h3 { color: var(--ok); display: flex; gap: .4rem; align-items: center; }
.roles-help ul { margin: .3rem 0 1rem; padding-left: 1.2rem; color: var(--ink2); }

/* ---------- Brigada (celular) ---------- */
.brigada { max-width: 560px; margin: 0 auto; }
.shot { border: 2px dashed color-mix(in srgb, var(--pri) 45%, #fff); background: var(--pri-soft); border-radius: 16px; padding: 1.8rem 1rem; text-align: center; cursor: pointer; }
.shot input { display: none; }
.shot span { display: flex; flex-direction: column; align-items: center; gap: .35rem; color: var(--pri); font-size: 1.05rem; }
.shot small { color: var(--mut); font-weight: 400; font-size: .85rem; }
.bf-prev { display: flex; flex-wrap: wrap; gap: 6px; margin: .7rem 0; }
.bf-prev img, .bf-prev span { width: 62px; height: 62px; object-fit: cover; border-radius: 8px; background: var(--hover); display: grid; place-items: center; font-size: 1.5rem; }
.gps { display: flex; align-items: center; gap: .4rem; font-size: .85rem; padding: .55rem .8rem; border-radius: 8px; background: var(--hover); color: var(--ink2); margin-bottom: .9rem; }
.gps.ok { background: #f0fdf4; color: #166534; } .gps.warn { background: #fffbeb; color: #92400e; }
#bf-status { margin-top: .8rem; }
.mini-list { display: flex; flex-direction: column; gap: .5rem; }
.mini { display: flex; align-items: center; gap: .7rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .5rem; }
.mini img, .mini-ic { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--hover); display: grid; place-items: center; flex: none; }
.mini small { display: block; color: var(--mut); font-size: .76rem; }

/* ---------- Acceso / instalación ---------- */
.auth-body { background: radial-gradient(1000px 500px at 10% -10%, color-mix(in srgb, var(--pri) 18%, transparent), transparent), radial-gradient(800px 400px at 110% 110%, color-mix(in srgb, var(--sec) 16%, transparent), transparent), var(--bg); }
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem 1rem; gap: 1rem; }
.auth-card { width: 100%; max-width: 410px; background: #fff; border-radius: 20px; padding: 2rem 1.8rem; box-shadow: var(--sh-lg); border: 1px solid var(--line); }
.auth-card.center { text-align: center; }
.auth-card.center .ic { color: var(--mut); }
.auth-brand { text-align: center; margin-bottom: 1.4rem; }
.auth-brand img { max-width: 110px; max-height: 110px; object-fit: contain; margin-bottom: .6rem; }
.auth-brand h1 { justify-content: center; margin: .6rem 0 .1rem; font-size: 1.4rem; }
.auth-brand p { margin: 0; }
.auth-link { color: var(--ink2); font-size: .88rem; display: flex; align-items: center; gap: .4rem; }
.install { max-width: 720px; margin: 0 auto; padding: 2rem 1rem 4rem; }
.install-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; }
.install-head .brand-mark { margin: 0; }
.install h3 { margin-top: .6rem; }
.reqs { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; font-size: .9rem; }
.reqs .ok { color: var(--ok); } .reqs .bad { color: var(--err); font-weight: 700; }

/* ---------- Páginas públicas ---------- */
.pub-body { background: var(--bg); }
.pub-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1.4rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.pub-brand { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.pub-brand img { width: 42px; height: 42px; object-fit: contain; }
.pub-brand strong { display: block; } .pub-brand small { color: var(--mut); font-size: .8rem; }
.pub { max-width: 1180px; margin: 0 auto; padding: 1.6rem 1.2rem 3rem; }
.pub .items .item { cursor: default; }
.pub .item .thumb { cursor: pointer; }
.pub-one { background: #0f172a; border-radius: var(--r); overflow: hidden; display: grid; place-items: center; min-height: 240px; margin-bottom: 1rem; }
.pub-one img, .pub-one video { max-width: 100%; max-height: 75vh; display: block; }
.pub-one iframe { width: 100%; height: 75vh; border: 0; background: #fff; }
.pub-one audio { width: 90%; margin: 3rem 0; }
.pub-one .empty { color: #cbd5e1; }
.pub .btn.big { width: auto; }
.pub-foot { text-align: center; padding: 1.5rem; }
.kit-hero { background: linear-gradient(135deg, var(--pri), color-mix(in srgb, var(--pri) 60%, var(--sec))); color: #fff; padding: 3.2rem 1.2rem 3.4rem; }
.kit-hero-in { max-width: 1180px; margin: 0 auto; display: flex; gap: 2rem; align-items: center; }
.kit-logo { width: 150px; height: 150px; object-fit: contain; background: #fff; border-radius: 24px; padding: 12px; flex: none; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.kit-kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; opacity: .85; }
.kit-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: .2rem 0 .3rem; }
.kit-cargo { font-size: 1.15rem; margin: 0 0 .4rem; opacity: .95; }
.kit-slogan { font-style: italic; opacity: .9; margin: 0 0 1.2rem; }
.kit-sec { margin-bottom: 2.4rem; }
.kit-sec h2 { font-size: 1.4rem; display: flex; gap: .5rem; align-items: baseline; }
.kit-bio { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.4rem 1.6rem; font-size: 1.02rem; line-height: 1.7; max-width: 860px; }
.kit-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.kit-photos figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.kit-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.kit-photos figcaption { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem .7rem; font-size: .84rem; }
.kit-photos figcaption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kit-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.kit-video { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.kit-video video { width: 100%; aspect-ratio: 16 / 9; background: #000; display: block; }
.kit-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .6rem .8rem; font-size: .88rem; }
.kit-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kit-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .7rem; }
.kit-doc { display: flex; align-items: center; gap: .8rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: .8rem 1rem; color: var(--ink); text-decoration: none !important; }
.kit-doc:hover { border-color: var(--pri); }
.kit-doc > span:nth-child(2) { flex: 1; min-width: 0; }
.kit-doc strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kit-doc small { color: var(--mut); }
.kit-doc-ic { width: 44px; height: 44px; border-radius: 10px; background: var(--pri-soft); color: var(--pri); display: grid; place-items: center; flex: none; }
.kit-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.4rem 1.6rem; }
.kit-redes { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.kit-redes a { display: inline-block; padding: .4rem .9rem; border-radius: 99px; background: var(--pri-soft); font-weight: 600; font-size: .9rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .only-m { display: inline-grid !important; }
  .only-d { display: none !important; }
  .side { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .22s; box-shadow: var(--sh-lg); }
  .side-open .side { transform: none; }
  .side-open .side-back { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(15,23,42,.45); }
  .top { padding: .55rem .8rem; gap: .5rem; }
  .me { padding: 0; }
  .content { padding: 1rem 16px 5rem; }
  .grid2, .cols2, .kit-contact { grid-template-columns: 1fr; }
  .items { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: .6rem; }
  .item .chk { opacity: 1; }
  h1 { font-size: 1.3rem; }
  .filters input, .filters select { flex: 1 1 100%; }
  .filters label.inl { flex: 1 1 45%; }
  .filters label.inl input { width: 100%; flex: 1; }
  .viewer-body { padding: 60px 8px 16px; }
  .viewer-nav { width: 42px; height: 42px; font-size: 1.6rem; bottom: 18px; top: auto; transform: none; }
  .review { flex-wrap: wrap; }
  .review-th { width: 80px; height: 64px; }
  .review-a { width: 100%; justify-content: stretch; }
  .review-a .btn { flex: 1; }
  .kit-hero-in { flex-direction: column; text-align: center; }
  .kit-logo { width: 110px; height: 110px; }
  .dash { grid-template-columns: 1fr; }
  .hb { grid-template-columns: 100px 1fr auto; }
  .uploads { right: 12px; bottom: 12px; }
  .dl { grid-template-columns: 100px 1fr; }
  .reqs { grid-template-columns: 1fr; }
  .pub-top { padding: .7rem 16px; }
  .pub-top .btn { padding: .5rem .7rem; font-size: .82rem; }
  .table td, .table th { padding: .6rem .7rem; }
  .row-act { justify-content: flex-start; }
  .link-row { flex-direction: column; align-items: stretch; }
}
@media (max-width: 420px) { .kpis { grid-template-columns: 1fr 1fr; gap: .6rem; } .kpi b { font-size: 1.35rem; } .items { grid-template-columns: 1fr 1fr; } }

/* ---------- Subida pública ---------- */
.aporte { max-width: 640px; }
.aporte-hero { text-align: center; margin: .5rem 0 1.2rem; }
.aporte-hero h1 { justify-content: center; font-size: 1.7rem; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent { background: var(--hover); border-radius: 10px; padding: .7rem .8rem; line-height: 1.4; }
.consent input { margin-top: 2px; align-self: flex-start; }
.aporte-ok { text-align: center; padding: 1.5rem .5rem; }
.aporte-ok-ic { width: 72px; height: 72px; border-radius: 50%; background: #dcfce7; color: var(--ok); font-size: 2.2rem; font-weight: 800; display: grid; place-items: center; margin: 0 auto .8rem; }
.pub-link { display: flex; gap: 1rem; align-items: center; margin: .4rem 0 .6rem; flex-wrap: wrap; }
.pub-link > div:last-child { flex: 1; min-width: 240px; }
.qr { width: 132px; height: 132px; flex: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.qr canvas, .qr img { width: 100% !important; height: 100% !important; }
.aporte .btn.big { width: 100%; }
