/* app.css — Módulo Auditorías. Estilos inspirados en RattoDev/Presupuesto. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'JDSansPro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--jd-gray-100); color: var(--jd-black);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh;
}
[hidden] { display: none !important; }
button { font-family: inherit; font-size: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
input, select, textarea { font-family: inherit; font-size: inherit; }
svg { display: block; }
.app { min-height: 100vh; display: flex; flex-direction: column; }
.muted { color: var(--jd-gray-500); }

/* ===================== HEADER (topbar) ===================== */
header.topbar {
  background: var(--jd-green); color: var(--jd-white);
  padding: 18px 24px 0; box-shadow: var(--shadow-md);
  position: sticky; top: 0; z-index: 100;
  border-bottom: 6px solid var(--jd-yellow);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-bottom: 18px; max-width: 1400px; margin: 0 auto;
}
.topbar-left { flex: 1; min-width: 0; display: flex; align-items: center; gap: 16px; }
.ratto-mark { display: flex; align-items: center; padding-left: 18px; border-left: 1.5px solid rgba(255,255,255,0.4); flex-shrink: 0; }
.ratto-logo-img { height: 38px; width: auto; display: block; }
.topbar-title-block { min-width: 0; cursor: pointer; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.topbar-title-block h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -1.2px; line-height: 1; color: var(--jd-white); white-space: nowrap; }
.topbar-title-block .subtitle { margin: 0; font-size: 14px; color: rgba(255,255,255,0.9); font-weight: 400; line-height: 1.2; }
.app-version-tag { opacity: 0.7; font-size: 12px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.nav-btn { width: 40px; height: 40px; border-radius: 8px; background: rgba(255,255,255,0.15); color: var(--jd-white); display: grid; place-items: center; transition: background 0.15s; font-size: 18px; }

/* Toggle de tamaño de fuente (A / A) */
.font-size-toggle { display: flex; background: rgba(255,255,255,0.15); border-radius: 8px; padding: 2px; }
.font-size-toggle button { width: 34px; height: 36px; color: var(--jd-white); border-radius: 6px; font-weight: 700; transition: background 0.15s; }
.font-size-toggle button.active { background: var(--jd-yellow); color: var(--jd-green-darker); }
.font-size-toggle button:nth-child(1) { font-size: 13px; }
.font-size-toggle button:nth-child(2) { font-size: 17px; }

/* Modo "A grande": sube el tamaño del contenido legible (sin romper el layout) */
html.fs-lg body { font-size: 16px; }
html.fs-lg .panel-title { font-size: 25px; }
html.fs-lg .panel-subtitle { font-size: 15px; }
html.fs-lg .section h3 { font-size: 12.5px; }
html.fs-lg .kpi-num { font-size: 30px; }
html.fs-lg .kpi-lbl { font-size: 12.5px; }
html.fs-lg .card .card-title { font-size: 16px; }
html.fs-lg .card .card-meta { font-size: 12.5px; }
html.fs-lg .row-item .ri-title { font-size: 16.5px; }
html.fs-lg .row-item .ri-sub { font-size: 13.5px; }
html.fs-lg .badge { font-size: 13px; }
html.fs-lg table.dt { font-size: 14px; }
html.fs-lg .filtro label { font-size: 12px; }
html.fs-lg .filtro select { font-size: 14.5px; }
html.fs-lg .chart-title { font-size: 15px; }
html.fs-lg .spec, html.fs-lg .comment .c-text, html.fs-lg .c-text { font-size: 15px; }
html.fs-lg .crumb, html.fs-lg .bc-user { font-size: 14px; }
.nav-btn:hover { background: rgba(255,255,255,0.25); }
.nav-btn svg { width: 20px; height: 20px; }

/* ===================== BARRA (breadcrumb + usuario) ===================== */
.breadcrumb-bar {
  background: #1e2c18; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 8px 18px;
}
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; overflow-x: auto; white-space: nowrap; min-width: 0; }
.breadcrumb::-webkit-scrollbar { height: 0; }
.crumb { color: rgba(255,255,255,.65); cursor: pointer; transition: color 0.15s; }
.crumb:hover { color: #fff; }
.crumb.current { color: var(--jd-yellow); font-weight: 700; cursor: default; }
.crumb-sep { color: rgba(255,255,255,.35); }
.bc-user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,.85); white-space: nowrap; flex-shrink: 0; }
.bc-user b { color: #fff; font-weight: 700; }
.bc-sep { color: rgba(255,255,255,.35); }
.bc-salir { color: var(--jd-yellow); font-weight: 700; cursor: pointer; background: none; border: 0; padding: 0; font-size: 13px; }
.bc-salir:hover { text-decoration: underline; }

/* ===================== SHELL (sidebar + contenido) ===================== */
:root { --topbar-h: 92px; --sidebar-w: 236px; }
.shell { display: flex; align-items: flex-start; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--jd-white);
  border-right: 1px solid var(--jd-gray-200);
  position: sticky; top: var(--topbar-h); align-self: flex-start;
  height: calc(100vh - var(--topbar-h)); overflow-y: auto; z-index: 40;
}
.sidebar-nav { display: flex; flex-direction: column; padding: 12px 10px; gap: 2px; }
.side-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 8px; color: var(--jd-gray-700); font-size: 14.5px; font-weight: 600;
  transition: background .15s, color .15s; position: relative;
}
.side-item:hover { background: var(--jd-gray-100); color: var(--jd-green-darker); }
.side-item.active { background: var(--res-ok-bg); color: var(--jd-green-darker); }
.side-item.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--jd-green); }
.side-item .ico { width: 19px; height: 19px; flex-shrink: 0; }
.side-item.soon { color: var(--jd-gray-400); }
.side-item .soon-tag { margin-left: auto; font-size: 9.5px; text-transform: uppercase; letter-spacing: .5px; background: var(--jd-gray-200); color: var(--jd-gray-500); padding: 1px 6px; border-radius: 999px; font-style: normal; font-weight: 700; }
.content-area { flex: 1; min-width: 0; }
.sidebar-backdrop { display: none; }
.only-mobile { display: none !important; }

/* Bloque de usuario en el sidebar (nombre + puesto) */
.side-user { display: flex; align-items: center; gap: 10px; padding: 16px 14px 12px; border-bottom: 1px solid var(--jd-gray-200); }
.su-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--jd-green); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.su-info { display: flex; flex-direction: column; min-width: 0; }
.su-info b { font-size: 14px; color: var(--jd-black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-info small { font-size: 11.5px; color: var(--jd-gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#view-app.sidebar-collapsed .side-user { display: none; }

/* Botón colapsar (pie del sidebar) */
.side-collapse { display: flex; align-items: center; gap: 12px; width: calc(100% - 20px); margin: auto 10px 12px; padding: 10px 12px; border-radius: 8px; color: var(--jd-gray-500); font-size: 13px; font-weight: 700; }
.side-collapse:hover { background: var(--jd-gray-100); color: var(--jd-green); }
.sidebar { display: flex; flex-direction: column; }
.sidebar-nav { flex: 0 0 auto; }

/* Estado colapsado (solo desktop) */
@media (min-width: 861px) {
  #view-app.sidebar-collapsed .sidebar { width: 66px; }
  #view-app.sidebar-collapsed .side-item span, #view-app.sidebar-collapsed .side-item .soon-tag { display: none; }
  #view-app.sidebar-collapsed .side-item { justify-content: center; padding: 11px 0; }
  #view-app.sidebar-collapsed .side-collapse { justify-content: center; }
  #view-app.sidebar-collapsed .side-collapse .sc-txt { display: none; }
}

/* ===================== LAYOUT ===================== */
main { max-width: 1040px; width: 100%; margin: 0 auto; padding: 18px 20px 100px; }
.panel-title { font-size: 22px; font-weight: 700; color: var(--jd-green-darker); margin: 0 0 4px; letter-spacing: -0.3px; }
.panel-subtitle { font-size: 14px; color: var(--jd-gray-700); margin: 0 0 16px; }
.section { margin: 22px 0 8px; }
.section h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--jd-green-darker);
  margin: 0 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--jd-yellow); font-weight: 700;
}

/* ===================== FILTROS ===================== */
.filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; background: var(--jd-white); border: 1px solid var(--jd-gray-200); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.filtro { display: flex; flex-direction: column; gap: 4px; }
.filtro label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--jd-gray-500); font-weight: 700; }
.filtro select { min-width: 130px; padding: 8px 10px; border: 1.5px solid var(--jd-gray-300); border-radius: 8px; background: var(--jd-white); color: var(--jd-black); }
.filtro select:focus { outline: none; border-color: var(--jd-green); }
.filtro-clear { padding: 9px 14px; border: 1.5px solid var(--jd-gray-300); border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--jd-gray-700); background: var(--jd-white); }
.filtro-clear:hover { border-color: var(--jd-green); color: var(--jd-green); }

/* ===================== KPIs ===================== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--jd-white); border: 1px solid var(--jd-gray-200); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.kpi-num { font-size: 26px; font-weight: 700; color: var(--jd-green-darker); line-height: 1; }
.kpi-num.bad { color: var(--res-bad); } .kpi-num.warn { color: var(--res-warn); } .kpi-num.ok { color: var(--res-ok); }
.kpi-lbl { color: var(--jd-gray-500); font-size: 12px; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.4px; }

/* ===================== CARDS / GRIDS ===================== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(182px, 1fr)); gap: 10px; }
.card { background: var(--jd-white); border: 1.5px solid var(--jd-gray-200); border-radius: var(--radius); padding: 11px 12px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s; box-shadow: var(--shadow-sm); }
.card:hover { border-color: var(--jd-green); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card .card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; margin-bottom: 5px; }
.card .card-id { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--jd-green-darker); }
.card .card-title { font-size: 14.5px; font-weight: 700; color: var(--jd-black); margin: 1px 0; }
.card .card-meta { font-size: 11.5px; color: var(--jd-gray-700); display: flex; flex-wrap: wrap; gap: 2px 8px; }
.card .card-pct { font-size: 18px; font-weight: 700; color: var(--jd-green-darker); }
.card .badge { font-size: 10.5px; padding: 1px 7px; }

/* progress bar de % */
.pbar { height: 6px; background: var(--jd-gray-200); border-radius: 999px; overflow: hidden; margin-top: 7px; }
.pbar > span { display: block; height: 100%; background: var(--jd-green); border-radius: 999px; }

/* ===================== BADGES ===================== */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.ok { background: var(--res-ok-bg); color: var(--res-ok); }
.badge.warn { background: var(--res-warn-bg); color: var(--res-warn); }
.badge.bad { background: var(--res-bad-bg); color: var(--res-bad); }
.badge.na { background: var(--res-na-bg); color: var(--res-na); }
.badge.solid-ok { background: var(--res-ok); color: #fff; }
.badge.solid-bad { background: var(--res-bad); color: #fff; }

/* ===================== LISTAS (categorías / items) ===================== */
.row-list { display: flex; flex-direction: column; gap: 8px; }
.row-item { display: flex; align-items: center; gap: 12px; background: var(--jd-white); border: 1px solid var(--jd-gray-200); border-left: 4px solid var(--jd-gray-300); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.row-item:hover { border-left-color: var(--jd-green); background: var(--jd-gray-50); }
.row-item.ok { border-left-color: var(--res-ok); } .row-item.warn { border-left-color: var(--res-warn); }
.row-item.bad { border-left-color: var(--res-bad); } .row-item.na { border-left-color: var(--res-na); }
.row-item .ri-main { flex: 1; min-width: 0; }
.row-item .ri-title { font-weight: 700; font-size: 15px; }
.row-item .ri-sub { font-size: 12.5px; color: var(--jd-gray-500); }
.row-item .ri-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.row-item .ri-chevron { color: var(--jd-gray-400); }
.mini-comment { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--jd-green); font-weight: 700; }

/* ===================== DETAIL CARD ===================== */
.detail-head { background: var(--jd-white); border: 1px solid var(--jd-gray-200); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); margin-bottom: 8px; }
.detail-head .dh-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.detail-head h2 { margin: 0 0 2px; font-size: 20px; color: var(--jd-green-darker); }
.detail-head .dh-meta { font-size: 13px; color: var(--jd-gray-700); display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.detail-card { background: var(--jd-white); border: 1px solid var(--jd-gray-200); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 8px 18px; margin: 8px 0; }
.spec { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dotted var(--jd-gray-300); padding: 4px 0; font-size: 13.5px; }
.spec .lbl { color: var(--jd-gray-700); } .spec .val { font-weight: 700; }

/* ===================== TIMELINE ===================== */
.tl-wrap { background: var(--jd-white); border: 1px solid var(--jd-gray-200); border-radius: var(--radius); padding: 12px 8px 6px; box-shadow: var(--shadow-sm); }
.tl-subtitle { font-size: 12.5px; color: var(--jd-gray-700); padding: 0 8px 4px; }
.tl-scroller { overflow-x: auto; }
.tl-svg { width: 100%; min-width: 520px; height: 150px; }
.tl-grid { stroke: var(--jd-gray-200); stroke-width: 1; stroke-dasharray: 3 3; }
.tl-axis { fill: var(--jd-gray-400); font-size: 9px; }
.tl-line { fill: none; stroke: var(--jd-green); stroke-width: 2.5; opacity: 0.55; }
.tl-val { fill: var(--jd-gray-700); font-size: 11px; font-weight: 700; text-anchor: middle; }
.tl-per { fill: var(--jd-gray-500); font-size: 10px; text-anchor: middle; }
.tl-node.current .tl-val { fill: var(--jd-green-darker); }
.tl-node:hover circle { filter: brightness(0.92); }

/* ===================== COMENTARIOS ===================== */
.thread { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.comment { border: 1px solid var(--jd-gray-200); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--jd-gray-50); }
.comment.rol-auditoria { border-left: 3px solid var(--jd-green); }
.comment.rol-responsable { border-left: 3px solid var(--jd-yellow-dark); }
.comment .c-head { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--jd-gray-500); margin-bottom: 4px; }
.comment .c-autor { font-weight: 700; color: var(--jd-gray-700); }
.comment .c-text { font-size: 14px; }
.comment-form { margin-top: 12px; display: flex; gap: 8px; align-items: flex-start; }
.comment-form textarea { flex: 1; min-height: 56px; resize: vertical; border: 1.5px solid var(--jd-gray-300); border-radius: 8px; padding: 9px; background: var(--jd-white); color: var(--jd-black); }
.comment-form textarea:focus { outline: none; border-color: var(--jd-green); }

/* ===================== MÉTRICAS / GRÁFICOS ===================== */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.chart-card { background: var(--jd-white); border: 1px solid var(--jd-gray-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px 16px; margin-bottom: 14px; }
.charts-grid .chart-card { margin-bottom: 0; }
.chart-title { font-size: 13px; font-weight: 700; color: var(--jd-green-darker); margin-bottom: 10px; }
.chart-body { min-height: 40px; }
.tl-threshold { stroke: var(--res-warn); stroke-width: 2; stroke-dasharray: 5 4; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; font-size: 12px; color: var(--jd-gray-700); }
.chart-legend.col { flex-direction: column; gap: 6px; }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-line { width: 16px; height: 0; border-top: 2px dashed var(--res-warn); display: inline-block; }

/* Donut (conic-gradient) */
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; }
.donut { width: 150px; height: 150px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--res-ok) 0 var(--deg, 0deg), var(--res-bad) var(--deg, 0deg) 360deg); display: grid; place-items: center; }
.donut-hole { width: 96px; height: 96px; border-radius: 50%; background: var(--jd-white); display: grid; place-items: center; text-align: center; box-shadow: inset 0 0 0 1px var(--jd-gray-200); }
.donut-hole b { font-size: 24px; color: var(--jd-green-darker); line-height: 1; }
.donut-hole span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--jd-gray-500); }

/* Barras horizontales */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 42px; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-label { color: var(--jd-gray-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: var(--jd-gray-200); border-radius: 999px; height: 10px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--res-ok); }
.bar-fill.warn { background: var(--res-warn); } .bar-fill.bad { background: var(--res-bad); }
.bar-val { text-align: right; font-weight: 700; color: var(--jd-gray-700); }

/* ===================== TABS ===================== */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--jd-gray-200); margin: 6px 0 16px; overflow-x: auto; }
.tab { padding: 9px 16px; font-size: 14px; font-weight: 700; color: var(--jd-gray-500); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tab:hover { color: var(--jd-green); }
.tab.active { color: var(--jd-green-darker); border-bottom-color: var(--jd-green); }

/* ===================== RADAR ===================== */
.radar-wrap { display: grid; place-items: center; }
.radar-svg { width: 100%; max-width: 300px; height: auto; }
.radar-grid { fill: none; stroke: var(--jd-gray-200); stroke-width: 1; }
.radar-axis { stroke: var(--jd-gray-200); stroke-width: 1; }
.radar-label { fill: var(--jd-gray-700); font-size: 9px; font-weight: 700; }
.radar-val { fill: var(--jd-green-darker); font-size: 9px; font-weight: 700; }
.radar-data { fill: color-mix(in srgb, var(--jd-green) 25%, transparent); stroke: var(--jd-green); stroke-width: 2; }

/* ===================== TABLA PAGINADA ===================== */
.dt-wrap { background: var(--jd-white); border: 1px solid var(--jd-gray-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.dt-scroll { overflow-x: auto; }
table.dt { width: 100%; border-collapse: collapse; min-width: 640px; font-size: 13px; }
table.dt th { text-align: left; background: var(--jd-gray-50); color: var(--jd-gray-500); font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; padding: 9px 10px; border-bottom: 1px solid var(--jd-gray-200); white-space: nowrap; }
table.dt th.dt-sortable { cursor: pointer; user-select: none; transition: color .12s; }
table.dt th.dt-sortable:hover { color: var(--jd-green); }
table.dt th .dt-arrow { color: var(--jd-green); font-size: 9px; }
table.dt td { padding: 8px 10px; border-bottom: 1px solid var(--jd-gray-100); vertical-align: middle; }
table.dt tbody tr:hover { background: var(--jd-gray-50); }
.dt-id { white-space: nowrap; }
.dt-anchor { color: var(--jd-green); font-weight: 700; cursor: pointer; text-decoration: underline; }
.dt-anchor:hover { color: var(--jd-green-darker); }
.dt-empty { text-align: center; color: var(--jd-gray-500); padding: 20px; }
.dt-pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 8px 12px; border-top: 1px solid var(--jd-gray-200); }
.dt-pageinfo { font-size: 12px; color: var(--jd-gray-500); }

/* ===================== RESUMEN IMPRIMIBLE (PDF) ===================== */
.doc-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; overflow-y: auto; padding: 24px 12px; }
.doc { max-width: 820px; margin: 0 auto; }
.doc-bar { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 12px; }
.doc-page { background: #fff; color: #1a1a1a; border-radius: 8px; padding: 30px 34px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.doc-head { display: flex; align-items: center; gap: 16px; border-bottom: 3px solid var(--jd-yellow); padding-bottom: 14px; margin-bottom: 16px; }
.doc-logo { height: 40px; background: var(--jd-green); padding: 6px 10px; border-radius: 6px; }
.doc-head h1 { margin: 0; font-size: 22px; color: var(--jd-green-darker); }
.doc-head p { margin: 0; color: #666; font-weight: 700; }
.doc-score { margin-left: auto; text-align: right; }
.doc-score b { display: block; font-size: 30px; color: var(--jd-green-darker); }
table.doc-meta { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
table.doc-meta td { border: 1px solid #e5e5e5; padding: 7px 10px; font-size: 12.5px; vertical-align: top; }
table.doc-meta b { color: #666; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; }
.doc-kpis { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; margin-bottom: 16px; }
.doc-page h2 { font-size: 14px; color: var(--jd-green-darker); border-bottom: 2px solid var(--jd-yellow); padding-bottom: 5px; }
.doc-cat { font-size: 12.5px; color: var(--jd-green-darker); background: #f2f5ee; padding: 6px 10px; border-left: 3px solid var(--jd-green); margin: 16px 0 6px; border-radius: 0 4px 4px 0; }
.doc-cat + .doc-items { margin-top: 0; }
table.doc-items { width: 100%; border-collapse: collapse; font-size: 12px; }
table.doc-items th { text-align: left; background: #f5f5f5; padding: 6px 8px; border-bottom: 1px solid #ddd; }
table.doc-items td { padding: 6px 8px; border-bottom: 1px solid #eee; }

@media print {
  body > *:not(.doc-overlay) { display: none !important; }
  .doc-overlay { position: static; background: #fff; padding: 0; }
  .doc-bar { display: none !important; }
  .doc-page { box-shadow: none; border-radius: 0; padding: 0; }
}

/* ===================== PLANTILLAS (constructor) ===================== */
.card-static { background: var(--jd-white); border: 1px solid var(--jd-gray-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 8px; }
.pl-list-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pl-acts { gap: 8px; }
.btn-mini { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--jd-gray-300); background: var(--jd-white); color: var(--jd-gray-700); display: inline-grid; place-items: center; font-size: 14px; }
.btn-mini:hover { border-color: var(--jd-green); color: var(--jd-green); }
.btn-mini.danger:hover { border-color: var(--res-bad); color: var(--res-bad); }

.pl-editor { display: flex; flex-direction: column; gap: 14px; }
.pl-head-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.pl-head-grid .filtro { flex: 1; min-width: 150px; }
.pl-head-grid input, .pl-head-grid select { padding: 9px 10px; border: 1.5px solid var(--jd-gray-300); border-radius: 8px; background: var(--jd-white); color: var(--jd-black); width: 100%; }
.pl-head-grid input:focus, .pl-head-grid select:focus { outline: none; border-color: var(--jd-green); }
.pl-resumen { margin-top: 10px; font-size: 13px; }

.pl-secs { display: flex; flex-direction: column; gap: 12px; }
.pl-sec { background: var(--jd-white); border: 1px solid var(--jd-gray-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.pl-sec-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--jd-gray-50); border-bottom: 1px solid var(--jd-gray-200); flex-wrap: wrap; }
.pl-caret { color: var(--jd-gray-500); font-size: 13px; width: 16px; }
.pl-sec.collapsed .pl-caret { transform: rotate(-90deg); }
.pl-sec.collapsed .pl-sec-body { display: none; }
.pl-sec-num { font-weight: 700; color: var(--jd-green-darker); }
.pl-sec-nombre { flex: 1; min-width: 160px; padding: 8px 10px; border: 1.5px solid var(--jd-gray-300); border-radius: 8px; background: var(--jd-white); color: var(--jd-black); font-weight: 600; }
.pl-sec-nombre:focus { outline: none; border-color: var(--jd-green); }
.pl-sec-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pl-sec-badges .badge { display: inline-flex; align-items: center; gap: 6px; }
.pl-sec-imp, .pl-imp { width: 56px; padding: 3px 6px; border: 1px solid var(--jd-gray-300); border-radius: 6px; background: var(--jd-white); color: var(--jd-black); font-weight: 700; text-align: center; }
.pl-sec-actions { display: flex; gap: 6px; }
.pl-sec-body { padding: 12px 14px; }
.pl-items-scroll { overflow-x: auto; }
table.pl-items { width: 100%; border-collapse: collapse; min-width: 760px; }
table.pl-items th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--jd-gray-500); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--jd-gray-200); }
table.pl-items td { padding: 6px 8px; border-bottom: 1px solid var(--jd-gray-100); vertical-align: middle; }
table.pl-items input[type=text], table.pl-items select { width: 100%; padding: 6px 8px; border: 1px solid var(--jd-gray-300); border-radius: 6px; background: var(--jd-white); color: var(--jd-black); }
table.pl-items input:focus, table.pl-items select:focus { outline: none; border-color: var(--jd-green); }
.pl-num { font-weight: 700; color: var(--jd-gray-500); white-space: nowrap; }
.pl-pct { white-space: nowrap; font-weight: 700; color: var(--jd-green-darker); }
.pl-tog { text-align: center; }
.pl-row-acts { display: flex; gap: 4px; }
.pl-add-item { margin-top: 10px; }
.pl-foot { display: flex; gap: 10px; margin-top: 6px; }

/* Switch (toggle) */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--jd-gray-300); border-radius: 999px; transition: .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--jd-green); }
.switch input:checked + span::before { transform: translateX(16px); }

/* ===================== CARGA IN-APP ===================== */
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.section-row h3 { margin-bottom: 0; }
.carga-list { display: flex; flex-direction: column; gap: 10px; }
.carga-item { background: var(--jd-white); border: 1px solid var(--jd-gray-200); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); }
.ci-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ci-num { font-weight: 700; color: var(--jd-gray-500); font-size: 12px; }
.ci-name { font-weight: 700; font-size: 15px; flex: 1; min-width: 0; }
.ci-flags { display: flex; gap: 6px; flex-wrap: wrap; }
.ci-flag { font-size: 10.5px; font-weight: 700; color: var(--jd-gray-700); background: var(--jd-gray-100); border-radius: 999px; padding: 2px 8px; }
.ci-res { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ci-res-btn { border: 1.5px solid var(--jd-gray-300); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 700; color: var(--jd-gray-700); background: var(--jd-white); transition: .12s; }
.ci-res-btn:hover { border-color: var(--jd-gray-500); }
.ci-res-btn.active.ok { background: var(--res-ok); border-color: var(--res-ok); color: #fff; }
.ci-res-btn.active.warn { background: var(--res-warn); border-color: var(--res-warn); color: #fff; }
.ci-res-btn.active.bad { background: var(--res-bad); border-color: var(--res-bad); color: #fff; }
.ci-res-btn.active.na { background: var(--res-na); border-color: var(--res-na); color: #fff; }
.ci-com { width: 100%; min-height: 46px; resize: vertical; border: 1.5px solid var(--jd-gray-300); border-radius: 8px; padding: 8px; font-family: inherit; font-size: 13.5px; background: var(--jd-white); color: var(--jd-black); }
.ci-com:focus { outline: none; border-color: var(--jd-green); }
.ci-evi { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.ci-attach { cursor: pointer; font-size: 13px; padding: 7px 12px; }
.ci-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.ci-thumb { display: flex; align-items: center; gap: 6px; background: var(--jd-gray-50); border: 1px solid var(--jd-gray-200); border-radius: 8px; padding: 4px 8px 4px 4px; }
.ci-thumb img { width: 34px; height: 34px; object-fit: cover; border-radius: 5px; display: block; }
.ci-thumb .ci-file { width: 34px; height: 34px; display: grid; place-items: center; font-size: 18px; }
.ci-thumb-name { font-size: 12px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-thumb-x { color: var(--jd-gray-500); font-size: 16px; line-height: 1; padding: 0 2px; }
.ci-thumb-x:hover { color: var(--res-bad); }

/* Galería de evidencia (detalle de item) */
.evi-galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.evi-cell { background: var(--jd-white); border: 1px solid var(--jd-gray-200); border-radius: var(--radius-sm); padding: 8px; text-align: center; box-shadow: var(--shadow-sm); }
.evi-cell img { width: 100%; height: 90px; object-fit: cover; border-radius: 5px; display: block; margin-bottom: 6px; }
.evi-cell .ci-file { font-size: 34px; display: block; margin: 8px 0; }
.evi-name { font-size: 11.5px; color: var(--jd-gray-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* ===================== FORM DE ACCIONES ===================== */
.accion-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.accion-form textarea, textarea.f-texto {
  width: 100%; min-height: 68px; resize: vertical; border: 1.5px solid var(--jd-gray-300);
  border-radius: 8px; padding: 9px; font-family: inherit; background: var(--jd-white); color: var(--jd-black);
}
.accion-form textarea:focus, textarea.f-texto:focus { outline: none; border-color: var(--jd-green); }
.accion-form-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mini-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--jd-gray-500); font-weight: 700; }
.est-select, .accion-form select { padding: 8px 10px; border: 1.5px solid var(--jd-gray-300); border-radius: 8px; background: var(--jd-white); color: var(--jd-black); }
.est-select:focus, .accion-form select:focus { outline: none; border-color: var(--jd-green); }
.form-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.form-grid .filtro input, .f-resp { padding: 8px 10px; border: 1.5px solid var(--jd-gray-300); border-radius: 8px; background: var(--jd-white); color: var(--jd-black); min-width: 180px; }
.form-grid .filtro input:focus { outline: none; border-color: var(--jd-green); }

/* ===================== BOTONES ===================== */
.btn-primary { background: var(--jd-green); color: #fff; border-radius: 8px; padding: 9px 16px; font-size: 14px; font-weight: 700; }
.btn-primary:hover { background: var(--jd-green-dark); }
.btn-ghost { background: var(--jd-white); color: var(--jd-green); border: 1.5px solid var(--jd-green); border-radius: 8px; padding: 8px 14px; font-weight: 700; font-size: 13.5px; }
.btn-ghost:hover { background: var(--jd-gray-50); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--jd-green); font-weight: 700; font-size: 13.5px; margin-bottom: 12px; }

/* ===================== ESTADOS DE PANTALLA ===================== */
.center-screen { min-height: 80vh; display: grid; place-items: center; text-align: center; padding: 30px; }
.center-screen .box { max-width: 420px; }
.center-screen h1 { color: var(--jd-green); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--jd-gray-300); border-top-color: var(--jd-green); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 16px; }
.loading-box .spinner { margin: 0 0 12px; }
.loading-box .muted { margin: 0; }
.loading-box .ratto-loader { margin: 0 0 16px; }

/* ===== Loader RATTO: los 3 anillos del logo (asimétricos, distinto tamaño/
   grosor/color) que giran, se juntan al centro y vuelven a su posición ===== */
/* c1 = verde grande, c2 = verde claro chico, c3 = gris carbón del logo.
   En oscuro se aclaran el verde y el carbón para que se lean sobre fondo negro. */
:root { --rl-c1: #367C2B; --rl-c2: #a9d08e; --rl-c3: #333b44; }
:root[data-theme="dark"] { --rl-c1: #4a9e46; --rl-c3: #b3bcc6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --rl-c1: #4a9e46; --rl-c3: #b3bcc6; } }
/* El conjunto gira alrededor del centro con velocidad no lineal: la curva
   ease-in-out hace que acelere en el medio de cada vuelta y desacelere en las
   puntas (el punto lento cae en la costura 0°/360°, así el giro es continuo). */
.ratto-loader { position: relative; width: 64px; height: 64px; margin: 0 auto; animation: rl-spin 2.4s cubic-bezier(.76,.05,.24,.95) infinite; will-change: transform; }
.ratto-loader .rl-ring { position: absolute; box-sizing: border-box; border-radius: 50%; border: solid currentColor; }
/* Geometría calcada del logo: cada anillo su tamaño, grosor y posición,
   con aire entre ellos y centrada en el recuadro para que gire equilibrada. */
/* Grosores enteros a propósito: un borde fraccionario (p.ej. 5.5px) redondea
   distinto por lado al rotar y el anillo se ve ovalado. Enteros = redondo. */
.ratto-loader .rl-1 { color: var(--rl-c1); width: 30px; height: 30px; border-width: 8px; left: 4px;  top: 7px;  }
.ratto-loader .rl-2 { color: var(--rl-c2); width: 20px; height: 20px; border-width: 6px; left: 38px; top: 11px; }
.ratto-loader .rl-3 { color: var(--rl-c3); width: 26px; height: 26px; border-width: 7px; left: 21px; top: 36px; }
@keyframes rl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ratto-loader { animation: none; }
  .ratto-loader .rl-ring { animation: rl-fade 1.4s ease-in-out infinite; }
  .ratto-loader .rl-2 { animation-delay: .18s; } .ratto-loader .rl-3 { animation-delay: .36s; }
  @keyframes rl-fade { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
}
/* Buscador de auditorías (filtro de texto en cliente) */
.aud-search { margin: 2px 0 14px; }
.aud-search input { width: 100%; max-width: 460px; box-sizing: border-box; padding: 10px 12px; border: 1px solid #d3d8cf; border-radius: 10px; font-size: 14px; background: #fff; color: #1f2420; }
.aud-search input::placeholder { color: #9aa39a; }
.aud-search input:focus { outline: none; border-color: var(--jd-green, #367C2B); box-shadow: 0 0 0 3px rgba(54, 124, 43, .15); }
:root[data-theme="dark"] .aud-search input { background: #1f251f; color: #e7ece7; border-color: #3a423a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .aud-search input { background: #1f251f; color: #e7ece7; border-color: #3a423a; } }

/* Botón destructivo + firma del auditor */
.btn-danger { background: #c0392b; color: #fff; border: none; padding: 9px 14px; border-radius: var(--radius); font-weight: 600; cursor: pointer; }
.btn-danger:hover { filter: brightness(0.95); }
.btn-danger:disabled { opacity: .6; cursor: default; }
.detail-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 8px 0 4px; flex-wrap: wrap; }
.card-proc { border-left: 3px solid var(--jd-yellow, #ffde00); }
.firma-box .firma-bar { margin-top: 8px; }
.firma-canvas { width: 100%; max-width: 600px; height: 180px; background: #fff; border: 1px dashed var(--jd-gray-300); border-radius: var(--radius); touch-action: none; cursor: crosshair; display: block; }
.firma-view { max-width: 320px; width: 100%; background: #fff; border: 1px solid var(--jd-gray-300); border-radius: var(--radius); padding: 6px; }
/* Wizard de carga (un ítem por paso) */
.carga-head { max-width: 720px; margin: 0 auto; }
.carga-step { background: var(--jd-white); border: 1px solid var(--jd-gray-300); border-radius: var(--radius); padding: 18px 18px 20px; max-width: 720px; margin: 14px auto 0; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.cs-sec { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--jd-green); font-weight: 700; margin-bottom: 6px; }
.cs-item { font-size: 19px; font-weight: 600; line-height: 1.35; margin-bottom: 16px; }
.cs-num { display: inline-block; min-width: 26px; height: 26px; line-height: 26px; text-align: center; background: var(--jd-gray-300); border-radius: 6px; margin-right: 8px; font-size: 14px; }
.ci-res.big { display: flex; flex-wrap: wrap; gap: 8px; }
.ci-res.big .ci-res-btn { flex: 1 1 46%; padding: 14px 10px; font-size: 15px; }
.cs-detalle { margin-top: 16px; border-top: 1px dashed var(--jd-gray-300); padding-top: 14px; }
.cs-lbl { display: block; font-size: 13px; color: var(--jd-gray-500); margin-bottom: 6px; font-weight: 600; }
.carga-nav { max-width: 720px; margin: 14px auto 0; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
/* Modo GPV (/gpv-aud): vista embebida, sin sidebar, con botón Volver */
.gpv-mode .sidebar, .gpv-mode .sidebar-backdrop, .gpv-mode #btn-menu, .gpv-mode .side-collapse { display: none !important; }
.gpv-mode .content-area { width: 100%; }
.gpv-volver { background: transparent; border: 1px solid var(--jd-gray-300); color: inherit; border-radius: var(--radius); padding: 4px 12px; margin-right: 10px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.gpv-volver:hover { background: rgba(0,0,0,.06); }
.empty { text-align: center; color: var(--jd-gray-500); padding: 30px; background: var(--jd-white); border-radius: var(--radius); border: 1px dashed var(--jd-gray-300); }

/* ===================== SLIDER HISTÓRICO POR SUCURSAL ===================== */
.suc-slider { background: var(--jd-white); border: 1px solid var(--jd-gray-200); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 12px 14px; margin-bottom: 16px; }
.suc-slider-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.suc-title { margin: 0; font-size: 13px; font-weight: 700; color: var(--jd-green-darker); text-transform: uppercase; letter-spacing: .4px; }
.suc-nav { display: flex; align-items: center; gap: 8px; }
.suc-count { font-size: 12px; color: var(--jd-gray-500); font-weight: 700; min-width: 44px; text-align: center; }
.suc-slide .tl-wrap { border: 0; box-shadow: none; padding: 0; }
.suc-dots { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.suc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--jd-gray-300); cursor: pointer; transition: background .15s, transform .15s; }
.suc-dot:hover { background: var(--jd-gray-400); }
.suc-dot.on { background: var(--jd-green); transform: scale(1.25); }

/* ===================== ORGANIZACIÓN (árbol) ===================== */
.org-tree { display: flex; flex-direction: column; gap: 10px; }
.org-suc { background: var(--jd-white); border: 1px solid var(--jd-gray-200); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.org-suc-head { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 14px 16px; font-weight: 700; color: var(--jd-green-darker); }
.org-suc-head:hover { background: var(--jd-gray-50); }
.org-suc-head .ico { width: 18px; height: 18px; color: var(--jd-green); }
.org-caret { display: inline-block; transition: transform .15s; color: var(--jd-gray-400); font-size: 12px; width: 12px; }
.org-suc-head.open .org-caret { transform: rotate(90deg); }
.org-suc-name { font-size: 15px; }
.org-suc-meta { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--jd-gray-500); }
.org-units { border-top: 1px solid var(--jd-gray-200); }
.org-units.hidden { display: none; }
.org-unit { display: flex; align-items: center; gap: 12px; padding: 11px 16px 11px 30px; cursor: pointer; border-bottom: 1px solid var(--jd-gray-100); transition: background .12s; }
.org-unit:last-child { border-bottom: 0; }
.org-unit:hover { background: var(--jd-gray-50); }
.org-unit .ico { width: 17px; height: 17px; color: var(--jd-gray-500); }
.org-unit .ou-main { flex: 1; min-width: 0; }
.org-unit .ou-name { font-weight: 700; font-size: 14.5px; }
.org-unit .ou-sub { font-size: 12px; color: var(--jd-gray-500); }
.org-unit .ou-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Icono dentro del bloque vacío (placeholder de módulos) */
.empty .ico { width: 34px; height: 34px; color: var(--jd-gray-400); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 860px) {
  .only-mobile { display: grid !important; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 260px;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg);
    z-index: 120;   /* por encima del topbar (z-index 100): antes quedaba debajo y tapaba iconos */
  }
  #view-app.sidebar-open .sidebar { transform: translateX(0); }
  #view-app.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 110; }
  .side-collapse { display: none; }
  .side-user { display: flex; }
  .user-chip { display: none; }              /* en mobile el usuario va en el menú */
}

/* Momentum scrolling en los contenedores desplazables */
.tl-scroller, .dt-scroll, .pl-items-scroll, .breadcrumb, .tabs { -webkit-overflow-scrolling: touch; }

/* ---------- Tablet / mobile grande ---------- */
@media (max-width: 860px) {
  main { padding: 16px 14px 90px; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 10px; }
  .charts-grid { grid-template-columns: 1fr; }
  .filtros { padding: 12px; gap: 8px; }
  .filtro { flex: 1 1 46%; }
  .filtro select { min-width: 0; width: 100%; }
}

/* ---------- Teléfono ---------- */
@media (max-width: 560px) {
  header.topbar { padding: 12px 14px 0; border-bottom-width: 5px; }
  .topbar-inner { padding-bottom: 12px; gap: 10px; }
  .ratto-mark { padding-right: 12px; }
  .ratto-logo-img { height: 30px; }
  .topbar-title-block h1 { font-size: 20px; letter-spacing: -0.6px; }
  .topbar-title-block .subtitle { display: none; }
  .topbar-actions { gap: 6px; }
  .nav-btn { width: 38px; height: 38px; }
  .breadcrumb-bar { padding: 7px 14px; }
  .bc-conectado, .bc-sep { display: none; }   /* el nombre va en el menú; queda solo "Salir" */

  main { padding: 14px 12px 90px; }
  .panel-title { font-size: 19px; }
  .kpi { padding: 12px; } .kpi-num { font-size: 22px; }
  .kpi-lbl { font-size: 10.5px; }

  .filtro { flex: 1 1 100%; }
  .filtros { flex-direction: column; align-items: stretch; }
  .filtros .filtro-clear, .filtros .btn-ghost { width: 100%; margin-left: 0 !important; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }

  .row-item { flex-wrap: wrap; }
  .row-item .ri-right { width: 100%; justify-content: flex-end; }

  .detail-head .dh-top { flex-direction: column; }
  .detail-head .dh-top > div:last-child { text-align: left !important; align-items: flex-start !important; }

  .suc-slider, .chart-card, .detail-card, .card-static { padding: 12px; }
  .doc-overlay { padding: 12px 8px; }
  .doc-page { padding: 18px 16px; }
  .doc-head { flex-wrap: wrap; }
  .doc-meta, .doc-meta tbody, .doc-meta tr { display: block; }
  .doc-meta td { display: block; width: 100%; border: 0; border-bottom: 1px solid #eee; }
}
