/* Auditoría visual común OrtaLegal v1.0 */
.ol-audit-panel{
    margin-top:22px;
    border:1px solid rgba(188,146,78,.28);
    border-radius:24px;
    background:rgba(255,253,249,.92);
    box-shadow:0 18px 44px rgba(11,40,69,.08);
    overflow:hidden;
}

.ol-audit-panel > summary{
    list-style:none;
}
.ol-audit-panel > summary::-webkit-details-marker{display:none}

.ol-audit-summary{
    min-height:92px;
    display:grid;
    grid-template-columns:48px minmax(0,1fr) auto 38px;
    align-items:center;
    gap:16px;
    padding:18px 22px;
    cursor:pointer;
    user-select:none;
}
.ol-audit-summary:hover{background:rgba(247,239,224,.46)}
.ol-audit-panel[open] .ol-audit-summary{border-bottom:1px solid rgba(188,146,78,.2)}

.ol-audit-summary-icon{
    width:48px;
    height:48px;
    display:grid;
    place-items:center;
    border-radius:15px;
    background:#fbefd8;
    color:#9b6412;
}
.ol-audit-summary-icon svg{
    width:23px;
    height:23px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.7;
    stroke-linecap:round;
    stroke-linejoin:round;
}
.ol-audit-summary-copy{display:grid;gap:3px;min-width:0}
.ol-audit-eyebrow{
    color:#9b6412;
    font-size:.67rem;
    font-weight:900;
    letter-spacing:.12em;
    text-transform:uppercase;
}
.ol-audit-summary-copy strong{color:#071b36;font-size:1.04rem;line-height:1.2}
.ol-audit-summary-copy small{color:#718094;font-size:.82rem;line-height:1.4}
.ol-audit-summary-count{
    min-width:32px;
    height:32px;
    display:grid;
    place-items:center;
    padding:0 10px;
    border-radius:999px;
    background:#f4eee4;
    color:#8a5a13;
    font-size:.75rem;
    font-weight:900;
}
.ol-audit-summary-toggle{
    width:34px;
    height:34px;
    position:relative;
    border:1px solid #dbe2e9;
    border-radius:50%;
    background:#fff;
}
.ol-audit-summary-toggle::before,
.ol-audit-summary-toggle::after{
    content:"";
    position:absolute;
    left:50%;
    top:50%;
    width:11px;
    height:1.7px;
    border-radius:3px;
    background:#0b2845;
    transform:translate(-50%,-50%);
}
.ol-audit-summary-toggle::after{transform:translate(-50%,-50%) rotate(90deg);transition:transform .18s ease}
.ol-audit-panel[open] .ol-audit-summary-toggle::after{transform:translate(-50%,-50%) rotate(0deg)}

.ol-audit-body{padding:20px 22px 24px}
.ol-audit-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    margin-bottom:18px;
}
.ol-audit-search{
    width:min(520px,100%);
    min-height:44px;
    display:flex;
    align-items:center;
    gap:10px;
    padding:0 14px;
    border:1px solid #dbe2e9;
    border-radius:14px;
    background:#fff;
}
.ol-audit-search:focus-within{border-color:#c28b32;box-shadow:0 0 0 3px rgba(194,139,50,.12)}
.ol-audit-search svg{width:19px;height:19px;fill:none;stroke:#7d8997;stroke-width:1.8;stroke-linecap:round}
.ol-audit-search input{width:100%;min-height:40px;padding:0;border:0;background:transparent;box-shadow:none;outline:0;color:#071b36}
.ol-audit-result-count{color:#718094;font-size:.75rem;font-weight:800;white-space:nowrap}

.ol-audit-list{margin:0;padding:0;list-style:none}
.ol-audit-entry{display:grid;grid-template-columns:24px minmax(0,1fr);gap:10px;position:relative}
.ol-audit-entry + .ol-audit-entry{margin-top:6px}
.ol-audit-rail{position:relative;display:flex;justify-content:center}
.ol-audit-rail::after{
    content:"";
    position:absolute;
    top:20px;
    bottom:-12px;
    width:1px;
    background:#e4e8ed;
}
.ol-audit-entry:last-child .ol-audit-rail::after{display:none}
.ol-audit-dot{
    position:relative;
    z-index:1;
    width:11px;
    height:11px;
    margin-top:18px;
    border:3px solid #fff;
    border-radius:50%;
    background:#8390a0;
    box-shadow:0 0 0 1px #cad2dc;
}
.ol-audit-entry.is-success .ol-audit-dot{background:#278a61;box-shadow:0 0 0 1px #8bc9b0}
.ol-audit-entry.is-danger .ol-audit-dot{background:#c43f36;box-shadow:0 0 0 1px #e3a39e}
.ol-audit-entry.is-warning .ol-audit-dot{background:#b87713;box-shadow:0 0 0 1px #dfbd80}
.ol-audit-entry.is-info .ol-audit-dot{background:#24658c;box-shadow:0 0 0 1px #9abed4}
.ol-audit-card{
    min-width:0;
    padding:14px 16px;
    border:1px solid #e2e7ec;
    border-radius:16px;
    background:#fff;
}
.ol-audit-card header{display:flex;justify-content:space-between;gap:14px;align-items:flex-start}
.ol-audit-card header > div{display:grid;gap:3px}
.ol-audit-card strong{color:#071b36;font-size:.88rem}
.ol-audit-card header span{color:#68778a;font-size:.76rem}
.ol-audit-card time{color:#8793a1;font-size:.72rem;white-space:nowrap}
.ol-audit-entity{margin:8px 0 0;color:#52637a;font-size:.75rem;font-weight:800}
.ol-audit-metadata{display:flex;flex-wrap:wrap;gap:7px;margin:10px 0 0}
.ol-audit-metadata > div{display:flex;gap:5px;max-width:100%;padding:5px 8px;border-radius:9px;background:#f5f7f9;font-size:.7rem}
.ol-audit-metadata dt{color:#718094;font-weight:800}
.ol-audit-metadata dd{margin:0;color:#243a54;overflow-wrap:anywhere}
.ol-audit-empty,.ol-audit-no-results{
    min-height:112px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:12px;
    padding:24px;
    border:1px dashed #d8dfe7;
    border-radius:16px;
    color:#718094;
    text-align:left;
}
.ol-audit-empty > span{width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:#e9f6ef;color:#237b58;font-weight:900}
.ol-audit-empty strong{color:#071b36}
.ol-audit-empty p{margin:3px 0 0;font-size:.8rem}
.ol-audit-no-results{text-align:center;font-size:.82rem}

body.dark .ol-audit-panel{border-color:rgba(205,166,101,.24);background:rgba(14,32,48,.94);box-shadow:0 18px 44px rgba(0,0,0,.22)}
body.dark .ol-audit-summary:hover{background:rgba(255,255,255,.03)}
body.dark .ol-audit-summary-copy strong,
body.dark .ol-audit-search input,
body.dark .ol-audit-card strong,
body.dark .ol-audit-empty strong{color:#f4f7fa}
body.dark .ol-audit-summary-copy small,
body.dark .ol-audit-result-count,
body.dark .ol-audit-card header span,
body.dark .ol-audit-card time{color:#a7b5c3}
body.dark .ol-audit-summary-toggle,
body.dark .ol-audit-search,
body.dark .ol-audit-card{border-color:#31475a;background:#132b3e}
body.dark .ol-audit-summary-toggle::before,
body.dark .ol-audit-summary-toggle::after{background:#f2d291}
body.dark .ol-audit-dot{border-color:#132b3e}
body.dark .ol-audit-rail::after{background:#31475a}
body.dark .ol-audit-metadata > div{background:#193449}
body.dark .ol-audit-metadata dt{color:#9eb0bf}
body.dark .ol-audit-metadata dd,.dark .ol-audit-entity{color:#dce5eb}

@media(max-width:720px){
    .ol-audit-summary{grid-template-columns:42px minmax(0,1fr) 34px;gap:12px;padding:16px}
    .ol-audit-summary-icon{width:42px;height:42px}
    .ol-audit-summary-count{grid-column:2;justify-self:start;height:26px}
    .ol-audit-summary-toggle{grid-column:3;grid-row:1/3}
    .ol-audit-body{padding:16px}
    .ol-audit-toolbar{align-items:stretch;flex-direction:column}
    .ol-audit-result-count{align-self:flex-end}
    .ol-audit-card header{display:grid}
    .ol-audit-card time{white-space:normal}
}

/* RGPD v7.2 · el estado vacío de búsqueda no debe ocupar espacio mientras está oculto. */
.ol-audit-no-results[hidden],
.ol-audit-entry[hidden]{
    display:none!important;
}
