/* ================================
   INTRANET DOMENJÓ · ESTIL BASE
   Layout general, header i menú
   ================================ */

/* 🎨 Paleta corporativa aproximada DOMENJÓ */
:root {
    --intra-bg: #050505;
    --intra-bg-soft: #121212;
    --intra-bg-gradient: radial-gradient(circle at top left, #2b1a07 0, #050505 40%, #000000 100%);
    --intra-gold: #c89a3c;
    --intra-gold-soft: #e1b869;
    --intra-border: #2b2b2b;
    --intra-text: #f5f5f5;
    --intra-text-muted: #aaaaaa;
    --intra-danger: #d9534f;
    --intra-radius-lg: 18px;
    --intra-shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.45);
}

/* Cos general de la intranet */
.intranet-body {
    margin: 0;
    min-height: 100vh;
    background: var(--intra-bg-gradient) !important;
    color: var(--intra-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.intra-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
}

.intra-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.intra-logo-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.9);
}

.intra-brand-name {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--intra-gold-soft);
}

.intra-brand-sub {
    font-size: 0.8rem;
    color: var(--intra-text-muted);
}

.intra-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.intra-header-user {
    font-size: 0.85rem;
    text-align: right;
}

.intra-user-name {
    font-weight: 500;
}

.intra-user-role {
    margin-left: 0.25rem;
    color: var(--intra-gold-soft);
    font-weight: 500;
}

/* Botó tancar sessió */
.intra-header-logout {
    margin: 0;
}

.intra-btn-logout {
    border: 1px solid var(--intra-border);
    background: transparent;
    color: var(--intra-text-muted);
    padding: 0.35rem 0.9rem;
    font-size: 0.8rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.18s ease-out;
}

.intra-btn-logout:hover {
    border-color: var(--intra-danger);
    color: #fff;
    background: rgba(217, 83, 79, 0.15);
}

/* Botó hamburguesa (mòbil) */
.intra-menu-toggle {
    display: none; /* visible només a mòbil */
    width: 34px;
    height: 26px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.intra-menu-toggle span {
    display: block;
    height: 2px;
    margin: 4px 0;
    background: #ffffff;
    border-radius: 999px;
}

/* =======================
   MENÚ LATERAL
   ======================= */

.intra-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
    z-index: 30;
}

.intra-nav {
    position: fixed;
    top: 64px; /* aprox. alçada header */
    left: 0;
    width: 250px;
    height: calc(100vh - 64px);
    background: linear-gradient(180deg, #050505 0%, #111111 100%);
    border-right: 1px solid var(--intra-border);
    padding: 1.2rem 1rem 1.5rem;
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.6);
    z-index: 35;
    overflow-y: auto;
}

.intra-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--intra-text-muted);
}

.intra-nav-close {
    border: none;
    background: transparent;
    color: var(--intra-text-muted);
    font-size: 1.1rem;
    cursor: pointer;
}

/* Seccions i enllaços del menú */
.intra-nav-sections {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.intra-nav-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--intra-gold-soft);
    margin: 0 0 0.4rem;
}

.intra-nav-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.intra-nav-section li {
    margin-bottom: 0.25rem;
}

.intra-nav-section a {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--intra-text-muted);
    text-decoration: none;
    padding: 0.15rem 0;
    border-radius: 999px;
    transition: color 0.15s ease-out, padding-left 0.15s ease-out;
}

.intra-nav-section a:hover,
.intra-nav-section a:focus {
    color: #ffffff;
    padding-left: 0.3rem;
}

.intra-nav-disabled {
    display: inline-block;
    font-size: 0.8rem;
    color: #555555;
    padding: 0.1rem 0;
    cursor: default;
}

/* =======================
   CONTINGUT PRINCIPAL
   ======================= */

.intra-main {
    min-height: calc(100vh - 64px);
    padding: 2rem 2.5rem;
    margin-left: 250px; /* espai pel menú lateral */
}

/* Ajustos típics per a targetes tipus "login-card" reutilitzades al dashboard */
.intra-main .login-card {
    max-width: 520px;
    margin-left: 0;
}

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

@media (max-width: 960px) {
    .intra-menu-toggle {
        display: inline-block;
    }

    .intra-nav {
        transform: translateX(-100%);
        transition: transform 0.2s ease-out;
    }

    .intra-main {
        margin-left: 0;
        padding: 1.5rem 1.25rem;
    }

    body.intra-nav-open .intra-nav {
        transform: translateX(0);
    }

    body.intra-nav-open .intra-nav-overlay {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 600px) {
    .intra-header {
        padding: 0.6rem 1rem;
    }

    .intra-brand-name {
        font-size: 0.8rem;
    }

    .intra-brand-sub {
        font-size: 0.7rem;
    }

    .intra-header-right {
        gap: 0.5rem;
    }

    .intra-header-user {
        display: none; /* per no saturar a pantalles petites */
    }
}


/* ──────────────────────────────────────────────
   Capçalera tipus EXTRANET (intranet-header)
   ────────────────────────────────────────────── */

.intranet-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 1.5rem 3rem;
}

/* Header negre superior */
.intranet-header {
    background: #050505;
    border-bottom: 1px solid #1c1c1c;
}

.intranet-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo + marca */
.intranet-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.intranet-logo-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
}

.intranet-brand-name {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #f7f4ec;
}

.intranet-brand-sub {
    font-size: 0.8rem;
    color: #d0c6aa;
}

/* Zona dreta: usuari + logout + botó menú */
.intranet-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #f7f4ec;
    font-size: 0.85rem;
}

.intranet-header-role {
    color: #f1b24a;
    margin-left: 0.25rem;
}

.intranet-header-logout {
    margin: 0;
}

.intranet-btn-logout {
    border: none;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    cursor: pointer;
    background: #f1b24a;
    color: #111;
}

/* Botó hamburguesa */
.intranet-menu-toggle {
    margin-left: 0.5rem;
    width: 34px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid #444;
    background: transparent;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 0;
    cursor: pointer;
}

.intranet-menu-toggle span {
    display: block;
    width: 16px;
    height: 2px;
    background: #f7f4ec;
}

/* ──────────────────────────────────────────────
   Menú lateral plegable (costat ESQUERRE)
   ────────────────────────────────────────────── */

.intranet-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out;
    z-index: 40;
}

.intranet-nav {
    position: fixed;
    inset: 0 0 0 auto;      /* enganxat a la DRETA */
    width: 260px;
    max-width: 80%;
    background: #080808;
    border-left: 1px solid #1f1f1f;  /* ara el límit és a l'esquerra del menú */
    color: #f7f4ec;
    transform: translateX(100%);     /* amagat cap a la DRETA */
    transition: transform 0.2s ease-out;
    z-index: 50;
    display: flex;
    flex-direction: column;
}

.intranet-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid #1f1f1f;
    font-size: 0.9rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.intranet-nav-close {
    border: none;
    background: transparent;
    color: #f7f4ec;
    font-size: 1.4rem;
    cursor: pointer;
}

.intranet-nav-sections {
    padding: 0.75rem 1.1rem 1.5rem;
    overflow-y: auto;
}

.intranet-nav-section + .intranet-nav-section {
    margin-top: 1.25rem;
}

.intranet-nav-section h3 {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #c6b48a;
}

.intranet-nav-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.intranet-nav-section li + li {
    margin-top: 0.3rem;
}

.intranet-nav-section a {
    font-size: 0.88rem;
    color: #f7f4ec;
    text-decoration: none;
}

.intranet-nav-section a:hover {
    color: #f1b24a;
}

/* Estat obert (afegit per JS a <body>) */
.intranet-nav-open .intranet-nav {
    transform: translateX(0);
}

.intranet-nav-open .intranet-nav-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Una mica més d’aire a mòbil petit */
@media (max-width: 600px) {
    .intranet-header-inner {
        padding-inline: 1rem;
    }

    .intranet-main {
        padding-inline: 1rem;
    }
}

.intranet-header-token{
    margin-left: 10px;
    font-size: 0.85em;
    opacity: 0.85;
    white-space: nowrap;
    cursor: help;
}

.intranet-token-copy{
    margin-left: 10px;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.18);
    background: transparent;
    color: inherit;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85em;
    white-space: nowrap;
}
.intranet-token-copy:hover{
    border-color: rgba(255,255,255,0.35);
}
.intranet-token-copy{
    margin-left: 10px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.18);
    background: transparent;
    color: inherit;
    border-radius: 10px;
    cursor: pointer;
}
.intranet-token-copy:hover{
    border-color: rgba(255,255,255,0.35);
}
.intranet-token-copy i{
    font-size: 1rem;
    line-height: 1;
}

