/* Navegació superior: només afecta el capçal de l'aplicació. */
.timhr-header {
    --header-text: #24354d;
    --header-muted: #64758e;
    --header-border: #e1e8f2;
    --header-soft: #f3f7fc;
    --header-accent: #1768b5;
    background: linear-gradient(120deg, #ffffff 0%, #f8fbff 100%);
    border-bottom: 1px solid var(--header-border);
    box-shadow: 0 8px 28px rgba(35, 67, 104, .08);
}

.timhr-header .navbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 18px;
    min-height: 74px;
    padding: 0 22px;
}

/* El capçal és fix. Pot haver-hi modals o estils d'ajuda entre el capçal i el contingut. */
.timhr-header ~ .main-content > .contents {
    padding-top: calc(var(--timhr-header-height, 74px) + 16px);
}

.timhr-header ~ .main-content .dashboard-admin-light .admin-quick-nav {
    top: calc(var(--timhr-header-height, 74px) + 16px);
    max-height: calc(100vh - var(--timhr-header-height, 74px) - 30px);
}

.timhr-header .navbar-left {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.timhr-header .sidebar-toggle {
    flex: 0 0 42px;
    margin: 0;
    border-color: var(--header-border);
    background: #fff;
    box-shadow: none;
}

.timhr-header .sidebar-toggle:hover,
.timhr-header .sidebar-toggle:focus-visible {
    background: var(--header-soft);
    border-color: #afc8e5;
    box-shadow: 0 4px 12px rgba(30, 80, 135, .1);
}

.timhr-header .timhr-brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    color: var(--header-text);
    text-decoration: none;
}

.timhr-header .timhr-brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 13px;
    box-shadow: 0 3px 10px rgba(226, 109, 40, .12);
}

.timhr-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    white-space: nowrap;
}

.timhr-brand__text strong {
    color: var(--header-text);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.timhr-brand__text small {
    margin-top: 3px;
    color: var(--header-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.timhr-header .top-menu {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-color: #c6d7e9 transparent;
    scrollbar-width: thin;
}

.timhr-header .admin-top-shortcuts .admin-top-shortcuts__list {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
    width: max-content;
    min-width: 100%;
    padding: 8px 1px;
}

.timhr-header .strikingDash-top-menu .admin-top-shortcuts__list > li,
.timhr-header .strikingDash-top-menu .admin-top-shortcuts__list > li:not(:last-child) {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
}

.timhr-header .admin-top-shortcuts .admin-top-shortcuts__list > li > a {
    min-height: 37px;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    color: #526781 !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.timhr-header .admin-top-shortcuts .admin-top-shortcuts__list > li > a:hover,
.timhr-header .admin-top-shortcuts .admin-top-shortcuts__list > li > a:focus-visible {
    transform: none;
    background: #edf4fb;
    border-color: #d8e6f5;
    box-shadow: none;
    color: #165b9c !important;
}

.timhr-header .admin-top-shortcuts .admin-top-shortcuts__list > li > a.active {
    background: #e7f1fc;
    border-color: #c9def5;
    box-shadow: inset 0 0 0 1px rgba(28, 104, 181, .04);
    color: #145894 !important;
}

.timhr-header .admin-top-shortcuts .admin-top-shortcuts__list > li > a svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    margin-right: 7px;
    stroke-width: 2;
}

.timhr-header .strikingDash-top-menu > ul > li a.active:before {
    display: none;
}

.timhr-header .navbar-right {
    flex: 0 0 auto;
}

.timhr-header .navbar-right__menu {
    gap: 5px;
    margin: 0;
}

.timhr-header .navbar-right__menu > li {
    padding: 0;
}

.timhr-header .navbar-right__menu > li.nav-author {
    margin-left: 7px;
    padding-left: 12px;
    border-left: 1px solid var(--header-border);
}

.timhr-header .navbar-right__menu .nav-item-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--header-border);
    border-radius: 11px;
    background: #fff;
    color: var(--header-muted);
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.timhr-header .navbar-right__menu .nav-item-toggle:hover,
.timhr-header .navbar-right__menu .nav-item-toggle:focus-visible {
    background: #edf4fb;
    border-color: #bdd5ed;
    color: var(--header-accent);
    box-shadow: none;
    outline: none;
}

.timhr-header .navbar-right__menu .nav-item-toggle:focus-visible,
.timhr-header .admin-top-shortcuts a:focus-visible,
.timhr-header .top-menu:focus-visible,
.timhr-header .timhr-brand:focus-visible,
.timhr-header .sidebar-toggle:focus-visible {
    outline: 2px solid #6aaceb;
    outline-offset: 2px;
}

.timhr-header .navbar-right__menu .nav-item-toggle:before {
    display: none;
}

.timhr-header .notification-trigger #notificacions_numero {
    top: -7px;
    right: -7px;
    border: 2px solid #fff;
}

.timhr-header .navbar-right__menu .timhr-user-trigger {
    gap: 8px;
    width: auto;
    min-width: 40px;
    padding: 0 9px 0 4px;
    text-decoration: none;
}

.timhr-user-trigger__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px !important;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, #1c76c5, #144b8a);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.timhr-header .navbar-right__menu .timhr-user-trigger__name {
    width: auto;
    max-width: 150px;
    overflow: hidden;
    color: var(--header-text);
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timhr-header .navbar-right__menu .timhr-user-trigger__chevron {
    width: 14px;
    height: 14px;
    color: var(--header-muted);
}

.timhr-header .dropdown-custom:focus-within .dropdown-wrapper {
    visibility: visible;
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
}

.timhr-header .nav-author .dropdown-wrapper {
    border: 1px solid var(--header-border);
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(25, 58, 98, .15);
    overflow: hidden;
}

@media (max-width: 1199px) {
    .timhr-header .navbar { gap: 11px; padding: 0 14px; }
    .timhr-brand__text,
    .timhr-user-trigger__name,
    .timhr-header .navbar-right__menu .timhr-user-trigger__chevron { display: none; }
    .timhr-header .navbar-right__menu .timhr-user-trigger { padding: 0 4px; }
    .timhr-header ~ .main-content .dashboard-admin-light .admin-quick-nav {
        max-height: none;
    }
}

@media (max-width: 991px) {
    .timhr-header .top-menu { display: none; }
    .timhr-header .navbar-left { flex: 0 1 auto; }
    .timhr-header .navbar { justify-content: space-between; }
}

@media (max-width: 767px) {
    .timhr-header .navbar { min-height: 56px; padding: 0 14px; }
    .timhr-header ~ .main-content > .contents { padding-top: calc(var(--timhr-header-height, 56px) + 16px); }
    .timhr-header .timhr-brand img { width: 36px; height: 36px; border-radius: 10px; }
    .timhr-header .sidebar-toggle { width: 38px; height: 38px; flex-basis: 38px; }
    .timhr-header .navbar-right__mobileAction a { padding: 8px; border-radius: 10px; color: #526781; }
    .mobile-author-actions .navbar-right__menu { gap: 8px; }
    .mobile-author-actions .navbar-right__menu > li { padding: 0; }
    .mobile-author-actions .navbar-right__menu > li .dropdown-custom { padding: 0; }
    .mobile-author-actions .navbar-right__menu .nav-item-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        height: 40px;
        padding: 0 5px;
        border: 1px solid #e1e8f2;
        border-radius: 11px;
        background: #fff;
        color: #64758e;
    }
    .mobile-author-actions .navbar-right__menu .timhr-user-trigger__name,
    .mobile-author-actions .navbar-right__menu .timhr-user-trigger__chevron { display: none; }
    .mobile-author-actions .navbar-right__menu .notification-trigger #notificacions_numero {
        top: -7px;
        right: -7px;
    }
}

.layout-dark .timhr-header {
    --header-text: #f0f5ff;
    --header-muted: #b8c7dc;
    --header-border: #414c67;
    --header-soft: #303b57;
    --header-accent: #a9d4ff;
    background: #222b40;
}

.layout-dark .timhr-header .sidebar-toggle,
.layout-dark .timhr-header .navbar-right__menu .nav-item-toggle {
    background: #2b3650;
}

.layout-dark .timhr-header .admin-top-shortcuts .admin-top-shortcuts__list > li > a {
    color: #c4d2e5 !important;
}

.layout-dark .timhr-header .admin-top-shortcuts .admin-top-shortcuts__list > li > a:hover,
.layout-dark .timhr-header .admin-top-shortcuts .admin-top-shortcuts__list > li > a.active {
    background: #344b68;
    border-color: #4c6a8e;
    color: #fff !important;
}
