/* Portal de Auditores: estilos de página (los que en Contabilidad IA viven
   dentro de cada plantilla) y los componentes propios del portal.
   Va después de base.css y mac.css. */

body { background: var(--v2c-bg); }
main.pa-main { padding: 1.6rem 1.75rem 6rem; max-width: 1360px; }
@media (max-width: 575.98px) { main.pa-main { padding: 1rem .9rem 5rem; } }

/* ── Cabeceras y títulos ── */
.cob-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.1rem; }
.cob-meta { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: .76rem; color: var(--v2c-muted); margin-top: .45rem; }
.cob-meta strong { color: var(--slate-700); }
.sec-title { font-size: .95rem; font-weight: 700; color: var(--slate-900); display: flex; align-items: center; gap: .5rem; margin: 1.6rem 0 .8rem; }
.sec-title i { color: var(--v2c-muted); }
.sec-title .text-muted { font-size: .72rem; font-weight: 500; }
.sec-title:first-child { margin-top: 0; }
.sec-title .acciones { margin-left: auto; display: flex; gap: .4rem; }

/* ── Tarjetas ── */
.db-card { background: #fff; border: 1px solid var(--v2c-border); border-radius: var(--r-xl); overflow: hidden; }
.db-card.h-100 { height: 100%; }
.db-card-hdr { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1.15rem; border-bottom: 1px solid var(--slate-100); background: var(--slate-50); gap: .5rem; flex-wrap: wrap; }
.db-card-title { font-size: .86rem; font-weight: 700; color: var(--slate-800); display: flex; align-items: center; gap: .45rem; margin: 0; }
.db-card-title i { color: var(--v2c-muted); }
.db-card-body { padding: 1rem 1.15rem; }
.db-card-body.p-0 { padding: 0; }
.report-table-wrap { background: #fff; border: 1px solid var(--v2c-border); border-radius: var(--r-xl); overflow-x: auto; }

/* ── KPIs ── */
.exec-kpi { border-radius: var(--r-lg); padding: 1rem 1.15rem; height: 100%; border: 1px solid var(--v2c-border); background: #fff; display: block; text-decoration: none; color: inherit; }
a.exec-kpi:hover { border-color: var(--slate-400); color: inherit; }
.exec-kpi-lbl { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--v2c-muted); display: flex; align-items: center; gap: .35rem; }
.exec-kpi-val { font-size: clamp(1.2rem, 2.1vw, 1.65rem); font-weight: 800; line-height: 1.15; margin-top: .35rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.exec-kpi-sub { font-size: .74rem; color: var(--v2c-muted); margin-top: .3rem; }
.exec-kpi.danger { background: #FFFBFA; border-color: #F1D5D2; }
.exec-kpi.danger .exec-kpi-val { color: var(--danger); }
.exec-kpi.warning { background: #FFFCF5; border-color: #EFE1C6; }
.exec-kpi.success { background: #FBFEFC; border-color: #CFE5DA; }
.exec-kpi.success .exec-kpi-val { color: var(--success); }

.mini-bar { height: 6px; border-radius: 3px; background: var(--slate-100); overflow: hidden; }
.mini-bar-fill { height: 100%; border-radius: 3px; background: var(--slate-800); }
.mini-bar-fill.ok { background: var(--success); }
.barra-avance { height: 10px; border-radius: 6px; background: var(--slate-100); overflow: hidden; display: flex; }
.barra-avance > span { display: block; height: 100%; }
.barra-avance .seg-aceptada { background: var(--success); }
.barra-avance .seg-entregada { background: #D6A84A; }
.barra-avance .seg-curso { background: var(--slate-500); }

/* ── Avisos ── */
.alert-item { display: flex; align-items: flex-start; gap: .6rem; padding: .65rem .85rem; border-radius: var(--r-md); font-size: .83rem; margin-bottom: .75rem; border: 1px solid; }
.alert-item.critico { background: #FFFBFA; border-color: #F1D5D2; color: #7A271A; }
.alert-item.alto { background: #FFFCF5; border-color: #EFE1C6; color: #93370D; }
.alert-item.medio, .alert-item.ok { background: #FBFEFC; border-color: #CFE5DA; color: #05603A; }
.alert-item.info { background: var(--slate-50); border-color: var(--v2c-border); color: var(--slate-700); }

/* ── Pills extra ── */
.pill { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.pill-warn { background: #FFF8EB; color: #8A5A00; border-color: #F0DDB4; }
.pill-sm { font-size: .64rem !important; padding: .12rem .45rem !important; }
.prio-urgente { color: var(--danger); font-weight: 700; }
.prio-alta { color: var(--warning); font-weight: 600; }
.prio-baja { color: var(--slate-400); }
.vencida { color: var(--danger); font-weight: 600; }

/* ── Tablas ── */
.ft { width: 100%; border-collapse: collapse; font-size: .82rem; }
.ft thead th { background: var(--slate-50); color: var(--slate-500); font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: .55rem .75rem; border-bottom: 2px solid var(--v2c-border); white-space: nowrap; }
.ft tbody td { padding: .55rem .75rem; border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
.ft tbody tr:last-child td { border-bottom: none; }
.ft tbody tr:hover td { background: var(--slate-50); }
.ft .r { text-align: right; font-variant-numeric: tabular-nums; }
.ft .c { text-align: center; }
.ft a.fila-link { color: inherit; text-decoration: none; }
.ft a.fila-link:hover { text-decoration: underline; }
.codigo { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .76rem; font-weight: 600; color: var(--slate-600); white-space: nowrap; }

.empty-state { text-align: center; padding: 2.4rem 1rem; color: var(--slate-400); }
.empty-state i { font-size: 1.7rem; display: block; margin-bottom: .4rem; }
.empty-state p { margin: 0; font-size: .84rem; color: var(--slate-500); }

/* ── Menú lateral: contadores ── */
.sidebar-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: .64rem; font-weight: 700; line-height: 1; padding: .26rem .42rem; border-radius: 999px; min-width: 1.25rem; text-align: center; }
.sidebar-badge[hidden] { display: none; }
.sidebar-link.active .sidebar-badge { background: var(--danger); color: #fff; }
.sidebar-encargo { overflow: hidden; text-overflow: ellipsis; }
.sidebar-sub { margin: .1rem 0 .4rem; }
.sidebar-buscar { margin: .1rem .1rem .9rem; position: relative; }
.sidebar-buscar input { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); color: #fff; font-size: .78rem; border-radius: var(--r-md); padding: .42rem .6rem .42rem 1.9rem; width: 100%; }
.sidebar-buscar input::placeholder { color: rgba(255,255,255,.4); }
.sidebar-buscar input:focus { outline: none; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.1); }
.sidebar-buscar i { position: absolute; left: .62rem; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.45); font-size: .78rem; }
.sidebar-user-avatar { font-size: .66rem !important; font-weight: 700; }

/* ── Cabecera de encargo + pestañas ── */
.pa-encargo-hdr { background: #fff; border: 1px solid var(--v2c-border); border-radius: var(--r-xl); padding: 1.1rem 1.25rem 0; margin-bottom: 1.25rem; }
.pa-encargo-hdr h1 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.pa-tabs { display: flex; gap: .15rem; overflow-x: auto; margin: 1rem -.25rem 0; scrollbar-width: none; }
.pa-tabs::-webkit-scrollbar { display: none; }
.pa-tab { display: inline-flex; align-items: center; gap: .35rem; padding: .6rem .6rem; font-size: .79rem; font-weight: 600; color: var(--slate-500); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.pa-tab:hover { color: var(--slate-900); }
.pa-tab.active { color: var(--slate-900); border-bottom-color: var(--slate-900); }
.pa-tab .sidebar-badge { margin-left: .15rem; }

/* ── Fases (pasos) ── */
.pa-fase-movil { font-size: .76rem; color: var(--slate-600); margin-top: .5rem; }
.pa-fases { display: flex; align-items: center; gap: 0; margin-top: .9rem; flex-wrap: wrap; }
.pa-fase { display: flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 600; color: var(--slate-400); padding-right: .5rem; }
.pa-fase .punto { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--slate-300); display: inline-flex; align-items: center; justify-content: center; font-size: .62rem; background: #fff; }
.pa-fase.hecha { color: var(--slate-600); }
.pa-fase.hecha .punto { background: var(--slate-900); border-color: var(--slate-900); color: #fff; }
.pa-fase.actual { color: var(--slate-900); }
.pa-fase.actual .punto { border-color: var(--slate-900); background: #fff; color: var(--slate-900); box-shadow: 0 0 0 3px rgba(14,14,14,.08); }
.pa-fase + .pa-fase::before { content: ""; width: 22px; height: 2px; background: var(--slate-200); margin-right: .5rem; }
.pa-fase.hecha + .pa-fase::before { background: var(--slate-900); }

/* ── Tarjetas de encargo (inicio) ── */
.encargo-card { background: #fff; border: 1px solid var(--v2c-border); border-radius: var(--r-xl); padding: 1.1rem 1.2rem; height: 100%; display: flex; flex-direction: column; gap: .7rem; text-decoration: none; color: inherit; transition: border-color .15s; }
.encargo-card:hover { border-color: var(--slate-400); color: inherit; }
.encargo-card h3 { font-size: 1rem; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.encargo-card .sub { font-size: .76rem; color: var(--v2c-muted); }
.encargo-card .cifras { display: flex; gap: 1rem; font-size: .74rem; color: var(--slate-600); flex-wrap: wrap; }
.encargo-card .cifras strong { color: var(--slate-900); font-size: .9rem; }

/* ── Listas genéricas ── */
.lista-simple { list-style: none; margin: 0; padding: 0; }
.lista-simple > li { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem 1.15rem; border-bottom: 1px solid var(--slate-100); font-size: .83rem; }
.lista-simple > li:last-child { border-bottom: none; }
.lista-simple .meta { font-size: .72rem; color: var(--v2c-muted); }
.lista-simple a { color: inherit; }
.icono-redondo { width: 30px; height: 30px; border-radius: 50%; background: var(--slate-100); color: var(--slate-700); display: inline-flex; align-items: center; justify-content: center; font-size: .82rem; flex-shrink: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--slate-800); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 700; flex-shrink: 0; letter-spacing: .02em; }
.avatar.auditor { background: #5A5A58; }
.avatar.sm { width: 24px; height: 24px; font-size: .58rem; }
.lado-tag { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--v2c-muted); }

/* ── Archivos ── */
.archivo-fila { display: flex; align-items: center; gap: .65rem; padding: .55rem .2rem; border-bottom: 1px solid var(--slate-100); font-size: .82rem; }
.archivo-fila:last-child { border-bottom: none; }
.archivo-fila i.bi-file-earmark, .archivo-fila i[class*="bi-file"] { font-size: 1.2rem; color: var(--slate-500); }
.archivo-fila .nombre { font-weight: 600; word-break: break-word; }
.archivo-fila.retirado { opacity: .5; }
.archivo-fila.retirado .nombre { text-decoration: line-through; }
.zona-subida { border: 1.5px dashed var(--slate-300); border-radius: var(--r-lg); padding: 1rem; text-align: center; background: var(--slate-50); font-size: .8rem; color: var(--slate-500); }
.zona-subida.encima { border-color: var(--slate-800); background: #fff; }

/* ── Hilo de comentarios ── */
.hilo { display: flex; flex-direction: column; gap: .8rem; }
.coment { display: flex; gap: .65rem; }
.coment-cuerpo { background: #fff; border: 1px solid var(--v2c-border); border-radius: var(--r-lg); padding: .6rem .85rem; flex: 1; min-width: 0; }
.coment.interno .coment-cuerpo { background: #FFFCF5; border-color: #EFE1C6; }
.coment-cab { font-size: .72rem; color: var(--v2c-muted); margin-bottom: .2rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.coment-cab strong { color: var(--slate-800); font-size: .78rem; }
.texto-libre { white-space: pre-line; word-break: break-word; font-size: .84rem; }

/* ── Chat ── */
.chat { display: flex; flex-direction: column; height: calc(100vh - 290px); min-height: 420px; background: #fff; border: 1px solid var(--v2c-border); border-radius: var(--r-xl); overflow: hidden; }
.chat-mensajes { flex: 1; overflow-y: auto; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .55rem; background: var(--slate-50); }
.burbuja-fila { display: flex; gap: .5rem; align-items: flex-end; max-width: 78%; }
.burbuja-fila.mia { align-self: flex-end; flex-direction: row-reverse; }
.burbuja { background: #fff; border: 1px solid var(--v2c-border); border-radius: 14px 14px 14px 4px; padding: .5rem .8rem; font-size: .84rem; min-width: 0; }
.burbuja-fila.mia .burbuja { background: var(--slate-900); color: #fff; border-color: var(--slate-900); border-radius: 14px 14px 4px 14px; }
.burbuja .autor { font-size: .68rem; font-weight: 700; color: var(--slate-600); margin-bottom: .1rem; }
.burbuja-fila.mia .burbuja .autor { color: rgba(255,255,255,.65); }
.burbuja .cuando { font-size: .62rem; color: var(--slate-400); margin-top: .2rem; text-align: right; }
.burbuja-fila.mia .burbuja .cuando { color: rgba(255,255,255,.5); }
.burbuja .adjunto { display: flex; align-items: center; gap: .35rem; font-size: .76rem; margin-top: .35rem; padding: .3rem .5rem; border-radius: 8px; background: var(--slate-100); color: var(--slate-800); text-decoration: none; word-break: break-all; }
.burbuja-fila.mia .burbuja .adjunto { background: rgba(255,255,255,.12); color: #fff; }
.burbuja .ref-pbc { font-size: .68rem; font-weight: 700; display: inline-block; margin-bottom: .15rem; }
.burbuja-fila.mia .burbuja .ref-pbc { color: #fff; }
.chat-dia { align-self: center; font-size: .66rem; font-weight: 700; color: var(--slate-500); background: #fff; border: 1px solid var(--v2c-border); border-radius: 999px; padding: .15rem .65rem; text-transform: uppercase; letter-spacing: .06em; }
.chat-form { border-top: 1px solid var(--v2c-border); padding: .7rem; display: flex; gap: .5rem; align-items: flex-end; background: #fff; flex-wrap: wrap; }
.chat-form textarea { flex: 1; resize: none; min-height: 40px; max-height: 160px; font-size: .86rem; }
.chat-adjuntos-lista { width: 100%; font-size: .72rem; color: var(--slate-600); }
@media (max-width: 575.98px) { .burbuja-fila { max-width: 92%; } .chat { height: calc(100vh - 230px); } }

/* ── Calendario ── */
.cal { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; background: #fff; }
.cal th { font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: var(--slate-500); font-weight: 700; padding: .5rem; text-align: left; border-bottom: 1px solid var(--v2c-border); }
.cal td { vertical-align: top; height: 104px; padding: .35rem .4rem; border-right: 1px solid var(--slate-100); border-bottom: 1px solid var(--slate-100); }
.cal td:last-child { border-right: none; }
.cal td.fuera { background: var(--slate-50); }
.cal td.fuera .dia-num { color: var(--slate-300); }
.cal td.hoy .dia-num { background: var(--slate-900); color: #fff; }
.cal .dia-num { font-size: .72rem; font-weight: 700; color: var(--slate-600); display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; }
.cal-ev { display: block; font-size: .66rem; line-height: 1.25; padding: .15rem .35rem; border-radius: 4px; margin-top: .2rem; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev.reunion { background: var(--slate-900); color: #fff; }
.cal-ev.reunion.cancelada { background: var(--slate-200); color: var(--slate-500); text-decoration: line-through; }
.cal-ev.vence { background: #FFF3E0; color: #8A4B00; }
.cal-ev.vence.vencida { background: #FDECEA; color: var(--danger); }
.cal-ev.hito { background: #EAF4EE; color: #05603A; }
.cal-mas { font-size: .62rem; color: var(--slate-500); margin-top: .15rem; display: block; }
.cal-leyenda { display: flex; gap: 1rem; font-size: .72rem; color: var(--slate-600); flex-wrap: wrap; }
.cal-leyenda span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.cal-leyenda .l-reunion::before { background: var(--slate-900); }
.cal-leyenda .l-vence::before { background: #FFD9A8; }
.cal-leyenda .l-hito::before { background: #BFE3CC; }
@media (max-width: 767.98px) {
  .cal td { height: 70px; padding: .2rem; }
  .cal-ev { font-size: 0; padding: 0; height: 6px; border-radius: 3px; }
  .cal th { font-size: .58rem; padding: .3rem .2rem; }
}

/* ── Línea de tiempo (actividad) ── */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--slate-200); }
.timeline li { position: relative; padding: .1rem 0 1rem .9rem; font-size: .82rem; }
.timeline li::before { content: ""; position: absolute; left: -1.53rem; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--slate-400); }
.timeline li.interno::before { border-color: #D6A84A; }
.timeline .meta { font-size: .7rem; color: var(--v2c-muted); }

/* ── Notas ── */
.nota { background: #fff; border: 1px solid var(--v2c-border); border-radius: var(--r-lg); padding: .9rem 1rem; height: 100%; display: flex; flex-direction: column; gap: .4rem; }
.nota.fijada { border-color: var(--slate-900); box-shadow: inset 3px 0 0 var(--slate-900); }
.nota.vis-privada { background: #FAFAF8; }
.nota.vis-equipo { background: #FFFCF5; }
.nota h4 { font-size: .9rem; font-weight: 700; margin: 0; }
.nota .pie { margin-top: auto; font-size: .7rem; color: var(--v2c-muted); display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

/* ── Filtros ── */
.barra-filtros { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .9rem; }
.barra-filtros .form-select, .barra-filtros .form-control { width: auto; min-width: 0; max-width: 210px; }
.barra-filtros .buscar { min-width: 200px; flex: 1 1 220px; max-width: 320px; }
@media (max-width: 575.98px) {
  .barra-filtros .form-select, .barra-filtros .form-control, .barra-filtros .buscar { max-width: none; flex: 1 1 45%; }
  .barra-filtros .buscar { flex-basis: 100%; }
}
.movil-meta { display: none; }
@media (max-width: 991.98px) {
  .movil-meta { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .3rem; font-size: .72rem; }
  .solo-escritorio { display: none !important; }
}
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.chip { font-size: .74rem; font-weight: 600; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--v2c-border); background: #fff; color: var(--slate-600); text-decoration: none; display: inline-flex; gap: .35rem; align-items: center; }
.chip:hover { border-color: var(--slate-400); color: var(--slate-900); }
.chip.on { background: var(--slate-900); border-color: var(--slate-900); color: #fff; }
.chip .n { font-size: .66rem; opacity: .7; }

/* ── Notificaciones ── */
.notif.no-leida { background: #FFFDF7; }
.notif.no-leida .texto { font-weight: 600; }
.punto-nuevo { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex-shrink: 0; margin-top: .45rem; }

/* ── Login ── */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: var(--v2c-bg); }
.login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--v2c-border); border-radius: var(--r-2xl); padding: 2rem 1.9rem; }
.login-marca { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.4rem; }
.login-marca .v2c-logo { height: 20px; color: var(--slate-900); }
.login-marca .app-name { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--slate-600); }

/* ── Varios ── */
.v2c-logo { height: 18px; width: auto; }
.form-label { font-size: .76rem; font-weight: 600; color: var(--slate-700); }
.texto-pequeno { font-size: .76rem; }
.cursor-pointer { cursor: pointer; }
.sticky-acciones { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--v2c-border); padding: .6rem 1rem; display: none; gap: .5rem; align-items: center; flex-wrap: wrap; z-index: 5; }
.sticky-acciones.visible { display: flex; }
.cuenta-atras { font-size: .7rem; font-weight: 700; padding: .12rem .45rem; border-radius: 999px; background: var(--slate-100); color: var(--slate-700); white-space: nowrap; }
.cuenta-atras.pronto { background: #FFF3E0; color: #8A4B00; }
.cuenta-atras.pasado { background: #FDECEA; color: var(--danger); }
.dl-ficha { display: grid; grid-template-columns: 130px 1fr; gap: .45rem .9rem; font-size: .82rem; margin: 0; }
.dl-ficha dt { color: var(--v2c-muted); font-weight: 600; font-size: .74rem; }
.dl-ficha dd { margin: 0; min-width: 0; word-break: break-word; }
@media (max-width: 575.98px) { .dl-ficha { grid-template-columns: 1fr; gap: .1rem; } .dl-ficha dd { margin-bottom: .45rem; } }
.qr-2fa { width: 200px; height: 200px; image-rendering: pixelated; border: 1px solid var(--v2c-border); border-radius: var(--r-md); }
.resaltado { background: #FFF3C4; padding: 0 .1rem; border-radius: 2px; }

/* ── Impresión (informe de estado) ── */
@media print {
  .sidebar, .topbar, .sidebar-backdrop, .no-print, .pa-tabs { display: none !important; }
  .app-content { margin-left: 0 !important; }
  main.pa-main { padding: 0 !important; max-width: none; }
  body { background: #fff !important; }
  .db-card, .report-table-wrap, .pa-encargo-hdr { border: none !important; }
  .ft { font-size: 9pt; }
  .ft thead th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit !important; text-decoration: none !important; }
  .salto { page-break-before: always; }
}
