
/* ============================================================
   OrtaLegal · Visual v0.3
   Capa estética sobre el MVP técnico.
   Paleta basada en azul jurídico, oro suave y fondos cálidos.
   ============================================================ */

:root{
    --ol-navy:#0b2845;
    --ol-navy-2:#12395d;
    --ol-navy-3:#071a2d;
    --ol-gold:#bd9250;
    --ol-gold-2:#d7bd7c;
    --ol-gold-soft:#f5ead7;
    --ol-cream:#f7f3ec;
    --ol-paper:#fffdf8;
    --ol-white:#ffffff;
    --ol-ink:#102033;
    --ol-muted:#6f7886;
    --ol-line:#e8ded0;
    --ol-line-2:#efe8dd;
    --ol-green:#2f7657;
    --ol-red:#a43a34;
    --ol-amber:#9a6a1f;
    --ol-shadow:0 18px 42px rgba(16,32,51,.08);
    --ol-shadow-soft:0 10px 24px rgba(16,32,51,.06);
    --ol-radius:22px;
    --ol-radius-sm:14px;

    --azul:var(--ol-navy);
    --azul-2:var(--ol-navy-2);
    --dorado:var(--ol-gold);
    --dorado-2:var(--ol-gold-2);
    --fondo:var(--ol-cream);
    --blanco:var(--ol-paper);
    --texto:var(--ol-ink);
    --muted:var(--ol-muted);
    --linea:var(--ol-line);
    --oro:var(--ol-gold);
    --radio:var(--ol-radius);
    --sombra:var(--ol-shadow);
}

*{box-sizing:border-box}

html,body{
    margin:0;
    min-height:100%;
    font-family:"Inter","Segoe UI",ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
    background:
        radial-gradient(circle at 0 0, rgba(189,146,80,.13), transparent 30rem),
        linear-gradient(180deg,#fbfaf7 0%,var(--ol-cream) 100%);
    color:var(--ol-ink);
    text-rendering:geometricPrecision;
}

body.dark{
    --ol-cream:#071522;
    --ol-paper:#0e2237;
    --ol-white:#0e2237;
    --ol-ink:#f5f0e7;
    --ol-muted:#b3bfcb;
    --ol-line:#26405a;
    --ol-line-2:#1d344d;
    --ol-shadow:0 18px 46px rgba(0,0,0,.32);
    --fondo:var(--ol-cream);
    --blanco:var(--ol-paper);
    --texto:var(--ol-ink);
    --muted:var(--ol-muted);
    --linea:var(--ol-line);
    background:
        radial-gradient(circle at 0 0, rgba(189,146,80,.12), transparent 30rem),
        linear-gradient(180deg,#071522 0%,#081a2d 100%);
}

a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit}
button{cursor:pointer}

/* ---------- Header ---------- */

.topbar{
    position:sticky;
    top:0;
    z-index:50;
    height:78px;
    background:rgba(255,253,248,.88);
    backdrop-filter:blur(18px);
    border-bottom:1px solid var(--ol-line-2);
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 28px;
}

body.dark .topbar{background:rgba(8,26,45,.88)}

.brand{
    display:flex;
    align-items:center;
    gap:14px;
    min-width:0;
}

.brand-logo-full{
    width:154px;
    height:54px;
    object-fit:contain;
    object-position:left center;
    display:block;
    filter:drop-shadow(0 2px 2px rgba(11,40,69,.06));
}

.brand-logo-symbol{
    width:42px;
    height:42px;
    object-fit:contain;
    display:block;
}

.brand-wording{
    display:flex;
    flex-direction:column;
    gap:2px;
    padding-left:2px;
}

.brand-wording strong{
    font-size:15px;
    letter-spacing:.01em;
    color:var(--ol-navy);
}

body.dark .brand-wording strong{color:#fff}

.brand-wording small{
    color:var(--ol-muted);
    font-size:12px;
}

.iso{display:none}

.top-actions{
    display:flex;
    align-items:center;
    gap:10px;
}

.pill{
    border:1px solid var(--ol-line);
    background:rgba(255,255,255,.74);
    color:var(--ol-ink);
    padding:9px 14px;
    border-radius:999px;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    gap:8px;
    box-shadow:0 4px 12px rgba(16,32,51,.04);
    transition:.18s ease;
}

body.dark .pill{background:rgba(14,34,55,.86)}

.pill:hover{
    transform:translateY(-1px);
    border-color:rgba(189,146,80,.55);
}

.pill.gold{
    background:linear-gradient(135deg,var(--ol-gold),var(--ol-gold-2));
    border-color:rgba(189,146,80,.55);
    color:#132033;
    font-weight:700;
}

/* ---------- Layout ---------- */

.layout{
    display:grid;
    grid-template-columns:292px minmax(0,1fr);
    min-height:calc(100vh - 78px);
}

.sidebar{
    position:sticky;
    top:78px;
    align-self:start;
    height:calc(100vh - 78px);
    overflow:auto;
    background:
        linear-gradient(180deg,rgba(255,253,248,.86),rgba(247,243,236,.92)),
        radial-gradient(circle at 0 0,rgba(189,146,80,.16),transparent 20rem);
    border-right:1px solid var(--ol-line-2);
    color:var(--ol-ink);
    padding:28px 18px;
}

body.dark .sidebar{
    background:linear-gradient(180deg,#0b2035,#081a2d);
}

.nav{
    display:grid;
    gap:22px;
}

.nav-section{
    display:grid;
    gap:7px;
}

.nav-heading{
    margin:0 8px 6px;
    color:var(--ol-muted);
    font-size:11px;
    font-weight:900;
    letter-spacing:.13em;
    text-transform:uppercase;
}

.nav a{
    position:relative;
    display:flex;
    align-items:center;
    gap:10px;
    min-height:46px;
    padding:9px 10px;
    border-radius:14px;
    color:var(--ol-ink);
    font-weight:720;
    font-size:14px;
    letter-spacing:-.01em;
    border:1px solid transparent;
    transition:.18s ease;
}

body.dark .nav a{color:#eaf0f5}

.nav a::before{
    display:none!important;
    content:none!important;
}

.nav-mark{
    position:relative;
    width:9px;
    height:9px;
    flex:0 0 9px;
    margin:0 8px 0 4px;
    border-radius:999px;
    background:var(--ol-gold);
    box-shadow:0 0 0 5px rgba(189,146,80,.12);
}

.nav a:hover{
    background:rgba(255,255,255,.78);
    border-color:var(--ol-line);
    box-shadow:var(--ol-shadow-soft);
    transform:translateX(2px);
    color:var(--ol-ink)!important;
}

body.dark .nav a:hover{
    background:rgba(255,255,255,.07);
    color:#eaf0f5!important;
}

.nav a.active{
    background:linear-gradient(180deg,rgba(255,255,255,.92),rgba(255,253,248,.74));
    border-color:rgba(189,146,80,.42);
    box-shadow:0 10px 24px rgba(16,32,51,.06);
}

body.dark .nav a.active{
    background:rgba(255,255,255,.08);
}

.nav a.active .nav-mark{
    background:var(--ol-gold);
    box-shadow:0 0 0 6px rgba(189,146,80,.14);
}

.nav a.active .nav-mark::after{
    content:"";
    position:absolute;
    inset:-8px;
    border-radius:999px;
    border:1px solid rgba(189,146,80,.45);
    animation:olNavPulse 1.9s ease-out infinite;
}

@keyframes olNavPulse{
    0%{transform:scale(.72); opacity:.60}
    70%{transform:scale(1.25); opacity:0}
    100%{transform:scale(1.25); opacity:0}
}

.content{
    max-width:1280px;
    width:100%;
    margin:0 auto;
    padding:42px 42px 60px;
}

.content.solo{
    max-width:1180px;
}

/* ---------- Hero / headings ---------- */

.hero{
    position:relative;
    overflow:hidden;
    background:
        radial-gradient(circle at 82% -20%, rgba(215,189,124,.34), transparent 28rem),
        linear-gradient(135deg,var(--ol-navy),var(--ol-navy-2));
    color:#fff;
    border-radius:32px;
    padding:34px 36px;
    box-shadow:var(--ol-shadow);
    border:1px solid rgba(255,255,255,.12);
}

.hero::after{
    content:"";
    position:absolute;
    right:-85px;
    top:-110px;
    width:260px;
    height:260px;
    border:1px solid rgba(215,189,124,.42);
    border-radius:50%;
}

.hero h1{
    margin:0 0 10px;
    font-size:34px;
    line-height:1.05;
    letter-spacing:-.045em;
}

.hero p{
    margin:0;
    max-width:790px;
    color:#dce7ef;
    line-height:1.65;
}

.hero .meta{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin-top:20px;
}

.badge{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:8px 12px;
    border-radius:999px;
    border:1px solid var(--ol-line);
    background:rgba(255,255,255,.78);
    color:var(--ol-ink);
    font-size:13px;
    font-weight:700;
}

.hero .badge,
.login-copy .badge{
    background:rgba(255,255,255,.10);
    border-color:rgba(255,255,255,.20);
    color:#fff;
}

/* ---------- Cards / grids ---------- */

.grid{
    display:grid;
    gap:20px;
    margin-top:22px;
}

.grid.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}

.card{
    background:rgba(255,253,248,.94);
    border:1px solid var(--ol-line);
    border-radius:24px;
    box-shadow:var(--ol-shadow-soft);
    padding:22px;
}

body.dark .card{background:rgba(14,34,55,.96)}

.card h2,
.card h3{
    margin:0 0 14px;
    color:var(--ol-ink);
    letter-spacing:-.035em;
}

.metric strong{
    display:block;
    font-size:34px;
    line-height:1;
    letter-spacing:-.055em;
    margin-bottom:7px;
    color:var(--ol-navy);
}

body.dark .metric strong{color:#fff}

.metric span,
.muted{
    color:var(--ol-muted);
}

/* ---------- Toolbar ---------- */

.toolbar{
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:flex-end;
    margin-bottom:20px;
    flex-wrap:wrap;
}

.toolbar h2{
    font-size:28px;
    letter-spacing:-.045em;
}

/* ---------- Forms ---------- */

.form-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
}

.form-grid.cols3{grid-template-columns:repeat(3,minmax(0,1fr))}
.form-grid .wide{grid-column:1/-1}

label{
    display:block;
    font-size:12px;
    line-height:1.2;
    color:var(--ol-muted);
    font-weight:800;
    letter-spacing:.02em;
    margin-bottom:7px;
}

input,
select,
textarea,
input[type=date],
input[type=datetime-local],
input[type=number],
input[type=file]{
    width:100%;
    border:1px solid var(--ol-line);
    border-radius:15px;
    background:rgba(255,255,255,.82);
    color:var(--ol-ink);
    padding:12px 14px;
    outline:0;
    transition:.16s ease;
}

body.dark input,
body.dark select,
body.dark textarea{
    background:rgba(8,26,45,.72);
}

input:focus,
select:focus,
textarea:focus{
    border-color:rgba(189,146,80,.74);
    box-shadow:0 0 0 4px rgba(189,146,80,.13);
}

textarea{
    min-height:96px;
    resize:vertical;
}

.checkline{
    display:flex;
    align-items:flex-start;
    gap:10px;
    color:var(--ol-ink);
    font-weight:650;
    line-height:1.45;
}

.checkline input{
    width:auto;
    margin-top:2px;
}

/* ---------- Buttons / notices ---------- */

.btn{
    border:1px solid transparent;
    border-radius:15px;
    padding:11px 15px;
    background:linear-gradient(135deg,var(--ol-navy),var(--ol-navy-2));
    color:#fff;
    cursor:pointer;
    font-weight:800;
    display:inline-flex;
    align-items:center;
    gap:9px;
    box-shadow:0 8px 18px rgba(11,40,69,.12);
    transition:.17s ease;
}

.btn:hover{
    transform:translateY(-1px);
    box-shadow:0 12px 24px rgba(11,40,69,.16);
}

.btn.gold{
    background:linear-gradient(135deg,var(--ol-gold),var(--ol-gold-2));
    color:#132033;
}

.btn.ghost{
    background:rgba(255,255,255,.55);
    color:var(--ol-ink);
    border-color:var(--ol-line);
    box-shadow:none;
}

body.dark .btn.ghost{background:rgba(255,255,255,.06)}

.btn.danger{
    background:linear-gradient(135deg,#9f2f2a,#c94a3d);
    color:#fff;
}

.btn.small{
    padding:7px 11px;
    font-size:.9rem;
    border-radius:12px;
}

.notice{
    border:1px solid var(--ol-line);
    border-radius:18px;
    padding:13px 15px;
    margin:16px 0;
    background:rgba(255,253,248,.90);
    box-shadow:var(--ol-shadow-soft);
}

.notice.ok,
.notice.bad{
    display:flex;
    align-items:center;
    gap:10px;
}

.notice.ok{
    background:#edf7f1;
    border-color:#bddbc8;
    color:var(--ol-green);
}

.notice.bad{
    background:#fff0ee;
    border-color:#efc6c1;
    color:var(--ol-red);
}

.notice.ok::before,
.notice.bad::before{
    content:"";
    width:10px;
    height:10px;
    border-radius:999px;
    flex:0 0 auto;
}

.notice.ok::before{
    background:var(--ol-green);
    box-shadow:0 0 0 0 rgba(39,142,94,.32);
    animation:olStatusPulse 1.5s ease-out infinite;
}

.notice.bad::before{
    background:var(--ol-red);
    box-shadow:0 0 0 0 rgba(182,64,55,.30);
    animation:olStatusPulseBad 1.5s ease-out infinite;
}

@keyframes olStatusPulseBad{
    0%{box-shadow:0 0 0 0 rgba(182,64,55,.32)}
    70%{box-shadow:0 0 0 9px rgba(182,64,55,0)}
    100%{box-shadow:0 0 0 0 rgba(182,64,55,0)}
}

.linkbox input{
    margin-top:8px;
    width:100%;
    font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}

/* ---------- Tables ---------- */

table{
    width:100%;
    border-collapse:separate;
    border-spacing:0 9px;
}

th{
    text-align:left;
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:.12em;
    color:var(--ol-muted);
    font-weight:900;
    padding:0 12px;
}

td{
    background:rgba(255,255,255,.74);
    padding:14px 13px;
    border-top:1px solid var(--ol-line);
    border-bottom:1px solid var(--ol-line);
    font-size:14px;
    vertical-align:middle;
}

body.dark td{background:rgba(8,26,45,.72)}

td:first-child{
    border-left:1px solid var(--ol-line);
    border-radius:15px 0 0 15px;
}

td:last-child{
    border-right:1px solid var(--ol-line);
    border-radius:0 15px 15px 0;
}

.status{
    display:inline-flex;
    align-items:center;
    gap:6px;
    border-radius:999px;
    padding:6px 10px;
    font-size:12px;
    font-weight:850;
    border:1px solid transparent;
}

.status.ok,
.ok{
    background:#e8f5ee;
    color:var(--ol-green);
}

.status.bad,
.bad{
    background:#ffefed;
    color:var(--ol-red);
}

.status.warn,
.warn{
    background:#fff7e6;
    color:var(--ol-amber);
}

/* ---------- Login ---------- */

.login-wrap{
    min-height:calc(100vh - 78px);
    display:grid;
    grid-template-columns:minmax(0,1fr) 440px;
    gap:30px;
    align-items:center;
    max-width:1220px;
    margin:0 auto;
    padding:42px;
}

.login-copy{
    position:relative;
    overflow:hidden;
    min-height:520px;
    display:flex;
    flex-direction:column;
    justify-content:flex-end;
    padding:42px;
    border-radius:34px;
    background:
        linear-gradient(180deg,rgba(11,40,69,.24),rgba(11,40,69,.92)),
        radial-gradient(circle at 78% 12%,rgba(215,189,124,.38),transparent 24rem),
        linear-gradient(135deg,var(--ol-navy),var(--ol-navy-2));
    color:#fff;
    box-shadow:var(--ol-shadow);
}

.login-copy::before{
    content:"";
    position:absolute;
    top:36px;
    left:36px;
    width:180px;
    height:98px;
    background:url('/assets/img/logo-full.png') left center/contain no-repeat;
    filter:brightness(0) invert(1) drop-shadow(0 10px 20px rgba(0,0,0,.16));
    opacity:.98;
}

.login-copy::after{
    content:"";
    position:absolute;
    right:-115px;
    top:-115px;
    width:330px;
    height:330px;
    border-radius:50%;
    border:1px solid rgba(215,189,124,.45);
}

.login-copy h1{
    position:relative;
    z-index:1;
    font-size:44px;
    line-height:1.03;
    letter-spacing:-.06em;
    margin:0 0 14px;
    max-width:760px;
}

.login-copy p{
    position:relative;
    z-index:1;
    color:#e6edf3;
    line-height:1.7;
    font-size:16px;
    max-width:720px;
}

.login-card{
    background:rgba(255,253,248,.96);
    border:1px solid var(--ol-line);
    border-radius:30px;
    padding:30px;
    box-shadow:var(--ol-shadow);
}

body.dark .login-card{background:rgba(14,34,55,.96)}

.login-card h2{
    margin:0 0 6px;
    font-size:28px;
    letter-spacing:-.045em;
}

.login-card .row{
    margin-top:16px;
}

.login-card .btn{
    margin-top:20px;
    width:100%;
    justify-content:center;
}

.fineprint{
    color:var(--ol-muted);
    font-size:12px;
    line-height:1.55;
    margin-top:16px;
}

.progress{
    display:flex;
    gap:8px;
    align-items:center;
    margin-top:16px;
    overflow:auto;
    padding-bottom:4px;
}

.step{
    white-space:nowrap;
    padding:9px 12px;
    border-radius:999px;
    background:rgba(255,255,255,.68);
    border:1px solid var(--ol-line);
    font-size:13px;
    color:var(--ol-muted);
}

.step.done{
    background:#e8f5ee;
    color:var(--ol-green);
    border-color:#bddbc8;
}

.step.current{
    background:var(--ol-navy);
    color:#fff;
    border-color:var(--ol-navy);
}

/* ---------- Activity / audit ---------- */

.audit-line,
.timeline-line{
    display:flex;
    gap:12px;
    border-bottom:1px solid var(--ol-line);
    padding:12px 0;
}

.audit-dot{
    width:10px;
    height:10px;
    border-radius:99px;
    background:var(--ol-gold);
    margin-top:6px;
    box-shadow:0 0 0 4px rgba(189,146,80,.13);
    flex:0 0 10px;
}

.drawer-note{
    font-size:13px;
    color:var(--ol-muted);
    border-left:3px solid var(--ol-gold);
    padding-left:12px;
    line-height:1.55;
}

.action-stack{
    display:grid;
    gap:15px;
    margin-top:16px;
}

.cards-mini{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:12px;
}

.tabs{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin:14px 0;
}

.tabs a{
    border:1px solid var(--ol-line);
    border-radius:999px;
    padding:8px 12px;
    background:rgba(255,255,255,.62);
    color:var(--ol-ink);
    font-weight:750;
}

.doc-upload{
    border:1px dashed var(--ol-gold);
    background:rgba(189,146,80,.10);
    border-radius:20px;
    padding:20px;
    text-align:center;
}

/* ---------- Responsive ---------- */

@media(max-width:1100px){
    .layout{grid-template-columns:245px minmax(0,1fr)}
    .content{padding:30px 24px 50px}
    .grid.cols-4{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:860px){
    .topbar{height:auto;min-height:74px;padding:12px 16px;align-items:flex-start}
    .brand-logo-full{width:128px;height:48px}
    .brand-wording{display:none}
    .layout{grid-template-columns:1fr}
    .sidebar{
        position:static;
        border-right:0;
        border-bottom:1px solid var(--ol-line);
        padding:12px 14px;
    }
    .nav{
        display:flex;
        gap:8px;
        overflow:auto;
        padding-bottom:2px;
    }
    .nav-section{
        display:contents;
    }
    .nav-heading{
        display:none;
    }
    .nav a{
        white-space:nowrap;
        flex:0 0 auto;
        padding:10px 12px;
    }
    .nav-mark{
        width:8px;
        height:8px;
        flex-basis:8px;
        margin:0 6px 0 2px;
    }
    .content{padding:22px 16px 44px}
    .grid.cols-4,
    .grid.cols-3,
    .grid.cols-2,
    .form-grid,
    .form-grid.cols3,
    .security-grid,
    .security-password-grid,
    .cards-mini,
    .login-wrap{
        grid-template-columns:1fr!important;
    }

    .security-card.wide{
        grid-column:auto;
    }
    .login-wrap{padding:18px}
    .login-copy{
        min-height:380px;
        padding:34px 26px;
    }
    .login-copy h1{font-size:34px}
    table{display:block;overflow-x:auto}
}

@media(max-width:560px){
    .top-actions{gap:6px}
    .pill{padding:8px 10px}
    .hero{padding:28px 22px;border-radius:26px}
    .hero h1{font-size:28px}
    .card{padding:18px;border-radius:20px}
}

/* ---------- Gestion dashboard ---------- */

.dashboard-shell{
    display:grid;
    gap:22px;
}

.dashboard-hero{
    position:relative;
    overflow:hidden;
    display:flex;
    justify-content:space-between;
    gap:24px;
    align-items:flex-end;
    min-height:184px;
    padding:34px 38px;
    color:#fff;
    border-radius:30px;
    background:
        radial-gradient(circle at 88% -18%, rgba(215,189,124,.30), transparent 21rem),
        linear-gradient(135deg,#08243f 0%,#12395d 58%,#2d4d5b 100%);
    border:1px solid rgba(255,255,255,.14);
    box-shadow:0 20px 48px rgba(11,40,69,.14);
}

.dashboard-hero::after{
    content:"";
    position:absolute;
    right:-74px;
    top:-92px;
    width:260px;
    height:260px;
    border-radius:999px;
    border:1px solid rgba(215,189,124,.40);
}

.dashboard-kicker{
    display:inline-flex;
    align-items:center;
    gap:8px;
    margin-bottom:14px;
    color:#d7bd7c;
    font-size:12px;
    font-weight:900;
    letter-spacing:.14em;
    text-transform:uppercase;
}

.dashboard-kicker::before{
    content:"";
    width:8px;
    height:8px;
    border-radius:999px;
    background:#d7bd7c;
    box-shadow:0 0 0 5px rgba(215,189,124,.14);
}

.dashboard-hero h1{
    margin:0 0 10px;
    font-size:38px;
    line-height:1.02;
    letter-spacing:-.055em;
}

.dashboard-hero p{
    margin:0;
    max-width:680px;
    color:#e3edf5;
    line-height:1.65;
}

.dashboard-hero-actions{
    position:relative;
    z-index:1;
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    justify-content:flex-end;
}

.dashboard-hero-actions .btn.ghost{
    background:rgba(255,255,255,.10);
    color:#fff;
    border-color:rgba(255,255,255,.22);
}

.dashboard-metrics{
    display:grid;
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:12px;
}

.dashboard-metric{
    position:relative;
    overflow:hidden;
    min-height:126px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    padding:17px 18px;
    border-radius:20px;
    border:1px solid var(--ol-line);
    background:rgba(255,253,248,.93);
    box-shadow:var(--ol-shadow-soft);
    transition:transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

body.dark .dashboard-metric{
    background:rgba(14,34,55,.94);
}

.dashboard-metric:hover{
    transform:translateY(-2px);
    border-color:rgba(189,146,80,.45);
    box-shadow:0 14px 30px rgba(16,32,51,.09);
}

.dashboard-metric span{
    color:var(--ol-muted);
    font-size:12px;
    font-weight:900;
    letter-spacing:.08em;
    text-transform:uppercase;
}

.dashboard-metric strong{
    color:var(--ol-navy);
    font-size:34px;
    line-height:1;
    letter-spacing:-.055em;
}

body.dark .dashboard-metric strong{
    color:#fff;
}

.dashboard-metric small{
    color:var(--ol-muted);
    line-height:1.35;
}

.dashboard-metric.primary{
    background:
        radial-gradient(circle at 100% 0, rgba(215,189,124,.24), transparent 9rem),
        linear-gradient(180deg,#fffdf8,#f8f2e8);
}

body.dark .dashboard-metric.primary{
    background:linear-gradient(180deg,#102f4a,#0e2237);
}

.dashboard-metric.attention::after{
    content:"";
    position:absolute;
    right:14px;
    top:14px;
    width:10px;
    height:10px;
    border-radius:999px;
    background:var(--ol-gold);
    box-shadow:0 0 0 6px rgba(189,146,80,.13);
}

.dashboard-grid{
    display:grid;
    grid-template-columns:1.45fr .85fr;
    gap:18px;
    align-items:start;
}

.dashboard-panel{
    min-width:0;
    padding:22px;
    border-radius:24px;
    border:1px solid var(--ol-line);
    background:rgba(255,253,248,.94);
    box-shadow:var(--ol-shadow-soft);
}

body.dark .dashboard-panel{
    background:rgba(14,34,55,.96);
}

.dashboard-panel-large{
    grid-row:span 2;
}

.dashboard-panel-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:14px;
    margin-bottom:18px;
}

.dashboard-panel-head.compact{
    margin-bottom:14px;
}

.dashboard-panel h2{
    margin:0 0 5px;
    color:var(--ol-ink);
    font-size:20px;
    line-height:1.15;
    letter-spacing:-.04em;
}

.dashboard-panel p{
    margin:0;
    color:var(--ol-muted);
    line-height:1.45;
    font-size:13px;
}

.dashboard-case-list,
.dashboard-stack,
.pipeline-list,
.quick-actions{
    display:grid;
    gap:10px;
}

.dashboard-case-row{
    display:grid;
    grid-template-columns:112px minmax(0,1fr) auto;
    gap:16px;
    align-items:center;
    padding:14px;
    border-radius:18px;
    border:1px solid var(--ol-line-2);
    background:rgba(255,255,255,.58);
    transition:transform .16s ease, border-color .16s ease, background .16s ease;
}

body.dark .dashboard-case-row{
    background:rgba(8,26,45,.50);
}

.dashboard-case-row:hover{
    transform:translateX(2px);
    border-color:rgba(189,146,80,.48);
    background:rgba(255,255,255,.82);
}

body.dark .dashboard-case-row:hover{
    background:rgba(255,255,255,.07);
}

.case-number{
    font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
    color:var(--ol-navy);
    font-weight:850;
    font-size:12px;
}

body.dark .case-number{
    color:#d7bd7c;
}

.dashboard-case-row strong,
.dashboard-doc-item strong,
.dashboard-timeline-item strong,
.dashboard-activity-item strong{
    display:block;
    color:var(--ol-ink);
    line-height:1.25;
}

.dashboard-case-row small,
.dashboard-doc-item small,
.dashboard-timeline-item small,
.dashboard-activity-item small{
    display:block;
    margin-top:4px;
    color:var(--ol-muted);
    line-height:1.35;
}

.quick-actions{
    grid-template-columns:repeat(2,minmax(0,1fr));
}

.quick-actions a{
    min-height:76px;
    display:flex;
    align-items:flex-end;
    padding:14px;
    border-radius:18px;
    border:1px solid var(--ol-line-2);
    background:
        radial-gradient(circle at 100% 0, rgba(189,146,80,.16), transparent 7rem),
        rgba(255,255,255,.52);
    color:var(--ol-ink);
    font-weight:850;
    transition:.16s ease;
}

body.dark .quick-actions a{
    background:rgba(8,26,45,.50);
}

.quick-actions a:hover{
    transform:translateY(-2px);
    border-color:rgba(189,146,80,.52);
}

.dashboard-timeline-item,
.dashboard-activity-item{
    display:grid;
    grid-template-columns:14px minmax(0,1fr);
    gap:12px;
    align-items:start;
    padding:12px 0;
    border-bottom:1px solid var(--ol-line-2);
}

.dashboard-timeline-item:last-child,
.dashboard-activity-item:last-child{
    border-bottom:0;
}

.timeline-dot,
.activity-mark{
    width:9px;
    height:9px;
    border-radius:999px;
    margin-top:5px;
    background:var(--ol-gold);
    box-shadow:0 0 0 5px rgba(189,146,80,.13);
}

.activity-mark{
    background:var(--ol-navy-2);
    box-shadow:0 0 0 5px rgba(18,57,93,.10);
}

body.dark .activity-mark{
    background:#d7bd7c;
}

.dashboard-doc-item{
    display:block;
    padding:13px 14px;
    border-radius:17px;
    border:1px solid var(--ol-line-2);
    background:rgba(255,255,255,.50);
    transition:.16s ease;
}

body.dark .dashboard-doc-item{
    background:rgba(8,26,45,.50);
}

.dashboard-doc-item:hover{
    transform:translateX(2px);
    border-color:rgba(189,146,80,.48);
}

.pipeline-item{
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:center;
    padding:11px 0;
    border-bottom:1px solid var(--ol-line-2);
}

.pipeline-item:last-child{
    border-bottom:0;
}

.pipeline-item span{
    color:var(--ol-muted);
    line-height:1.35;
}

.pipeline-item strong{
    display:grid;
    place-items:center;
    min-width:34px;
    height:34px;
    padding:0 8px;
    border-radius:999px;
    color:#132033;
    background:linear-gradient(135deg,var(--ol-gold),var(--ol-gold-2));
}

.dashboard-empty{
    display:grid;
    place-items:center;
    min-height:96px;
    padding:18px;
    border:1px dashed var(--ol-line);
    border-radius:18px;
    color:var(--ol-muted);
    text-align:center;
    background:rgba(255,255,255,.38);
}

body.dark .dashboard-empty{
    background:rgba(8,26,45,.38);
}

@media(max-width:1180px){
    .dashboard-metrics{
        grid-template-columns:repeat(3,minmax(0,1fr));
    }

    .dashboard-grid{
        grid-template-columns:1fr;
    }

    .dashboard-panel-large{
        grid-row:auto;
    }
}

/* ---------- Clients module ---------- */

.client-accordion{
    display:grid;
    gap:18px;
}

.client-panel{
    border:1px solid var(--ol-line);
    border-radius:24px;
    background:rgba(255,253,248,.94);
    box-shadow:var(--ol-shadow-soft);
    overflow:hidden;
}

body.dark .client-panel{
    background:rgba(14,34,55,.96);
}

.client-panel summary{
    list-style:none;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    padding:20px 22px;
    cursor:pointer;
    border-bottom:1px solid transparent;
}

.client-panel[open] summary{
    border-bottom-color:var(--ol-line-2);
}

.client-panel summary::-webkit-details-marker{
    display:none;
}

.client-panel summary::after{
    content:"";
    width:9px;
    height:9px;
    border-right:2px solid var(--ol-gold);
    border-bottom:2px solid var(--ol-gold);
    transform:rotate(45deg);
    transition:transform .16s ease;
}

.client-panel[open] summary::after{
    transform:rotate(225deg);
}

.client-panel summary span{
    display:block;
    color:var(--ol-ink);
    font-size:20px;
    font-weight:900;
    letter-spacing:0;
}

.client-panel summary .client-summary-copy{
    display:grid;
    grid-template-columns:minmax(180px,.34fr) minmax(220px,1fr);
    align-items:center;
    gap:22px;
    width:100%;
}

.client-panel summary .client-summary-copy strong{
    display:block;
    color:var(--ol-ink);
    font-size:20px;
    font-weight:900;
}

.client-panel summary small{
    display:block;
    margin-top:0;
    color:var(--ol-muted);
    font-size:13px;
    line-height:1.35;
    font-weight:600;
}

.client-form{
    padding:22px;
}

.client-form-section{
    padding:18px;
    border:1px solid var(--ol-line-2);
    border-radius:20px;
    background:rgba(255,255,255,.46);
}

.client-form-section + .client-form-section{
    margin-top:16px;
}

body.dark .client-form-section{
    background:rgba(8,26,45,.42);
}

.client-form-section h3{
    margin:0 0 14px;
    color:var(--ol-ink);
    font-size:16px;
    font-weight:900;
}

.client-subdetails{
    margin-top:16px;
    border:1px solid var(--ol-line-2);
    border-radius:20px;
    background:rgba(255,255,255,.46);
    overflow:hidden;
}

body.dark .client-subdetails{
    background:rgba(8,26,45,.42);
}

.client-subdetails summary{
    list-style:none;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:15px 18px;
    color:var(--ol-ink);
    cursor:pointer;
    font-weight:900;
}

.client-subdetails summary::-webkit-details-marker{
    display:none;
}

.client-subdetails summary::after{
    content:"";
    width:8px;
    height:8px;
    border-right:2px solid var(--ol-gold);
    border-bottom:2px solid var(--ol-gold);
    transform:rotate(45deg);
}

.client-subdetails[open] summary::after{
    transform:rotate(225deg);
}

.client-subdetails summary small{
    color:var(--ol-muted);
    font-size:12px;
    font-weight:800;
}

.client-subdetails-body{
    padding:0 18px 18px;
}

.client-form label small{
    color:var(--ol-muted);
    font-weight:700;
}

.client-form input.is-valid,
.client-form select.is-valid,
.client-form textarea.is-valid{
    border-color:rgba(39,142,94,.58);
    box-shadow:0 0 0 3px rgba(39,142,94,.10);
}

.client-form input.is-invalid,
.client-form select.is-invalid,
.client-form textarea.is-invalid{
    border-color:rgba(188,78,78,.62);
    box-shadow:0 0 0 3px rgba(188,78,78,.10);
}

.client-name-line{
    display:grid;
    grid-template-columns:120px minmax(0,.82fr) minmax(0,1fr);
    gap:14px;
}

.client-salutation-field select{
    min-width:0;
}

.phone-pair{
    display:grid;
    grid-template-columns:96px minmax(0,1fr);
    gap:8px;
}

.street-line{
    display:grid;
    grid-template-columns:190px minmax(0,1fr);
    gap:14px;
}

.field-with-status{
    position:relative;
}

.field-with-status input{
    padding-right:156px;
}

.field-status{
    position:absolute;
    right:14px;
    bottom:13px;
    z-index:2;
    max-width:138px;
    overflow:hidden;
    text-align:right;
    text-overflow:ellipsis;
    white-space:nowrap;
    pointer-events:none;
    color:var(--ol-muted);
    font-size:12px;
    font-weight:800;
}

.field-status.ok{
    color:var(--ol-green);
}

.field-status.bad{
    color:var(--ol-red);
}

.client-form :disabled{
    cursor:not-allowed;
    opacity:.54;
    background:rgba(248,245,238,.62);
}

.client-form input[readonly]{
    cursor:not-allowed;
    color:var(--ol-muted);
    background:rgba(248,245,238,.62);
    box-shadow:none;
}

body.dark .client-form :disabled{
    background:rgba(255,255,255,.05);
}

body.dark .client-form input[readonly]{
    background:rgba(255,255,255,.05);
}

.postal-picker{
    position:relative;
}

.postal-options{
    position:absolute;
    left:0;
    right:0;
    top:calc(100% + 8px);
    z-index:35;
    display:grid;
    gap:6px;
    max-height:238px;
    overflow:auto;
    padding:8px;
    border:1px solid var(--ol-line);
    border-radius:16px;
    background:rgba(255,253,248,.98);
    box-shadow:0 18px 34px rgba(16,32,51,.12);
}

.postal-options[hidden]{
    display:none!important;
}

body.dark .postal-options{
    background:rgba(14,34,55,.98);
}

.postal-options button{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    width:100%;
    padding:10px 11px;
    border:0;
    border-radius:11px;
    background:transparent;
    color:var(--ol-ink);
    text-align:left;
    font-weight:850;
}

.postal-options button:hover,
.postal-options button:focus{
    outline:0;
    background:rgba(189,146,80,.13);
}

.postal-options span{
    color:var(--ol-muted);
    font-size:12px;
    font-weight:800;
}

.char-counter{
    display:block;
    margin-top:7px;
    color:var(--ol-muted);
    font-size:12px;
    font-weight:800;
}

.char-counter strong{
    color:var(--ol-green);
}

.char-counter.warn strong{
    color:var(--ol-gold);
}

.char-counter.danger strong{
    color:var(--ol-red);
}

.client-form-actions{
    display:flex;
    align-items:center;
    gap:10px;
    margin-top:16px;
}

.client-form-message{
    display:flex;
    align-items:center;
    gap:10px;
    margin:12px 0 0;
}

.client-form-message.notice.ok::before{
    content:"";
    width:10px;
    height:10px;
    border-radius:999px;
    background:var(--ol-green);
    box-shadow:0 0 0 0 rgba(39,142,94,.32);
    animation:olStatusPulse 1.5s ease-out infinite;
    flex:0 0 auto;
}

@keyframes olStatusPulse{
    0%{box-shadow:0 0 0 0 rgba(39,142,94,.34)}
    70%{box-shadow:0 0 0 9px rgba(39,142,94,0)}
    100%{box-shadow:0 0 0 0 rgba(39,142,94,0)}
}

.btn.subtle{
    border:1px solid var(--ol-line);
    background:rgba(255,255,255,.72);
    color:var(--ol-ink);
}

.btn.subtle:hover{
    border-color:rgba(189,146,80,.46);
    background:rgba(255,253,248,.96);
}

body.dark .btn.subtle{
    background:rgba(255,255,255,.08);
    color:#eaf0f5;
}

.client-form-message[hidden]{
    display:none!important;
}

.client-searchbar{
    padding:22px 22px 12px;
}

.client-searchbar label{
    margin-bottom:8px;
}

.client-searchbar p{
    margin:10px 0 0;
}

.client-results{
    display:grid;
    gap:10px;
    padding:0 22px 22px;
}

.client-panel[open] > .client-results,
.users-internal .client-results{
    padding-top:22px;
}

.client-result-row{
    display:grid;
    grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) auto;
    gap:16px;
    align-items:center;
    padding:14px;
    border:1px solid var(--ol-line-2);
    border-radius:18px;
    background:rgba(255,255,255,.58);
    transition:transform .16s ease, border-color .16s ease, background .16s ease;
}

body.dark .client-result-row{
    background:rgba(8,26,45,.50);
}

.client-result-row:hover{
    transform:translateX(2px);
    border-color:rgba(189,146,80,.48);
    background:rgba(255,255,255,.82);
}

.users-internal .client-result-row{
    grid-template-columns:minmax(0,1fr) minmax(140px,220px) auto;
    min-height:72px;
}

.users-internal .client-result-row > span:nth-child(2){
    justify-self:start;
    color:var(--ol-ink);
    font-weight:800;
}

.security-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:14px;
}

.security-card{
    display:flex;
    flex-direction:column;
    gap:12px;
    min-height:100%;
    padding:16px;
    border:1px solid var(--ol-line-2);
    border-radius:18px;
    background:rgba(255,255,255,.58);
}

body.dark .security-card{
    background:rgba(8,26,45,.42);
}

.security-card.wide{
    grid-column:span 2;
}

.security-card h4{
    margin:0;
    color:var(--ol-ink);
    font-size:15px;
    font-weight:900;
}

.security-card p{
    margin:0;
    color:var(--ol-muted);
    font-size:13px;
    line-height:1.45;
}

.security-card textarea{
    min-height:92px;
}

.security-card .btn{
    align-self:flex-start;
    margin-top:auto;
}

.security-password-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
}

.client-result-row strong,
.client-result-row small{
    display:block;
}

.client-result-row small{
    margin-top:4px;
    color:var(--ol-muted);
}

.client-analytics{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
    padding:22px 22px 8px;
}

.client-analytics article{
    padding:16px;
    border:1px solid var(--ol-line-2);
    border-radius:18px;
    background:rgba(255,255,255,.52);
}

body.dark .client-analytics article{
    background:rgba(8,26,45,.50);
}

.client-analytics span{
    display:block;
    color:var(--ol-muted);
    font-size:12px;
    font-weight:900;
    letter-spacing:.08em;
    text-transform:uppercase;
}

.client-analytics strong{
    display:block;
    margin-top:10px;
    color:var(--ol-navy);
    font-size:30px;
    line-height:1;
    letter-spacing:-.05em;
}

body.dark .client-analytics strong{
    color:#fff;
}

.client-analytics .positive{
    color:var(--ol-green);
}

.client-analytics .negative{
    color:var(--ol-red);
}

.client-chart{
    height:260px;
    display:grid;
    grid-template-columns:repeat(12,minmax(0,1fr));
    gap:10px;
    align-items:end;
    padding:22px;
}

.client-chart-bar{
    min-width:0;
    height:100%;
    display:grid;
    grid-template-rows:1fr auto auto;
    align-items:end;
    gap:7px;
    text-align:center;
}

.client-chart-bar span{
    width:100%;
    min-height:6px;
    border-radius:10px 10px 4px 4px;
    background:linear-gradient(180deg,var(--ol-gold-2),var(--ol-gold));
    box-shadow:0 8px 18px rgba(189,146,80,.16);
}

.client-chart-bar strong{
    color:var(--ol-ink);
    font-size:13px;
}

.client-chart-bar small{
    color:var(--ol-muted);
    font-size:11px;
    writing-mode:vertical-rl;
    transform:rotate(180deg);
    justify-self:center;
}

.client-line-chart{
    position:relative;
    padding:22px;
}

.client-chart-reset{
    position:absolute;
    top:34px;
    right:34px;
    z-index:3;
    box-shadow:0 12px 24px rgba(16,32,51,.10);
}

.client-line-chart svg{
    display:block;
    width:100%;
    height:auto;
    min-height:250px;
    border:1px solid var(--ol-line-2);
    border-radius:20px;
    background:linear-gradient(180deg,rgba(255,255,255,.62),rgba(255,253,248,.50));
}

body.dark .client-line-chart svg{
    background:rgba(8,26,45,.36);
}

.client-chart-area{
    fill:url(#clientLineFill);
}

.client-chart-line{
    fill:none;
    stroke:var(--ol-gold);
    stroke-width:4;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.client-chart-point circle{
    fill:#fff;
    stroke:var(--ol-gold);
    stroke-width:4;
    transition:r .16s ease, fill .16s ease;
}

.client-chart-point:hover circle,
.client-chart-point:focus circle{
    r:9;
    fill:var(--ol-gold-2);
}

.client-chart-point text{
    fill:var(--ol-muted);
    font-size:12px;
    font-weight:800;
    text-anchor:middle;
}

.client-chart-point .client-chart-value{
    fill:var(--ol-ink);
    font-size:14px;
    opacity:0;
    transition:opacity .16s ease;
}

.client-chart-point:hover .client-chart-value,
.client-chart-point:focus .client-chart-value{
    opacity:1;
}

.client-heatmap-panel{
    padding:0 22px 22px;
}

.client-map-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
    margin:0 0 12px;
}

.client-map-head h3{
    margin:0 0 5px;
    color:var(--ol-ink);
    font-size:17px;
    font-weight:900;
}

.client-map-head p{
    margin:0;
}

.client-heatmap{
    position:relative;
    min-height:390px;
    overflow:hidden;
    border:1px solid var(--ol-line-2);
    border-radius:20px;
    background:rgba(255,255,255,.56);
}

.client-map-reset{
    position:absolute;
    right:14px;
    top:14px;
    z-index:420;
    backdrop-filter:blur(10px);
}

.client-map-canvas{
    position:absolute;
    inset:0;
}

body.dark .client-heatmap{
    background:rgba(8,26,45,.36);
}

.client-heatmap .dashboard-empty{
    margin:22px;
}

.client-heatmap .leaflet-control-zoom a{
    color:var(--ol-ink);
}

.client-heatmap .leaflet-tooltip{
    border:1px solid rgba(189,146,80,.34);
    border-radius:10px;
    color:var(--ol-ink);
    font-weight:800;
    box-shadow:0 12px 24px rgba(16,32,51,.10);
}

@media(max-width:760px){
    .client-panel summary{
        align-items:flex-start;
    }

    .client-panel summary .client-summary-copy{
        grid-template-columns:1fr;
        gap:6px;
    }

    .client-result-row{
        grid-template-columns:1fr;
    }

    .client-analytics{
        grid-template-columns:1fr;
    }

    .client-chart{
        overflow-x:auto;
        grid-template-columns:repeat(12,42px);
    }

    .client-name-line,
    .phone-pair,
    .street-line,
    .address-grid{
        grid-template-columns:1fr;
    }

    .field-with-status input{
        padding-right:132px;
    }

    .client-form-actions{
        align-items:stretch;
        flex-direction:column;
    }

    .client-map-head{
        flex-direction:column;
    }

    .client-heatmap{
        min-height:320px;
    }
}


@media(max-width:760px){
    .dashboard-hero{
        align-items:flex-start;
        flex-direction:column;
        padding:28px 22px;
        border-radius:26px;
    }

    .dashboard-hero h1{
        font-size:31px;
    }

    .dashboard-hero-actions{
        justify-content:flex-start;
    }

    .dashboard-metrics,
    .quick-actions{
        grid-template-columns:1fr;
    }

    .dashboard-case-row{
        grid-template-columns:1fr;
        gap:10px;
    }

    .dashboard-panel-head{
        flex-direction:column;
        align-items:flex-start;
    }
}

/* ---------- Reviews admin ---------- */

.reviews-admin-grid{
    margin-bottom:34px;
}

.reviews-admin-grid + .card{
    margin-top:6px;
}

.reviews-admin-grid .card form{
    display:grid;
    gap:10px;
}

.reviews-admin-grid .card form label{
    margin-bottom:0;
}

.review-user-picker{
    position:relative;
}

.review-user-results{
    position:absolute;
    left:0;
    right:0;
    top:calc(100% + 8px);
    z-index:20;
    display:grid;
    gap:4px;
    max-height:276px;
    overflow:auto;
    padding:8px;
    border:1px solid var(--ol-line);
    border-radius:18px;
    background:rgba(255,253,248,.98);
    box-shadow:0 18px 36px rgba(16,32,51,.12);
}

.review-user-results[hidden]{
    display:none!important;
}

body.dark .review-user-results{
    background:rgba(14,34,55,.98);
}

.review-user-results button{
    width:100%;
    display:block;
    padding:11px 12px;
    border:0;
    border-radius:12px;
    background:transparent;
    color:var(--ol-ink);
    text-align:left;
    font-weight:750;
}

.review-user-results button:hover,
.review-user-results button:focus{
    outline:0;
    background:rgba(189,146,80,.13);
}

.review-expiry-note{
    display:block;
    align-items:center;
    padding:11px 12px;
    border:1px solid rgba(189,146,80,.26);
    border-radius:15px;
    background:linear-gradient(180deg,rgba(189,146,80,.10),rgba(255,253,248,.52));
    color:var(--ol-muted);
    line-height:1.45;
    white-space:nowrap;
    font-size:14px;
}

body.dark .review-expiry-note{
    background:rgba(189,146,80,.10);
}

.review-expiry-note strong{
    color:var(--ol-ink);
}

.review-actions{
    display:grid;
    gap:8px;
    margin-bottom:8px;
}

.review-actions input{
    min-width:180px;
}

@media(max-width:1100px){
    .reviews-admin-grid{
        grid-template-columns:1fr!important;
    }

    .reviews-admin-grid .card[style]{
        grid-column:auto!important;
    }
}


/* Activation page enhancements */
.activation-wrap{
    align-items:stretch;
}

.activation-copy{
    display:flex;
    flex-direction:column;
    justify-content:center;
    min-height:520px;
}

.activation-hero-logo{
    width:min(320px, 78%);
    max-width:320px;
    align-self:center;
    display:block;
    margin:0 auto 26px;
    filter:drop-shadow(0 16px 30px rgba(5,18,35,.20));
}

.activation-copy p{
    display:flex;
    flex-direction:column;
    gap:4px;
}

.activation-card{
    display:flex;
    flex-direction:column;
    justify-content:center;
}

.activation-identity{
    display:grid;
    gap:4px;
    margin:8px 0 18px;
    font-size:1rem;
    line-height:1.45;
}

.activation-identity strong{
    color:var(--ol-ink);
    opacity:.95;
}

.activation-policy{
    margin:14px 0 16px;
    padding:14px 16px;
    border:1px solid var(--ol-line-2);
    border-radius:18px;
    background:rgba(245,248,252,.92);
}

body.dark .activation-policy{
    background:rgba(9,26,43,.88);
}

.password-strength{
    display:grid;
    gap:8px;
    margin-bottom:12px;
}

.password-strength-track{
    position:relative;
    width:100%;
    height:10px;
    border-radius:999px;
    background:rgba(13,42,74,.10);
    overflow:hidden;
}

.password-strength-fill{
    position:absolute;
    inset:0 auto 0 0;
    width:6%;
    border-radius:inherit;
    transition:width .22s ease, background-color .22s ease;
    background:#caa24f;
}

.password-strength-fill.is-weak{ background:#c96b5b; }
.password-strength-fill.is-low{ background:#d28b51; }
.password-strength-fill.is-medium{ background:#d7b15a; }
.password-strength-fill.is-good{ background:#8ba95b; }
.password-strength-fill.is-strong{ background:#4f8c5b; }

.password-strength-text{
    color:var(--ol-muted);
    font-weight:700;
}

.activation-policy-title{
    margin-bottom:10px;
    color:var(--ol-ink);
    font-weight:800;
    font-size:.97rem;
}

.password-checks{
    list-style:none;
    margin:0;
    padding:0;
    display:grid;
    gap:8px;
}

.password-checks li{
    position:relative;
    padding-left:28px;
    color:var(--ol-muted);
    font-weight:700;
}

.password-checks li::before{
    content:"○";
    position:absolute;
    left:0;
    top:-1px;
    font-size:16px;
    color:#b69347;
}

.password-checks li.is-valid{
    color:#386c43;
}

.password-checks li.is-valid::before{
    content:"✓";
    color:#386c43;
    font-weight:900;
}

.activation-match-status{
    display:block;
    margin-top:8px;
    min-height:18px;
    font-weight:800;
    color:var(--ol-muted);
}

.activation-match-status.is-ok{ color:#386c43; }
.activation-match-status.is-bad{ color:#b3261e; }
.activation-match-status.is-warn{ color:#8a671f; }

.activation-checkline{
    margin:8px 0 18px;
    align-items:flex-start;
}

.activation-checkline input{
    margin-top:2px;
}

.activation-checkline span{
    display:inline-block;
    line-height:1.45;
}

@media(max-width:980px){
    .activation-copy{
        min-height:unset;
    }

    .activation-hero-logo{
        width:min(240px, 72%);
        margin-bottom:20px;
    }
}


/* Activation page refinement v17 */
.activation-copy::before,
.activation-copy::after{
    display:none !important;
    content:none !important;
}

.activation-hero-logo{
    width:min(255px, 70%) !important;
    max-width:255px !important;
    margin:0 auto 30px !important;
    filter:brightness(0) invert(1) drop-shadow(0 14px 24px rgba(0,0,0,.22)) !important;
    opacity:.96;
}

.activation-policy-compact{
    margin:8px 0 14px !important;
    padding:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    font-size:11px !important;
    line-height:1.35 !important;
}

body.dark .activation-policy-compact{
    background:transparent !important;
}

.activation-policy-compact .activation-policy-title{
    margin:0 0 4px !important;
    color:var(--ol-muted) !important;
    font-size:11px !important;
    line-height:1.25 !important;
    font-weight:700 !important;
}

.activation-policy-compact .password-checks{
    list-style:none !important;
    margin:0 !important;
    padding:0 !important;
    display:flex !important;
    flex-wrap:wrap !important;
    gap:4px 12px !important;
}

.activation-policy-compact .password-checks li{
    position:relative !important;
    padding-left:15px !important;
    color:var(--ol-muted) !important;
    font-size:11px !important;
    line-height:1.25 !important;
    font-weight:700 !important;
}

.activation-policy-compact .password-checks li::before{
    content:"·" !important;
    position:absolute !important;
    left:3px !important;
    top:0 !important;
    font-size:12px !important;
    line-height:1.1 !important;
    color:#b69347 !important;
    font-weight:900 !important;
}

.activation-policy-compact .password-checks li.is-valid{
    color:#386c43 !important;
}

.activation-policy-compact .password-checks li.is-valid::before{
    content:"✓" !important;
    left:0 !important;
    color:#386c43 !important;
}

.activation-checkline{
    display:flex !important;
    align-items:center !important;
    gap:9px !important;
    margin:12px 0 18px !important;
    line-height:1.2 !important;
}

.activation-checkline input[type="checkbox"]{
    flex:0 0 auto !important;
    width:15px !important;
    height:15px !important;
    margin:0 !important;
    padding:0 !important;
    transform:none !important;
}

.activation-checkline span{
    display:block !important;
    line-height:1.25 !important;
    margin:0 !important;
}

.activation-identity{
    grid-template-columns:1fr !important;
}

.activation-identity span{
    display:block !important;
}


.activation-card input:disabled{
    opacity:.68;
    cursor:not-allowed;
    background:rgba(244,239,230,.78);
}


.activation-success-wrap{
    align-items:stretch;
}

.activation-success-copy,
.activation-success-card{
    min-height:420px;
}

.activation-success-card{
    justify-content:center;
}

.activation-success-intro{
    margin:8px 0 18px;
    font-size:1rem;
    line-height:1.5;
}

.activation-success-box{
    display:grid;
    gap:14px;
    margin-bottom:22px;
    padding:18px;
    border:1px solid var(--ol-line-2);
    border-radius:18px;
    background:rgba(245,248,252,.92);
}

body.dark .activation-success-box{
    background:rgba(9,26,43,.88);
}

.activation-success-line{
    display:grid;
    gap:4px;
}

.activation-success-line strong{
    color:var(--ol-ink);
    font-size:.95rem;
}

.activation-success-line span{
    color:var(--ol-muted);
    line-height:1.45;
}

.activation-success-card .btn{
    width:100%;
    text-align:center;
}

@media(max-width:980px){
    .activation-success-copy,
    .activation-success-card{
        min-height:unset;
    }
}

/* Clientes: subbloques opcionales con jerarquía visual de sección, no de acordeón principal */
.client-panel .client-subdetails{
    margin-top:16px;
    border:1px solid var(--ol-line-2);
    border-radius:20px;
    background:rgba(255,255,255,.46);
    overflow:hidden;
}

.client-panel .client-subdetails summary{
    list-style:none;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto 18px;
    align-items:center;
    gap:12px;
    min-height:48px;
    padding:12px 18px;
    cursor:pointer;
    font-weight:400;
    border-bottom:0;
}

.client-panel .client-subdetails[open] summary{
    border-bottom:1px solid var(--ol-line-2);
}

.client-panel .client-subdetails summary::-webkit-details-marker{
    display:none;
}

.client-panel .client-subdetails summary .client-subdetails-title,
.client-panel .client-subdetails summary span.client-subdetails-title{
    display:block;
    min-width:0;
    color:var(--ol-ink);
    font-size:16px;
    line-height:1.2;
    font-weight:900;
    letter-spacing:0;
}

.client-panel .client-subdetails summary .client-subdetails-meta,
.client-panel .client-subdetails summary span.client-subdetails-meta{
    display:block;
    justify-self:end;
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    color:var(--ol-muted);
    font-size:12px;
    line-height:1.2;
    font-weight:600;
    letter-spacing:0;
    white-space:nowrap;
}

.client-panel .client-subdetails summary::after{
    content:"";
    justify-self:end;
    width:8px;
    height:8px;
    border-right:2px solid var(--ol-gold);
    border-bottom:2px solid var(--ol-gold);
    transform:rotate(45deg);
    transition:transform .16s ease;
}

.client-panel .client-subdetails[open] summary::after{
    transform:rotate(225deg);
}

.client-panel .client-subdetails-body{
    padding:18px;
}

.client-panel .client-subdetails-body .form-grid{
    align-items:start;
}

.client-panel .client-subdetails-body textarea{
    min-height:96px;
    resize:vertical;
}

.client-panel .client-subdetails-body .char-counter{
    margin-top:9px;
}

@media(max-width:760px){
    .client-panel .client-subdetails summary{
        grid-template-columns:minmax(0,1fr) 18px;
        align-items:start;
    }

    .client-panel .client-subdetails summary .client-subdetails-meta,
    .client-panel .client-subdetails summary span.client-subdetails-meta{
        grid-column:1;
        justify-self:start;
        margin-top:4px;
        white-space:normal;
        font-size:12px;
    }

    .client-panel .client-subdetails summary::after{
        grid-column:2;
        grid-row:1 / span 2;
        margin-top:3px;
    }
}

/* Reparación específica: panel de gestión de reseñas con filtros compactos en dos columnas. */
.reviews-panel{
    overflow:hidden;
}

.reviews-panel-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    margin-bottom:16px;
}

.reviews-panel-head h3{
    margin-bottom:5px;
}

.review-counter-pill{
    flex:0 0 auto;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:34px;
    padding:7px 12px;
    border:1px solid rgba(189,146,80,.28);
    border-radius:999px;
    background:rgba(189,146,80,.10);
    color:var(--ol-ink);
    font-weight:800;
    font-size:13px;
    white-space:nowrap;
}

.review-admin-tools{
    display:grid;
    grid-template-columns:minmax(155px,.55fr) minmax(220px,1.45fr);
    gap:12px;
    margin-bottom:14px;
}

.review-admin-tools label{
    display:grid;
    gap:6px;
    margin:0;
    color:var(--ol-muted);
    font-weight:800;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.05em;
}

.review-admin-tools select,
.review-admin-tools input{
    width:100%;
    min-height:42px;
    padding:10px 12px;
    border:1px solid var(--ol-line);
    border-radius:14px;
    background:rgba(255,255,255,.76);
    color:var(--ol-ink);
    font-size:14px;
    font-weight:700;
    text-transform:none;
    letter-spacing:0;
}

body.dark .review-admin-tools select,
body.dark .review-admin-tools input{
    background:rgba(255,255,255,.06);
}

.review-admin-list{
    display:grid;
    gap:12px;
    max-height:470px;
    overflow:auto;
    padding:2px 6px 2px 0;
    scrollbar-width:thin;
}

.review-admin-card{
    display:grid;
    gap:10px;
    padding:14px;
    border:1px solid rgba(189,146,80,.20);
    border-radius:20px;
    background:linear-gradient(180deg,rgba(255,253,248,.86),rgba(255,255,255,.64));
    box-shadow:0 10px 28px rgba(16,32,51,.06);
}

body.dark .review-admin-card{
    background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.035));
}

.review-admin-card[hidden]{
    display:none!important;
}

.review-admin-card-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
}

.review-admin-card-head strong,
.review-admin-card-head span.muted{
    display:block;
}

.review-admin-message{
    line-height:1.55;
    color:var(--ol-ink);
}

.review-admin-meta{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    color:var(--ol-muted);
    font-size:13px;
}

.review-admin-meta span{
    padding:6px 9px;
    border:1px solid rgba(17,49,77,.08);
    border-radius:999px;
    background:rgba(255,255,255,.54);
}

body.dark .review-admin-meta span{
    background:rgba(255,255,255,.05);
    border-color:rgba(255,255,255,.08);
}

.review-admin-moderation{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px;
    padding-top:2px;
}

.review-admin-moderation form,
.reviews-admin-grid .card .review-admin-moderation form{
    display:flex;
    align-items:center;
    gap:8px;
    margin:0;
}

.review-admin-moderation .review-reject-form{
    flex:1 1 260px;
}

.review-admin-moderation input[name="reason"]{
    flex:1 1 180px;
    min-height:38px;
    min-width:0;
}

.review-admin-empty{
    padding:22px;
    border:1px dashed rgba(189,146,80,.35);
    border-radius:18px;
    background:rgba(189,146,80,.07);
    color:var(--ol-muted);
    font-weight:750;
    text-align:center;
}

.review-admin-empty[hidden]{
    display:none!important;
}

@media(max-width:760px){
    .reviews-panel-head,
    .review-admin-card-head{
        flex-direction:column;
        align-items:flex-start;
    }

    .review-admin-tools{
        grid-template-columns:1fr;
    }

    .review-admin-list{
        max-height:560px;
    }

    .review-admin-moderation,
    .review-admin-moderation form,
    .reviews-admin-grid .card .review-admin-moderation form{
        width:100%;
        display:grid;
    }
}

/* Reparación específica: check de Acceso al portal en alta de clientes */
.client-panel .client-access-details .client-subdetails-body{
    padding:16px 18px 18px;
}

.client-panel .client-check-option{
    display:flex;
    align-items:flex-start;
    justify-content:flex-start;
    gap:10px;
    width:100%;
    margin:0;
    cursor:pointer;
    color:var(--ol-ink);
    line-height:1.35;
}

.client-panel .client-check-option input[type="checkbox"]{
    flex:0 0 auto;
    width:16px;
    height:16px;
    min-width:16px;
    margin:3px 0 0;
    padding:0;
    cursor:pointer;
    accent-color:var(--ol-gold);
}

.client-panel .client-check-option .client-check-box{
    display:none;
}

.client-panel .client-check-option > span:last-child{
    display:grid;
    gap:2px;
    min-width:0;
}

.client-panel .client-check-option strong{
    display:block;
    color:var(--ol-ink);
    font-size:13px;
    font-weight:800;
    line-height:1.3;
}

.client-panel .client-check-option small{
    display:block;
    color:var(--ol-muted);
    font-size:12px;
    font-weight:600;
    line-height:1.35;
}

/* ---------- Client edit page ---------- */
.client-edit-toolbar{
    align-items:center;
}

.client-edit-identity{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:12px 16px;
    min-width:0;
}

.client-edit-identity h2{
    margin:0;
}

.client-edit-name{
    display:inline-flex;
    align-items:center;
    min-height:38px;
    padding:7px 14px;
    border:1px solid var(--ol-line);
    border-radius:999px;
    background:rgba(255,253,248,.88);
    color:var(--ol-ink);
    font-size:15px;
    font-weight:900;
    box-shadow:0 8px 18px rgba(16,32,51,.06);
}

body.dark .client-edit-name{
    background:rgba(255,255,255,.06);
}

.client-edit-status-wrap{
    display:inline-flex;
    align-items:center;
    gap:8px;
    min-height:38px;
    padding:6px 8px 6px 12px;
    border:1px solid var(--ol-line);
    border-radius:999px;
    background:rgba(255,255,255,.62);
}

body.dark .client-edit-status-wrap{
    background:rgba(255,255,255,.06);
}

.client-edit-status-wrap small{
    color:var(--ol-muted);
    font-size:12px;
    line-height:1;
    font-weight:850;
    white-space:nowrap;
}

.client-edit-page .client-panel summary .client-summary-copy{
    grid-template-columns:minmax(180px,.28fr) minmax(220px,1fr);
}

.client-edit-side-panel{
    display:grid;
    gap:12px;
    padding:22px;
}

.client-edit-status-card,
.client-edit-action-card,
.client-edit-list-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding:14px 16px;
    border:1px solid var(--ol-line-2);
    border-radius:18px;
    background:rgba(255,255,255,.46);
}

body.dark .client-edit-status-card,
body.dark .client-edit-action-card,
body.dark .client-edit-list-row{
    background:rgba(8,26,45,.42);
}

.client-edit-status-card strong,
.client-edit-action-card strong,
.client-edit-list-row strong{
    display:block;
    color:var(--ol-ink);
    font-size:15px;
    font-weight:900;
}

.client-edit-status-card .muted,
.client-edit-action-card .muted,
.client-edit-list-row small{
    display:block;
    margin-top:3px;
    color:var(--ol-muted);
    font-size:12px;
    line-height:1.35;
    font-weight:700;
}

.client-edit-results{
    padding-top:22px;
}

@media(max-width:760px){
    .client-edit-toolbar{
        align-items:flex-start;
    }

    .client-edit-identity{
        display:grid;
        width:100%;
        gap:10px;
    }

    .client-edit-status-wrap,
    .client-edit-name{
        width:100%;
        justify-content:space-between;
        border-radius:18px;
    }

    .client-edit-status-card,
    .client-edit-action-card,
    .client-edit-list-row{
        align-items:flex-start;
        flex-direction:column;
    }

    .client-edit-status-card .status,
    .client-edit-action-card .btn,
    .client-edit-list-row .btn{
        align-self:flex-start;
    }
}

/* Ajuste específico: ficha de cliente / acceso al portal */
.client-edit-toolbar{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
}

.client-edit-identity{
    display:grid;
    grid-template-columns:auto minmax(0,max-content) auto;
    align-items:center;
    gap:12px 16px;
}

.client-access-admin{
    gap:14px;
}

.client-access-status-card{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:18px;
    padding:16px 18px;
    border:1px solid var(--ol-line-2);
    border-radius:20px;
    background:rgba(255,255,255,.52);
}

body.dark .client-access-status-card{
    background:rgba(8,26,45,.42);
}

.client-access-status-main strong,
.client-access-action-form strong{
    display:block;
    color:var(--ol-ink);
    font-size:15px;
    font-weight:900;
}

.client-access-status-main .muted,
.client-access-action-form .muted{
    display:block;
    margin-top:4px;
    color:var(--ol-muted);
    font-size:13px;
    line-height:1.35;
    font-weight:700;
}

.client-access-status-pill{
    display:flex;
    align-items:center;
    gap:10px;
    justify-self:end;
    min-width:max-content;
    padding:7px 8px 7px 12px;
    border:1px solid rgba(189,146,80,.22);
    border-radius:999px;
    background:rgba(255,253,248,.78);
}

body.dark .client-access-status-pill{
    background:rgba(255,255,255,.06);
}

.client-access-status-pill small{
    color:var(--ol-muted);
    font-size:12px;
    font-weight:850;
    white-space:nowrap;
}

.client-access-actions{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
}

.client-access-actions .client-edit-action-card{
    min-height:96px;
}

.client-access-action-form{
    margin:0;
}

.client-access-action-form .btn{
    flex:0 0 auto;
}

.client-access-meta{
    display:block;
    margin-top:7px;
    color:var(--ol-muted);
    font-size:12px;
    font-weight:700;
}

.client-action-modal[hidden]{
    display:none!important;
}

.client-action-modal{
    position:fixed;
    inset:0;
    z-index:1200;
    display:grid;
    place-items:center;
    padding:24px;
}

.client-action-modal-backdrop{
    position:absolute;
    inset:0;
    background:rgba(11,31,51,.42);
    backdrop-filter:blur(8px);
}

.client-action-dialog{
    position:relative;
    z-index:1;
    width:min(520px,100%);
    padding:24px;
    border:1px solid var(--ol-line);
    border-radius:24px;
    background:rgba(255,253,248,.98);
    box-shadow:0 28px 70px rgba(11,31,51,.22);
}

body.dark .client-action-dialog{
    background:rgba(14,34,55,.98);
}

.client-action-dialog h3{
    margin:0 0 10px;
    color:var(--ol-ink);
    font-size:21px;
    line-height:1.2;
    font-weight:900;
    letter-spacing:-.035em;
}

.client-action-dialog p{
    margin:0 0 10px;
    color:var(--ol-ink);
    line-height:1.5;
}

.client-action-dialog-actions{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    margin-top:20px;
}

@media(max-width:760px){
    .client-edit-toolbar{
        grid-template-columns:1fr;
        align-items:start;
    }

    .client-edit-identity{
        grid-template-columns:1fr;
        width:100%;
    }

    .client-access-status-card,
    .client-access-actions{
        grid-template-columns:1fr;
    }

    .client-access-status-pill{
        justify-self:start;
        min-width:0;
        width:100%;
        justify-content:space-between;
        border-radius:18px;
    }

    .client-action-dialog-actions{
        display:grid;
    }
}

/* ---------- Ajustes ficha cliente: acceso, cabecera e histórico ---------- */
.client-edit-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
}

.client-edit-identity{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:10px 14px;
    width:auto;
    max-width:calc(100% - 120px);
}

.client-edit-name{
    min-height:36px;
    padding:6px 14px;
}

.client-edit-status-wrap{
    flex:0 0 auto;
    width:auto;
    max-width:max-content;
    min-height:34px;
    padding:5px 7px 5px 11px;
    box-shadow:0 6px 14px rgba(16,32,51,.04);
}

.client-edit-status-wrap .status{
    padding:6px 12px;
}

.client-access-admin{
    padding:22px;
}

.client-access-status-card{
    grid-template-columns:1fr;
}

.client-access-actions{
    grid-template-columns:1fr;
}

.client-access-full-card{
    width:100%;
}

.client-access-actions .client-edit-action-card{
    min-height:110px;
}

.client-access-action-form{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
}

.client-account-status-form{
    min-height:112px;
}

.client-access-inline-controls{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:10px;
    flex:0 0 auto;
    min-width:360px;
}

.client-access-inline-controls select{
    min-width:190px;
    height:40px;
    padding:0 36px 0 13px;
    border:1px solid var(--ol-line);
    border-radius:999px;
    background:rgba(255,253,248,.88);
    color:var(--ol-ink);
    font-weight:800;
    box-shadow:0 6px 14px rgba(16,32,51,.04);
}

body.dark .client-access-inline-controls select{
    background:rgba(255,255,255,.06);
}

.client-personal-data-history{
    display:grid;
    gap:18px;
}

.client-history-block{
    display:grid;
    gap:10px;
}

.client-history-block h3{
    margin:0;
    color:var(--ol-navy);
    font-size:16px;
    letter-spacing:-.02em;
}

body.dark .client-history-block h3{
    color:#fff;
}

.client-history-timeline{
    display:grid;
    gap:10px;
}

.client-history-item{
    padding:15px 16px;
    border:1px solid var(--ol-line-2);
    border-radius:18px;
    background:rgba(255,255,255,.48);
}

body.dark .client-history-item{
    background:rgba(8,26,45,.42);
}

.client-history-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
}

.client-history-head strong{
    color:var(--ol-ink);
    font-size:14px;
    font-weight:900;
}

.client-history-head small,
.client-history-actor{
    color:var(--ol-muted);
    font-size:12px;
    font-weight:750;
}

.client-history-actor{
    margin-top:3px;
}

.client-history-item ul{
    margin:10px 0 0;
    padding-left:18px;
    color:var(--ol-ink);
    font-size:13px;
    line-height:1.45;
}

.client-history-item li + li{
    margin-top:4px;
}

@media(max-width:760px){
    .client-edit-identity{
        max-width:100%;
    }

    .client-access-action-form,
    .client-history-head{
        align-items:flex-start;
        flex-direction:column;
    }

    .client-access-inline-controls{
        width:100%;
        min-width:0;
        display:grid;
        grid-template-columns:1fr;
    }

    .client-access-inline-controls select,
    .client-access-inline-controls .btn{
        width:100%;
    }
}

/* ---------- Zona peligrosa ficha cliente ---------- */
.client-danger-panel summary strong{
    color:#9f2f2a;
}

.client-danger-zone{
    padding:22px;
}

.client-danger-card{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    width:100%;
    padding:18px;
    border:1px solid rgba(201,74,61,.28);
    border-radius:22px;
    background:linear-gradient(135deg,rgba(255,245,243,.86),rgba(255,253,248,.92));
    box-shadow:0 10px 24px rgba(159,47,42,.08);
}

body.dark .client-danger-card{
    background:linear-gradient(135deg,rgba(80,27,31,.28),rgba(14,34,55,.82));
    border-color:rgba(238,132,118,.34);
}

.client-danger-card strong{
    display:block;
    margin-bottom:4px;
    color:#8f2a25;
    font-weight:900;
}

body.dark .client-danger-card strong{
    color:#ffb0a6;
}

.client-danger-card .muted,
.client-danger-card .client-access-meta{
    display:block;
    max-width:780px;
}

.client-action-dialog-danger{
    border-color:rgba(201,74,61,.36);
    box-shadow:0 28px 70px rgba(124,32,29,.24);
}

.client-action-dialog-danger h3{
    color:#8f2a25;
}

body.dark .client-action-dialog-danger h3{
    color:#ffb0a6;
}

.client-delete-confirm-form{
    display:grid;
    gap:12px;
    margin-top:16px;
}

.client-delete-confirm-form label{
    display:grid;
    gap:6px;
    color:var(--ol-ink);
    font-size:13px;
    font-weight:850;
}

.client-delete-confirm-form input{
    width:100%;
    border:1px solid var(--ol-line);
    border-radius:14px;
    padding:12px 13px;
    background:rgba(255,253,248,.9);
    color:var(--ol-ink);
    font-weight:750;
}

body.dark .client-delete-confirm-form input{
    background:rgba(255,255,255,.06);
}

@media(max-width:760px){
    .client-danger-card{
        display:grid;
    }

    .client-danger-card .btn{
        width:100%;
        justify-content:center;
    }
}

.client-delete-confirm-form label.client-delete-full-option{
    display:flex;
    align-items:flex-start;
    gap:12px;
    padding:14px;
    border:1px solid rgba(201,74,61,.28);
    border-radius:16px;
    background:rgba(255,245,243,.7);
}

body.dark .client-delete-full-option{
    background:rgba(80,27,31,.24);
    border-color:rgba(238,132,118,.32);
}

.client-delete-confirm-form label.client-delete-full-option input[type="checkbox"]{
    width:18px;
    min-width:18px;
    height:18px;
    padding:0;
    margin:2px 0 0;
    border-radius:4px;
    flex:0 0 18px;
    accent-color:#c94a3d;
}

.client-delete-full-option span,
.client-delete-full-option small{
    display:block;
}

.client-delete-full-option strong{
    color:#8f2a25;
    font-weight:900;
}

body.dark .client-delete-full-option strong{
    color:#ffb0a6;
}

.client-delete-full-option small{
    margin-top:3px;
    color:var(--ol-muted);
    line-height:1.35;
}


/* ---------- Sidebar fijo + marca inferior ---------- */

@media (min-width:861px){
    body.ol-logged .layout{
        --ol-fixed-sidebar-width:292px;
        display:block;
        padding-left:var(--ol-fixed-sidebar-width);
        min-height:calc(100vh - 78px);
    }

    body.ol-logged .sidebar{
        position:fixed;
        top:78px;
        left:0;
        bottom:0;
        z-index:30;
        width:var(--ol-fixed-sidebar-width);
        height:auto;
        overflow:hidden;
        display:flex;
        flex-direction:column;
        padding-bottom:34px;
    }

    body.ol-logged .sidebar .nav{
        position:relative;
        z-index:2;
        min-height:0;
        overflow:auto;
        padding-bottom:190px;
        scrollbar-width:thin;
    }

    body.ol-logged .sidebar::after{
        content:"";
        position:absolute;
        left:50%;
        bottom:34px;
        z-index:1;
        width:min(170px,64%);
        aspect-ratio:1/1;
        transform:translateX(-50%);
        pointer-events:none;
        background:url('/assets/img/logo-symbol.png') center/contain no-repeat;
        opacity:.075;
        filter:saturate(.85) sepia(.18) contrast(.96);
    }

    body.dark.ol-logged .sidebar::after{
        opacity:.09;
        filter:saturate(.7) sepia(.16) brightness(1.22);
    }
}

@media (min-width:861px) and (max-width:1100px){
    body.ol-logged .layout{
        --ol-fixed-sidebar-width:245px;
    }
}

/* ---------- Topbar fija en escritorio ---------- */

body.ol-app{
    padding-top:78px;
}

body.ol-app .topbar{
    position:fixed;
    top:0;
    left:0;
    right:0;
    z-index:90;
    width:100%;
}

@media (min-width:861px){
    body.ol-logged .layout{
        min-height:calc(100vh - 78px);
    }

    body.ol-logged .sidebar{
        top:78px;
    }
}

@media (max-width:860px){
    body.ol-app{
        padding-top:70px;
    }

    body.ol-app .topbar{
        height:70px;
        padding-left:16px;
        padding-right:16px;
    }
}

/* ---------- Ajuste fino: lateral estable sin salto ni scroll horizontal ---------- */

@media (min-width:861px){
    body.ol-app{
        overflow-x:hidden;
    }

    body.ol-logged .sidebar{
        overflow:hidden!important;
        transform:translateZ(0);
        backface-visibility:hidden;
    }

    body.ol-logged .sidebar .nav{
        flex:1 1 auto;
        width:100%;
        max-width:100%;
        min-width:0;
        overflow-y:auto;
        overflow-x:hidden!important;
        scrollbar-gutter:stable;
        overscroll-behavior:contain;
        padding-right:0;
    }

    body.ol-logged .sidebar .nav-section,
    body.ol-logged .sidebar .nav a{
        min-width:0;
        max-width:100%;
    }

    body.ol-logged .sidebar .nav a,
    body.ol-logged .sidebar .nav a:hover,
    body.ol-logged .sidebar .nav a.active{
        transform:none!important;
    }

    body.ol-logged .sidebar .nav a span:last-child{
        min-width:0;
        overflow:hidden;
        text-overflow:ellipsis;
    }
}

/* ---------- Ajuste fino: cabecera y lateral visualmente unidos ---------- */

@media (min-width:861px){
    body.ol-logged{
        --ol-fixed-sidebar-width:292px;
    }

    body.ol-logged .topbar{
        border-bottom:0!important;
        overflow:visible;
    }

    body.ol-logged .topbar::before{
        content:"";
        position:absolute;
        left:0;
        top:0;
        bottom:-1px;
        width:var(--ol-fixed-sidebar-width);
        z-index:0;
        pointer-events:none;
        background:
            linear-gradient(180deg,rgba(255,253,248,.86),rgba(247,243,236,.92)),
            radial-gradient(circle at 0 0,rgba(189,146,80,.16),transparent 20rem);
        border-right:1px solid var(--ol-line-2);
    }

    body.dark.ol-logged .topbar::before{
        background:linear-gradient(180deg,#0b2035,#081a2d);
    }

    body.ol-logged .topbar::after{
        content:"";
        position:absolute;
        left:var(--ol-fixed-sidebar-width);
        right:0;
        bottom:0;
        height:1px;
        z-index:0;
        pointer-events:none;
        background:var(--ol-line-2);
    }

    body.ol-logged .topbar > *{
        position:relative;
        z-index:1;
    }

    body.ol-logged .brand{
        width:calc(var(--ol-fixed-sidebar-width) - 56px);
        flex:0 0 calc(var(--ol-fixed-sidebar-width) - 56px);
    }

    body.ol-logged .sidebar{
        border-top:0!important;
    }
}

@media (min-width:861px) and (max-width:1100px){
    body.ol-logged{
        --ol-fixed-sidebar-width:245px;
    }
}

/* ---------- Refinamiento premium: uniones de cabecera y lateral ---------- */

@media (min-width:861px){
    body.ol-logged{
        --ol-sidebar-divider:rgba(214,190,157,.72);
        --ol-sidebar-divider-soft:rgba(232,222,208,.78);
        --ol-sidebar-divider-glow:rgba(189,146,80,.26);
    }

    body.dark.ol-logged{
        --ol-sidebar-divider:rgba(215,189,124,.22);
        --ol-sidebar-divider-soft:rgba(215,189,124,.14);
        --ol-sidebar-divider-glow:rgba(215,189,124,.16);
    }

    body.ol-logged .brand{
        height:78px;
        align-items:center;
    }

    body.ol-logged .topbar::before{
        border-right:1px solid var(--ol-sidebar-divider)!important;
        box-shadow:
            inset 0 -1px 0 var(--ol-sidebar-divider-soft),
            inset -1px 0 0 rgba(255,255,255,.36),
            16px 0 34px -38px rgba(16,32,51,.40);
    }

    body.dark.ol-logged .topbar::before{
        box-shadow:
            inset 0 -1px 0 var(--ol-sidebar-divider-soft),
            16px 0 34px -38px rgba(0,0,0,.62);
    }

    body.ol-logged .topbar::after{
        left:var(--ol-fixed-sidebar-width)!important;
        height:1px!important;
        background:linear-gradient(90deg,
            var(--ol-sidebar-divider-soft) 0%,
            rgba(232,222,208,.66) 36%,
            rgba(232,222,208,.28) 72%,
            transparent 100%)!important;
    }

    body.dark.ol-logged .topbar::after{
        background:linear-gradient(90deg,
            rgba(215,189,124,.16) 0%,
            rgba(215,189,124,.10) 42%,
            rgba(215,189,124,.04) 76%,
            transparent 100%)!important;
    }

    body.ol-logged .sidebar{
        border-right:1px solid var(--ol-sidebar-divider)!important;
        box-shadow:
            inset 0 1px 0 var(--ol-sidebar-divider-soft),
            14px 0 36px -42px rgba(16,32,51,.45);
    }

    body.ol-logged .sidebar::before{
        content:"";
        position:absolute;
        top:0;
        left:20px;
        right:20px;
        z-index:4;
        height:1px;
        pointer-events:none;
        background:linear-gradient(90deg,
            transparent 0%,
            var(--ol-sidebar-divider-glow) 16%,
            var(--ol-sidebar-divider-soft) 52%,
            var(--ol-sidebar-divider-glow) 84%,
            transparent 100%);
    }
}

/* ============================================================
   OrtaLegal · ajuste definitivo de uniones cabecera/lateral
   Mantiene la estructura existente y solo normaliza las líneas.
   ============================================================ */

@media (min-width:861px){
    body.ol-logged{
        --ol-sidebar-divider:rgba(214,190,157,.66);
        --ol-sidebar-divider-soft:rgba(232,222,208,.74);
    }

    body.dark.ol-logged{
        --ol-sidebar-divider:rgba(215,189,124,.22);
        --ol-sidebar-divider-soft:rgba(215,189,124,.14);
    }

    body.ol-logged .topbar{
        border-bottom:1px solid var(--ol-sidebar-divider-soft)!important;
        box-shadow:0 6px 18px rgba(16,32,51,.025)!important;
        overflow:visible!important;
    }

    body.ol-logged .topbar::before{
        top:0!important;
        bottom:0!important;
        width:var(--ol-fixed-sidebar-width)!important;
        border-right:1px solid var(--ol-sidebar-divider)!important;
        box-shadow:none!important;
    }

    body.ol-logged .topbar::after{
        display:none!important;
        content:none!important;
    }

    body.ol-logged .sidebar{
        top:78px!important;
        border-top:0!important;
        border-right:1px solid var(--ol-sidebar-divider)!important;
        box-shadow:14px 0 34px -44px rgba(16,32,51,.42)!important;
    }

    body.ol-logged .sidebar::before{
        display:none!important;
        content:none!important;
    }

    body.ol-logged .brand{
        height:78px!important;
    }
}

/* ============================================================
   OrtaLegal · unión real cabecera/lateral
   El bloque izquierdo de marca y el menú lateral quedan como una
   sola pieza: sin línea horizontal bajo el logo.
   ============================================================ */

@media (min-width:861px){
    body.ol-logged .topbar{
        border-bottom:0!important;
        box-shadow:none!important;
        overflow:visible!important;
    }

    /* Fondo del bloque de marca integrado con el lateral */
    body.ol-logged .topbar::before{
        content:""!important;
        position:absolute!important;
        left:0!important;
        top:0!important;
        bottom:0!important;
        width:var(--ol-fixed-sidebar-width)!important;
        z-index:0!important;
        pointer-events:none!important;
        background:
            linear-gradient(180deg,rgba(255,253,248,.86),rgba(247,243,236,.92)),
            radial-gradient(circle at 0 0,rgba(189,146,80,.16),transparent 20rem)!important;
        border-right:1px solid var(--ol-sidebar-divider, var(--ol-line-2))!important;
        border-bottom:0!important;
        box-shadow:none!important;
    }

    body.dark.ol-logged .topbar::before{
        background:linear-gradient(180deg,#0b2035,#081a2d)!important;
    }

    /* La línea inferior de la cabecera empieza DESPUÉS del lateral */
    body.ol-logged .topbar::after{
        content:""!important;
        display:block!important;
        position:absolute!important;
        left:var(--ol-fixed-sidebar-width)!important;
        right:0!important;
        bottom:0!important;
        height:1px!important;
        z-index:0!important;
        pointer-events:none!important;
        background:linear-gradient(90deg,
            rgba(232,222,208,.82) 0%,
            rgba(232,222,208,.56) 48%,
            rgba(232,222,208,.24) 82%,
            transparent 100%)!important;
    }

    body.dark.ol-logged .topbar::after{
        background:linear-gradient(90deg,
            rgba(215,189,124,.18) 0%,
            rgba(215,189,124,.10) 55%,
            rgba(215,189,124,.04) 84%,
            transparent 100%)!important;
    }

    body.ol-logged .sidebar{
        top:78px!important;
        border-top:0!important;
        border-right:1px solid var(--ol-sidebar-divider, var(--ol-line-2))!important;
        box-shadow:14px 0 34px -44px rgba(16,32,51,.42)!important;
    }

    body.ol-logged .brand{
        height:78px!important;
        align-items:center!important;
    }
}

/* ============================================================
   OrtaLegal · cierre exacto de la unión lateral/cabecera
   Corrige el micro-hueco donde la línea horizontal no llega
   a tocar la división vertical del lateral.
   ============================================================ */

@media (min-width:861px){
    body.ol-logged{
        --ol-sidebar-divider-final:rgba(214,190,157,.70);
        --ol-sidebar-divider-soft-final:rgba(232,222,208,.82);
    }

    body.dark.ol-logged{
        --ol-sidebar-divider-final:rgba(215,189,124,.22);
        --ol-sidebar-divider-soft-final:rgba(215,189,124,.16);
    }

    body.ol-logged .topbar::before{
        width:calc(var(--ol-fixed-sidebar-width) + 1px)!important;
        border-right:0!important;
        box-shadow:inset -1px 0 0 var(--ol-sidebar-divider-final)!important;
    }

    body.ol-logged .topbar::after{
        left:calc(var(--ol-fixed-sidebar-width) - 1px)!important;
        bottom:0!important;
        height:1px!important;
        background:linear-gradient(90deg,
            var(--ol-sidebar-divider-soft-final) 0,
            var(--ol-sidebar-divider-soft-final) 2px,
            rgba(232,222,208,.74) 120px,
            rgba(232,222,208,.36) 70%,
            transparent 100%)!important;
    }

    body.dark.ol-logged .topbar::after{
        background:linear-gradient(90deg,
            var(--ol-sidebar-divider-soft-final) 0,
            var(--ol-sidebar-divider-soft-final) 2px,
            rgba(215,189,124,.12) 120px,
            rgba(215,189,124,.05) 70%,
            transparent 100%)!important;
    }

    body.ol-logged .sidebar{
        border-right:1px solid var(--ol-sidebar-divider-final)!important;
    }
}

/* Usuarios internos · paneles contraídos y fotografía de perfil v6.7.1 */
.internal-user-avatar-card{
    align-items:center;
    justify-content:center;
    min-height:220px;
    text-align:center;
    overflow:hidden;
}

.internal-user-avatar-card-copy{
    display:grid;
    gap:6px;
    width:100%;
}

.internal-user-avatar-card-copy h4,
.internal-user-avatar-card-copy p{
    text-align:left;
}

.internal-user-avatar-preview{
    width:clamp(124px,16vw,164px)!important;
    height:auto!important;
    aspect-ratio:1/1;
    display:grid;
    place-items:center;
    flex:0 0 auto;
    align-self:center;
    justify-self:center;
    margin:10px auto 4px;
    overflow:hidden;
    max-width:100%;
    border:5px solid rgba(255,255,255,.96);
    border-radius:999px!important;
    background:linear-gradient(145deg,#fff3d8,#ead19e);
    box-shadow:0 14px 34px rgba(11,40,69,.14),0 0 0 1px rgba(189,146,80,.25);
    color:#8a5a13;
    font-size:2rem;
    font-weight:950;
    letter-spacing:.03em;
}

.internal-user-avatar-preview img{
    width:100%!important;
    height:100%!important;
    max-width:none!important;
    display:block;
    object-fit:cover!important;
    object-position:center;
    border-radius:inherit;
}

.internal-user-avatar-meta{
    display:grid;
    gap:3px;
    color:var(--ol-ink);
}

.internal-user-avatar-meta strong{
    font-size:.82rem;
    font-weight:900;
}

.internal-user-avatar-meta small{
    color:var(--ol-muted);
    font-size:.7rem;
    line-height:1.4;
}

body.dark .internal-user-avatar-preview{
    border-color:rgba(17,38,58,.95);
    background:linear-gradient(145deg,#2c4255,#172d40);
    color:#f3d59a;
    box-shadow:0 14px 34px rgba(0,0,0,.28),0 0 0 1px rgba(189,146,80,.3);
}

@media(max-width:920px){
    .internal-user-avatar-card{
        min-height:0;
        padding-block:22px;
    }
}
