/* ============================================================
   WÖRTH SELECTION · PORTAL DESIGN SYSTEM v1
   Un lenguaje visual para TODOS los roles
   ============================================================ */

body.ws-portal-unified{
    --ws-green:#07513e;
    --ws-green-2:#087258;
    --ws-green-soft:#e4f0ea;
    --ws-green-soft-2:#edf5f1;

    --ws-sand:#c9a775;
    --ws-sand-soft:#f2e7d6;

    --ws-cream:#f8f5ee;
    --ws-white:#ffffff;

    --ws-text:#344f46;
    --ws-muted:#77867f;

    --ws-border:#dce4e0;
    --ws-border-strong:#cbd9d2;

    --ws-radius:11px;

    background:var(--ws-cream) !important;

    color:var(--ws-text) !important;

    font-family:
        "Inter",
        Arial,
        sans-serif !important;
}


/* ============================================================
   HEADER
   ============================================================ */

body.ws-portal-unified header{
    background:#fff !important;

    border-bottom:
        1px solid #e1e7e4 !important;

    box-shadow:none !important;
}


/*
 * Logo mantiene el mismo tamaño visual
 * independientemente del rol.
 */

body.ws-portal-unified header .logo,
body.ws-portal-unified header img{
    object-fit:contain;
}


/* ============================================================
   TOP NAV
   ============================================================ */

body.ws-portal-unified #topNav{
    display:flex;

    align-items:center;

    gap:4px;
}


body.ws-portal-unified #topNav span,
body.ws-portal-unified #topNav a,
body.ws-portal-unified #topNav button{
    min-height:40px;

    display:inline-flex;

    align-items:center;
    justify-content:center;

    padding:
        0 12px;

    border-radius:9px;

    color:#40564e;

    font-family:
        "Inter",
        Arial,
        sans-serif;

    font-size:12px;
    font-weight:600;

    text-decoration:none;

    cursor:pointer;

    transition:
        background .15s ease,
        color .15s ease,
        transform .15s ease;
}


body.ws-portal-unified #topNav span:hover,
body.ws-portal-unified #topNav a:hover,
body.ws-portal-unified #topNav button:hover{
    background:
        var(--ws-green-soft-2);

    color:
        var(--ws-green);

    transform:
        translateY(-1px);
}


/* ============================================================
   SIDEBAR
   ============================================================ */

body.ws-portal-unified .sidebar{
    background:#fff !important;

    border-right:
        1px solid #e0e7e3 !important;
}


body.ws-portal-unified #sidebarTitle{
    min-height:58px !important;

    display:flex !important;

    align-items:center !important;
    justify-content:flex-start !important;

    box-sizing:border-box !important;

    padding:
        0 16px !important;

    margin:0 !important;

    background:
        linear-gradient(
            135deg,
            #07513e,
            #08604a
        ) !important;

    color:#fff !important;

    font-family:
        "Inter",
        Arial,
        sans-serif !important;

    font-size:15px !important;

    font-weight:750 !important;

    line-height:1 !important;
}


/* ============================================================
   GRUPOS DEL SIDEBAR
   ============================================================ */

body.ws-portal-unified .menu-group{
    padding:
        17px 8px 15px !important;

    border-bottom:
        1px solid #e3e8e5 !important;
}


body.ws-portal-unified .menu-title{
    margin:
        0 10px 9px !important;

    color:#60756c !important;

    font-family:
        "Inter",
        Arial,
        sans-serif !important;

    font-size:
        10px !important;

    font-weight:
        750 !important;

    letter-spacing:
        .02em !important;

    text-transform:none !important;
}


/* ============================================================
   ITEMS DEL MENÚ
   ============================================================ */

body.ws-portal-unified .menu-item{
    position:relative;

    min-height:42px !important;

    display:flex !important;

    align-items:center !important;

    gap:9px !important;

    box-sizing:border-box;

    margin:
        2px 0 !important;

    padding:
        7px 10px !important;

    border-radius:
        9px !important;

    color:
        #365148 !important;

    font-family:
        "Inter",
        Arial,
        sans-serif !important;

    font-size:
        12.5px !important;

    font-weight:
        500 !important;

    cursor:pointer;

    transition:
        background .15s ease,
        color .15s ease,
        transform .15s ease;
}


body.ws-portal-unified .menu-item:hover{
    background:
        var(--ws-green-soft-2) !important;

    color:
        var(--ws-green) !important;

    transform:
        translateX(2px);
}


body.ws-portal-unified .menu-item.active{
    background:
        #dcebe4 !important;

    color:
        var(--ws-green) !important;

    font-weight:
        700 !important;
}


body.ws-portal-unified .menu-item.active::before{
    content:"";

    position:absolute;

    left:0;

    width:3px;
    height:24px;

    border-radius:
        0 4px 4px 0;

    background:
        var(--ws-green);
}


/* ============================================================
   ICONOS DEL MENÚ
   ============================================================ */

.ws-global-nav-icon{
    width:29px;
    height:29px;

    flex:
        0 0 29px;

    display:grid;

    place-items:center;

    border-radius:
        8px;

    background:
        #eef5f2;

    color:
        var(--ws-green-2);

    transition:
        background .15s ease,
        transform .15s ease;
}


.ws-global-nav-icon svg{
    width:16px;
    height:16px;
}


body.ws-portal-unified
.menu-item:hover
.ws-global-nav-icon{
    background:
        #dcece4;

    transform:
        scale(1.04);
}


body.ws-portal-unified
.menu-item.active
.ws-global-nav-icon{
    background:#fff;
}


/* ============================================================
   FONDO DECORATIVO WÖRTH
   ============================================================ */

body.ws-portal-unified #content{
    position:relative !important;

    isolation:isolate;

    background:
        transparent !important;
}


body.ws-portal-unified #content::before{
    content:"";

    position:absolute;

    z-index:-1;

    width:175px;
    height:175px;

    left:-92px;
    top:300px;

    border-radius:50%;

    background:
        rgba(203,233,218,.30);

    pointer-events:none;
}


body.ws-portal-unified #content::after{
    content:"";

    position:absolute;

    z-index:-1;

    width:115px;
    height:115px;

    right:22px;
    bottom:38px;

    border:
        1.5px solid
        rgba(104,218,166,.26);

    border-radius:
        23px;

    transform:
        rotate(9deg);

    pointer-events:none;
}


/* ============================================================
   TÍTULOS
   ============================================================ */

body.ws-portal-unified #content h1{
    color:
        #073f31 !important;

    font-family:
        Georgia,
        "Times New Roman",
        serif !important;

    font-size:
        30px;

    font-weight:
        500 !important;

    line-height:
        1.08;

    letter-spacing:
        -.55px;
}


body.ws-portal-unified #content h2,
body.ws-portal-unified #content h3{
    color:
        #073f31 !important;
}


/* ============================================================
   TEXTO SECUNDARIO
   ============================================================ */

body.ws-portal-unified
#content p,
body.ws-portal-unified
#content .subtitle{
    color:
        var(--ws-muted);
}


/* ============================================================
   TARJETAS
   ============================================================ */

body.ws-portal-unified
#content .panel,

body.ws-portal-unified
#content .card,

body.ws-portal-unified
#content [class*="card"],

body.ws-portal-unified
#content [class*="panel"]{
    border-color:
        var(--ws-border) !important;

    box-shadow:
        none !important;
}


/*
 * Se agrega mediante JS solo a contenedores reales.
 */

.ws-global-card{
    background:#fff !important;

    border:
        1px solid
        var(--ws-border) !important;

    border-radius:
        var(--ws-radius) !important;

    transition:
        transform .16s ease,
        border-color .16s ease,
        box-shadow .16s ease !important;
}


.ws-global-card:hover{
    border-color:
        var(--ws-border-strong) !important;

    box-shadow:
        0 8px 22px
        rgba(24,57,44,.045) !important;
}


/* ============================================================
   KPI
   ============================================================ */

.ws-global-kpi{
    position:relative;

    overflow:hidden;
}


.ws-global-kpi::after{
    content:"";

    position:absolute;

    right:-20px;
    bottom:-20px;

    width:48px;
    height:48px;

    border-radius:50%;

    background:
        rgba(195,229,212,.20);

    pointer-events:none;
}


.ws-global-kpi-icon{
    width:37px;
    height:37px;

    display:grid;

    place-items:center;

    margin-bottom:
        8px;

    border-radius:50%;

    background:
        #edf5f1;

    color:
        var(--ws-green-2);
}


.ws-global-kpi-icon svg{
    width:18px;
    height:18px;
}


/* ============================================================
   TÍTULOS DE SECCIÓN CON ICONO
   ============================================================ */

.ws-global-section-title{
    display:flex !important;

    align-items:center !important;

    gap:9px !important;
}


.ws-global-section-icon{
    width:29px;
    height:29px;

    flex:
        0 0 29px;

    display:grid;

    place-items:center;

    border-radius:
        8px;

    background:
        #edf5f1;

    color:
        var(--ws-green-2);
}


.ws-global-section-icon svg{
    width:17px;
    height:17px;
}


/* ============================================================
   BOTONES
   ============================================================ */

body.ws-portal-unified button,
body.ws-portal-unified .btn{
    font-family:
        "Inter",
        Arial,
        sans-serif !important;

    transition:
        transform .14s ease,
        background .14s ease,
        border-color .14s ease,
        box-shadow .14s ease;
}


body.ws-portal-unified button:hover,
body.ws-portal-unified .btn:hover{
    transform:
        translateY(-1px);
}


/* ============================================================
   BOTÓN PRIMARIO
   ============================================================ */

body.ws-portal-unified .btn-primary,
body.ws-portal-unified
button[class*="primary"]{
    background:
        var(--ws-green) !important;

    border-color:
        var(--ws-green) !important;

    color:#fff !important;
}


/* ============================================================
   TABLAS
   ============================================================ */

body.ws-portal-unified table{
    border-collapse:
        collapse;
}


body.ws-portal-unified table thead{
    background:
        #f4f7f5;
}


body.ws-portal-unified table tbody tr{
    transition:
        background .13s ease;
}


body.ws-portal-unified table tbody tr:hover{
    background:
        #f6faf8 !important;
}


/* ============================================================
   INPUTS
   ============================================================ */

body.ws-portal-unified
input,

body.ws-portal-unified
select,

body.ws-portal-unified
textarea{
    border-color:
        #cedad4;

    border-radius:
        8px;

    font-family:
        "Inter",
        Arial,
        sans-serif;
}


body.ws-portal-unified
input:focus,

body.ws-portal-unified
select:focus,

body.ws-portal-unified
textarea:focus{
    outline:
        2px solid
        rgba(7,81,62,.10);

    border-color:
        var(--ws-green);
}


/* ============================================================
   BADGES / ESTADOS
   ============================================================ */

body.ws-portal-unified
[class*="badge"],
body.ws-portal-unified
[class*="status"]{
    border-radius:
        999px;
}


/* ============================================================
   AVATAR / ROL
   ============================================================ */

body.ws-portal-unified #roleBadge{
    background:
        #e3f0e9 !important;

    color:
        var(--ws-green) !important;
}


body.ws-portal-unified #avatar{
    background:
        var(--ws-green) !important;

    color:#fff !important;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media(max-width:900px){

    body.ws-portal-unified
    #content::before,

    body.ws-portal-unified
    #content::after{
        display:none;
    }
}
