/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Soft2B â€” GestÃ£o Documental | style.css
   Paleta oficial: #162154 (brand) Â· #013dfe Â· #4b6efa Â· #cad8fa
                   #fe4901 (warning) Â· #fff1ef Â· #a7f28e (success)
                   #373d4e Â· #9298a8 Â· #f0f1f5
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€â”€ VARIÃVEIS â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
:root {
    --brand: #162154;
    --brand-mid: #013dfe;
    --brand-light: #4b6efa;
    --brand-pale: #cad8fa;
    --brand-ghost: #eef1fb;

    --warning: #fe4901;
    --warning-bg: #fff1ef;
    --success: #a7f28e;
    --success-bg: #edfbe8;
    --bg: #f0f1f5;
    --white: #ffffff;

    --text: #373d4e;
    --muted: #9298a8;
    --border: #e8eaf0;

    --sidebar-width: 256px;
    --topnav-height: 58px;
    --radius: 10px;

    --shadow-sm: 0 2px 8px rgba(22, 33, 84, 0.07);
    --shadow-md: 0 6px 24px rgba(22, 33, 84, 0.11);
    --shadow-lg: 0 16px 48px rgba(22, 33, 84, 0.15);
}

/* --- RESET --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body,
html {
    background-color: var(--bg) !important;
}

body {
    font-family: 'DM Sans', sans-serif;
    color: var(--text);
    height: 100vh;
    display: flex;
    overflow: hidden;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    padding-top: 46px;
    /* Espaço para o cabeçalho fixo */
    background: linear-gradient(90deg, #162154 256px, var(--bg) 256px) !important;
}

/* ─── GLOBAL NAVBAR ────────────────────────────────────────────── */
.global-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 46px;
    background: #162154;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 4px 12px rgba(22, 33, 84, 0.15);
    transition: filter 0.4s ease, opacity 0.4s ease, box-shadow 0.4s ease;
}



/* Logo no header */
.navbar-logo {
    height: 52px;
    width: auto;
    object-fit: contain;
    position: absolute;
    left: 20px;
    top: -1px;
    z-index: 1000;
    /* Abaixo do backdrop do modal */
    margin-left: 17px;
}


/* User card dentro do header */
.global-navbar .user-card {
    margin: 0;
    margin-left: auto;
    /* Empurra para a direita */
    padding: 3px 8px;
    background: transparent;
    border: none;
    gap: 7px;
    margin-right: 10px;
}

.global-navbar .user-card:hover {
    background: transparent;
}

.global-navbar .user-card img {
    width: 28px;
    height: 28px;
}

.global-navbar .user-card .u-name {
    font-size: 12px;
}

.global-navbar .user-card .u-role {
    display: none;
    /* Ocultar cargo no header */
}

/* Dropdown abre para baixo e alinhado à direita */
.global-navbar .user-menu {
    left: auto;
    right: 0;
    top: calc(100% + 8px);
    width: 200px;
}

/* --- NAV PROGRESS BAR --- */
#nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 11000;
    pointer-events: none;
}

#nav-progress div {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--brand-light), var(--brand-mid), var(--brand-light));
    background-size: 200% 100%;
    transition: width 0.4s cubic-bezier(0.1, 0.7, 0.1, 1), opacity 0.3s;
    box-shadow: 0 0 10px rgba(75, 110, 250, 0.5);
    border-radius: 0 2px 2px 0;
}

body.is-navigating #nav-progress div {
    animation: nav-loading-bar 2s linear infinite, nav-gradient 1.5s linear infinite;
}

@keyframes nav-loading-bar {
    0% {
        width: 0%;
    }

    30% {
        width: 30%;
    }

    60% {
        width: 70%;
    }

    90% {
        width: 95%;
    }

    100% {
        width: 98%;
    }
}

@keyframes nav-gradient {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

#nav-progress.complete div {
    width: 100% !important;
    opacity: 0;
    transition: width 0.2s ease-in, opacity 0.4s 0.2s;
}

/* Transições de conteúdo unificadas no final do ficheiro */

.fade-out-nav {
    opacity: 0;
    pointer-events: none;
}

.fade-in-nav {
    opacity: 1;
}

/* â”€â”€â”€ APP LOADER â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--brand);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s;
}

.loader-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

#app-loader .mt-3 {
    color: rgba(255, 255, 255, 0.7) !important;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   SIDEBAR
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: var(--brand);
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    height: 100%;
    box-shadow: 4px 0 20px rgba(22, 33, 84, 0.18);
    position: relative;
    z-index: 100;
}

/*/* Garantir que modais continuam clicÃ¡veis mesmo com o fundo bloqueado */
.modal {
    pointer-events: all !important;
}

.sidebar {
    transition: filter 0.4s ease, brightness 0.4s ease;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 80px;
}

.sidebar-header img {
    max-height: 48px;
    width: auto;
    object-fit: contain;
}

/* â”€â”€â”€ USER CARD â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.user-card {
    margin: 25px 20px 4px 18px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}

.user-card:hover {
    background: rgba(255, 255, 255, 0.13);
}

.user-card img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    object-fit: cover;
}

.user-card .u-name {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.2;
    color: #ffffff;
}

.user-card .u-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    text-transform: capitalize;
}

.user-card .u-chevron {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
}

/* â”€â”€â”€ USER MENU â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.user-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    margin-top: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #1e2f6e;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow: hidden;
}

.user-menu.show {
    display: block !important;
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-menu-header {
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.user-menu-name {
    font-weight: 600;
    font-size: 13px;
    color: #ffffff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-email {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    word-break: break-all;
    line-height: 1.3;
}

.user-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    transition: background 0.2s;
    cursor: pointer;
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
}

.user-menu-item i {
    width: 16px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
}

.user-menu-item:hover i {
    color: var(--brand-pale);
}

/* â”€â”€â”€ TREE NAV â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tree-nav {
    padding: 10px 8px;
    flex: 1;
    overflow-y: auto;
}

.tree-nav::-webkit-scrollbar {
    width: 3px;
}

.tree-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.sidebar-section {
    padding: 8px 18px 4px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    transition: background .15s, color .15s;
    margin-bottom: 2px;
}

.tree-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.tree-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-weight: 600;
    border-left: 3px solid var(--brand-pale);
    padding-left: 9px;
}

.tree-item i.folder-icon {
    font-size: 13px;
    color: #fbbf24;
}

.tree-item .item-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-item .toggle-icon {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    margin-left: auto;
    transition: transform .2s;
}

.tree-item.open .toggle-icon {
    transform: rotate(90deg);
}

.tree-children {
    padding-left: 22px;
}

.tree-children .tree-children {
    padding-left: 22px;
}

.tree-children.expanded {
    max-height: 300px;
}

.tree-children .tree-item {
    font-size: 12.5px;
    padding: 6px 10px;
}

/* â”€â”€â”€ SIDEBAR ACTIONS â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sidebar-actions {
    padding: 12px 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.72);
    border: none;
    background: none;
    text-align: left;
    width: 100%;
    transition: background .15s, color .15s;
    font-family: inherit;
}

.sidebar-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.sidebar-action-btn.btn-new-folder {
    color: var(--brand-pale) !important;
}

.sidebar-action-btn.btn-upload {
    color: var(--brand-pale) !important;
}

.sidebar-action-btn.btn-manage-dept {
    color: #fbbf24 !important;
}

.sidebar-action-btn.btn-manage-users {
    color: #93c5fd !important;
}

/* â”€â”€â”€ DELETE FOLDER â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tree-item:hover .delete-folder-btn {
    opacity: 1 !important;
}

.delete-folder-btn:hover {
    color: #ff6b6b !important;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   MAIN CONTENT
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
    transition: filter 0.4s ease, brightness 0.4s ease;
}

/* â”€â”€â”€ TOP NAV â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.top-nav {
    height: var(--topnav-height);
    background: #f0f1f5;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    flex-shrink: 0;
    box-shadow: none;
    position: relative;
    z-index: 50;
}

.top-nav .upload-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, transform .15s, box-shadow .15s;
    font-family: inherit;
    box-shadow: 0 3px 10px rgba(22, 33, 84, 0.22);
}

.top-nav .upload-btn:hover {
    background: var(--brand-mid);
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(1, 61, 254, 0.28);
}

.top-nav .folder-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #ffffff;
    color: var(--text);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 7px 14px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s, background .15s;
    font-family: inherit;
    box-shadow: 0 1px 4px rgba(22, 33, 84, 0.07);
}

.top-nav .folder-btn:hover {
    border-color: var(--brand-light);
    background: var(--brand-ghost);
    color: var(--brand);
}

/* â”€â”€â”€ SEARCH BOX â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.search-box {
    position: relative;
    flex: 1;
    max-width: 440px;
}

.search-box i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 13px;
}

.search-box input {
    width: 100%;
    padding: 8px 36px 8px 38px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: #ffffff;
    font-size: 13px;
    color: var(--text);
    outline: none;
    transition: border-color .15s, background .15s;
    font-family: inherit;
    box-shadow: 0 1px 4px rgba(22, 33, 84, 0.07);
}

.search-box input:focus {
    border-color: var(--brand-light);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(75, 110, 250, 0.1);
}

.clear-search-btn {
    position: absolute;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: color .15s, transform .15s;
    z-index: 5;
}

.clear-search-btn:hover {
    color: var(--brand);
    transform: translateY(-50%) scale(1.1);
}

/* â”€â”€â”€ TOP NAV RIGHT â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.top-nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-btn {
    border: 1.5px solid var(--border);
    background: #ffffff;
    color: var(--text);
    border-radius: 8px;
    padding: 7px 13px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: border-color .15s, background .15s, color .15s;
    white-space: nowrap;
    font-family: inherit;
    box-shadow: 0 1px 4px rgba(22, 33, 84, 0.07);
}

.top-btn:hover {
    border-color: var(--brand-light);
    background: var(--brand-ghost);
    color: var(--brand);
}

.top-btn i {
    font-size: 12px;
    color: var(--muted);
}

.top-btn:hover i {
    color: var(--brand-light);
}

/* â”€â”€â”€ BREADCRUMB â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.breadcrumb-bar {
    padding: 10px 24px;
    border-bottom: 1px solid var(--border);
    background: #f0f1f5;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    flex-shrink: 0;
}

.breadcrumb-bar a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 6px;
}

.breadcrumb-bar a:hover {
    background: var(--brand-ghost);
    color: var(--brand);
}

.breadcrumb-bar .sep {
    color: var(--muted);
    opacity: 0.4;
    font-size: 12px;
}

.breadcrumb-bar .current {
    color: var(--brand);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--brand-ghost);
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--brand-pale);
}

.breadcrumb-bar .current i {
    font-size: 13px;
    color: #fbbf24;
}

.breadcrumb-bar i {
    font-size: 14px;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   WORKSPACE & DOCS PANEL
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.docs-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.table-header-bar {
    padding: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* â”€â”€â”€ TABLE SCROLL â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.table-scroll {
    flex: 1;
    overflow: auto;
}

.table-docs {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.table-docs thead th {
    background: #f0f1f5;
    color: var(--muted);
    padding: 11px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1.5px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    overflow: visible !important;
}

.table-docs .dropdown-menu {
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    z-index: 1100;
    margin-top: 10px !important;
    border: 1px solid var(--border) !important;
    overflow: visible !important;
}

.table-docs thead th:first-child {
    border-radius: 0;
}

.table-docs thead th .d-inline-flex {
    color: var(--muted);
}

.table-docs thead th .fa-chevron-down {
    display: none;
    /* Oculto por padrÃ£o, updateSortUI decide quando mostrar */
}

.table-docs tbody td {
    padding: 12px 14px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    background: var(--white);
}

.table-docs tbody tr {
    cursor: pointer;
    transition: background .1s;
}

.table-docs tbody tr:hover td {
    background: var(--brand-ghost);
}

.table-docs tbody tr.selected td {
    background: #e8edff;
    border-left: 3px solid var(--brand);
}

.table-docs tbody tr.selected td:first-child {
    padding-left: 11px;
}

/* .table-docs layout consolidado na linha 770 */

/* Larguras das colunas na Lista */
.table-docs:not(.grid-view) th:nth-child(1),
.table-docs:not(.grid-view) td:nth-child(1) {
    width: 40px;
    text-align: center;
}

.table-docs:not(.grid-view) th:nth-child(2),
.table-docs:not(.grid-view) td:nth-child(2) {
    width: 22%;
    min-width: 140px;
}

/* Nome */

.table-docs:not(.grid-view) th:nth-child(3),
.table-docs:not(.grid-view) td:nth-child(3) {
    width: 100px;
}

/* Titular */

.table-docs:not(.grid-view) th:nth-child(4),
.table-docs:not(.grid-view) td:nth-child(4) {
    width: 130px;
}

/* Depto aumentou para caber Ã­cone */

.table-docs:not(.grid-view) th:nth-child(5),
.table-docs:not(.grid-view) td:nth-child(5) {
    width: 100px;
    text-align: center;
}

/* Criado */

.table-docs:not(.grid-view) th:nth-child(6),
.table-docs:not(.grid-view) td:nth-child(6) {
    width: 115px;
    text-align: center;
}

/* Expira */

.table-docs:not(.grid-view) th:nth-child(7),
.table-docs:not(.grid-view) td:nth-child(7) {
    width: 115px;
    text-align: center;
}

/* Validade */

.table-docs:not(.grid-view) th:nth-child(8),
.table-docs:not(.grid-view) td:nth-child(8) {
    width: 145px;
}

/* AÃ§Ãµes */

.table-docs:not(.grid-view) td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Manter o redimensionamento elÃ¡stico para o nome se houver espaÃ§o */
.table-docs:not(.grid-view) .doc-name-cell {
    overflow: hidden;
}

.table-docs:not(.grid-view) .doc-name-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* â”€â”€â”€ GRID VIEW â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.table-docs.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 16px;
    align-items: start;
}

.table-docs.grid-view thead {
    display: none;
}

.table-docs.grid-view tbody {
    display: contents;
}

.table-docs.grid-view tr.grid-separator,
.table-docs.grid-view tr.grid-separator td {
    grid-column: 1 / -1;
    height: 0 !important;
    min-height: 0 !important;
    margin: -16px 0 0 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    outline: none !important;
    pointer-events: none;
}

.table-docs.grid-view tr.empty-row {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.table-docs.grid-view tr.empty-row td {
    display: block !important;
    width: 100%;
}

.table-docs.grid-view tr {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s, border-color .2s;
}

.table-docs.grid-view tr:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--brand-light);
    background: var(--white) !important;
}

.table-docs.grid-view tr:hover td {
    background: transparent !important;
}

.table-docs.grid-view tr.selected {
    border-color: var(--brand);
    background: var(--brand-ghost);
    border-left: 2px solid var(--brand);
}

.table-docs.grid-view tr.folder-row {
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    height: 60px;
}

.table-docs.grid-view tr.folder-row td {
    display: none;
}

.table-docs.grid-view tr.folder-row td:nth-child(2),
.table-docs.grid-view tr.folder-row td:last-child {
    display: flex;
    align-items: center;
}

.table-docs.grid-view tr.folder-row td:nth-child(2) {
    flex: 1;
    margin-top: 0;
    overflow: hidden;
    word-break: break-all;
}

.table-docs.grid-view tr.folder-row td:last-child {
    margin-top: 0;
    margin-left: auto;
}

.table-docs.grid-view tr.folder-row .doc-name-cell {
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.table-docs.grid-view tr.folder-row .file-icon {
    width: 42px;
    height: 42px;
    font-size: 24px;
    background: transparent !important;
}

.table-docs.grid-view td {
    padding: 4px 0;
    border: none;
}

.table-docs.grid-view .check-col {
    position: absolute;
    top: 12px;
    left: 12px;
}

.table-docs.grid-view .row-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
}

.table-docs.grid-view td:nth-child(2) {
    margin-top: 10px;
}

.table-docs.grid-view .doc-name-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.table-docs.grid-view .file-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
}

.table-docs.grid-view td:nth-child(3)::before {
    content: "Titular: ";
    color: var(--muted);
    font-size: 11px;
}

.table-docs.grid-view td:nth-child(4)::before {
    content: "Depto: ";
    color: var(--muted);
    font-size: 11px;
}

.table-docs.grid-view td:nth-child(5)::before {
    content: "Criado: ";
    color: var(--muted);
    font-size: 11px;
}

.table-docs.grid-view td:nth-child(6)::before {
    content: "Expira: ";
    color: var(--muted);
    font-size: 11px;
}

.table-docs.grid-view td:nth-child(7) {
    margin-top: 8px;
}

/* â”€â”€â”€ FOLDER ROW NESTED â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.expand-folder-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    cursor: pointer;
    font-weight: 900;
    color: #c14141;
    background: transparent;
    border: none;
    font-size: 14px;
    line-height: 1;
    transition: all 0.2s;
    user-select: none;
    position: absolute;
    top: 52%;
    left: 49%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.expand-folder-btn:hover {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.8;
}

.expand-folder-btn.expanded {
    color: #c14141;
}

.expand-folder-spacer {
    display: none;
}

.folder-row.nested {
    background-color: rgba(240, 241, 245, 0.8) !important;
}

.folder-row.nested:hover {
    background-color: var(--brand-ghost) !important;
}

.folder-row.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* â”€â”€â”€ TRANSIÃ‡Ã•ES â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.workspace,
.dashboard-grid,
.table-scroll {
    transition: opacity 0.15s ease-in-out;
}

.fade-out {
    opacity: 0;
    pointer-events: none;
}

.fade-in {
    opacity: 1;
}

/* â”€â”€â”€ DOC NAME CELL â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.doc-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

.file-icon {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.2s;
}

tr.folder-row .file-icon {
    width: 42px;
    height: 42px;
    font-size: 22px;
}

.file-icon.pdf {
    background: #fdecea;
    color: #d32f2f;
}

.file-icon.docx {
    background: #e3f0fd;
    color: #1565c0;
}

.file-icon.xlsx {
    background: #e8f5e9;
    color: #2e7d32;
}

.file-icon.other {
    background: var(--brand-ghost);
    color: var(--brand-light);
}

.doc-name-text {
    font-weight: 600;
    color: var(--brand);
    word-break: break-all;
}

.grid-view .doc-name-text {
    word-break: break-all;
}

.folder-row .doc-name-text {
    color: var(--text);
}

.doc-name-text:hover {
    text-decoration: underline;
}

/* â”€â”€â”€ BADGES â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.badge-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: capitalize;
    letter-spacing: .01em;
}

.badge-valido {
    background: #edfbe8;
    color: #2e7d32;
}

.badge-permanente {
    background: #edfbe8;
    color: #2e7d32;
}

.badge-atencao {
    background: var(--warning-bg);
    color: #c0390a;
}

.badge-expirado {
    background: #ffebee;
    color: #c62828;
}

.badge-arquivado {
    background: var(--bg);
    color: var(--muted);
}

/* â”€â”€â”€ DOC BLOQUEADO â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.doc-row.blocked {
    opacity: 0.6;
    cursor: not-allowed !important;
}

.doc-row.blocked:hover td {
    background: var(--white) !important;
}

.doc-row.blocked .doc-name-text {
    text-decoration: line-through;
    color: var(--muted) !important;
}

.doc-row.blocked .file-icon {
    background: var(--bg) !important;
    color: var(--muted) !important;
    box-shadow: none !important;
}

.badge-bloqueado {
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.doc-row.blocked .row-actions {
    display: none !important;
}

/* â”€â”€â”€ ROW ACTIONS â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.row-actions {
    display: flex;
    gap: 5px;
    align-items: center;
    opacity: 1;
    transition: opacity .15s;
}

.row-actions a,
.row-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 14px;
    padding: 5px 6px;
    border-radius: 6px;
    text-decoration: none;
    transition: background .1s, color .1s;
}

.row-actions a:hover,
.row-actions button:hover {
    background: var(--brand-ghost);
    color: var(--brand);
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   PAGINATION FOOTER
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.pg-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #ffffff;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    min-height: 52px;
    gap: 12px;
}

.pg-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.atencao-warning {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff9db;
    color: #856404;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #ffe066;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 224, 102, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(255, 224, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 224, 102, 0);
    }
}

.pg-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.pg-range {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
}

.pg-per-page-wrap {
    position: relative;
}

.pg-per-page-select {
    appearance: none;
    -webkit-appearance: none;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 4px 28px 4px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 6 5 0 10 6z' fill='%23162154'/%3E%3C/svg%3E") no-repeat right 10px center;
    cursor: pointer;
    height: 32px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pg-per-page-select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(22, 33, 84, 0.1);
}

.pg-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 4px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    color: #191717;
}

.pg-btn:hover:not(.disabled):not(.active) {
    background: var(--brand-ghost);
    border-color: var(--brand-light);
    color: var(--brand-mid);
    transform: translateY(-1px);
}



.pg-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(22, 33, 84, 0.25);
    transform: translateY(-1px);
}

.pg-btn.disabled {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
    background: #f8fafc;
}

.pg-btn i {
    font-size: 10px;
}

.pg-next-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    margin-left: 6px;
    transition: color 0.15s;
}

.pg-next-label:hover {
    color: var(--brand);
}

.pagination-info,
.pagination-controls {
    display: none !important;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   DETAIL PANEL
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.detail-panel {
    width: 310px;
    flex-shrink: 0;
    background: var(--white);
    border-left: 1.5px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: width .2s;
}

.detail-panel.hidden {
    width: 0;
    overflow: hidden;
}

.detail-header {
    padding: 16px 18px 12px;
    background: #f0f1f5;
    border-bottom: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.detail-header h6 {
    font-weight: 700;
    font-size: 14px;
    margin: 0;
    color: var(--brand);
}

.close-detail {
    background: var(--border);
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 15px;
    padding: 4px 7px;
    border-radius: 6px;
    transition: background .15s, color .15s;
}

.close-detail:hover {
    background: var(--brand-pale);
    color: var(--brand);
}

.doc-preview {
    margin: 16px 18px;
    background: var(--bg);
    border-radius: 8px;
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1.5px solid var(--border);
    position: relative;
}

.doc-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.doc-preview iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.doc-preview .no-preview {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.doc-preview .no-preview i {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: 10px;
    display: block;
}

.doc-preview .no-preview small {
    font-size: 11px;
    display: block;
    margin-top: 5px;
}

.preview-eye {
    position: absolute;
    top: 15px;
    right: 22px;
    font-size: 16px;
    color: var(--brand);
    background: rgba(255, 255, 255, 0.85);
    padding: 6px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: background .15s, transform .15s;
}

.preview-eye:hover {
    background: #fff;
    transform: scale(1.1);
}

.doc-preview pre {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    font-family: monospace;
    font-size: 11px;
    line-height: 1.4;
}

.detail-title {
    padding: 0 18px 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--brand);
    word-break: break-all;
}

.detail-info {
    padding: 0 18px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--bg);
    font-size: 13px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--muted);
    font-weight: 500;
}

.info-val {
    font-weight: 600;
    text-align: right;
    max-width: 160px;
    word-break: break-word;
    color: var(--brand);
}

.detail-tags {
    padding: 12px 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 700;
    background: var(--success-bg);
    color: #2e7d32;
}

.tag.tag-blue {
    background: var(--brand-ghost);
    color: var(--brand);
}

.detail-actions {
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
    border-top: 1px solid var(--border);
}

.detail-btn {
    height: 38px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    text-decoration: none;
    border: 1.5px solid var(--border);
    padding: 0 10px;
    font-family: inherit;
}

.btn-row-1 {
    flex: 1 1 calc(33.33% - 10px);
    min-width: 100px;
}

.btn-row-2 {
    flex: 1 1 calc(50% - 10px);
    min-width: 120px;
}

.detail-btn.primary {
    background: var(--brand);
    color: #fff;
    border: none;
    box-shadow: 0 3px 10px rgba(22, 33, 84, 0.2);
}

.detail-btn.primary:hover {
    background: var(--brand-mid);
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(1, 61, 254, 0.25);
}

.detail-btn.secondary {
    background: var(--white);
    color: var(--text);
    border: 1.5px solid var(--border);
}

.detail-btn.secondary:hover {
    background: var(--brand-ghost);
    border-color: var(--brand-pale);
    color: var(--brand);
    transform: translateY(-1px);
}

.detail-btn i {
    font-size: 15px;
}

.modal-footer .btn-danger {
    border: none;
}

.modal-footer .btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

#confirmModal .modal-body i,
#promptModal .modal-body i {
    color: #f59e0b;
}

.form-control:focus {
    border-color: var(--brand-light);
    box-shadow: 0 0 0 3px rgba(75, 110, 250, 0.1);
}

.form-select:focus {
    border-color: var(--brand-light);
    box-shadow: 0 0 0 3px rgba(75, 110, 250, 0.1);
}

/* â”€â”€â”€ SCROLLBAR â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* â”€â”€â”€ CONTEXT MENU â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.context-menu {
    position: fixed;
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 99999;
    min-width: 180px;
    overflow: hidden;
    display: none;
    animation: fadeIn 0.15s ease;
    border: 1px solid var(--border);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}

.context-menu-item:hover {
    background: var(--brand-ghost);
    color: var(--brand);
}

.context-menu-item i {
    width: 18px;
    font-size: 13px;
    color: var(--muted);
}

.context-menu-item:hover i {
    color: var(--brand-light);
}

.context-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.context-menu-danger {
    color: var(--warning);
}

.context-menu-danger:hover {
    background: var(--warning-bg);
    color: var(--warning);
}

.context-menu-danger:hover i {
    color: var(--warning);
}

/* â”€â”€â”€ PAINEL DE SECÃ‡ÃƒO (Drag & Drop / Lote) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.dd-section-panel {
    border: 1.5px solid var(--brand-pale);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 4px;
    box-shadow: 0 2px 8px rgba(22, 33, 84, 0.06);
}

.dd-section-header {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
    color: #ffffff;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dd-section-badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.9);
    font-size: 10px;
    font-weight: 500;
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dd-section-body {
    padding: 16px;
    background: #f8faff;
}

/* â”€â”€â”€ WIZARD DE PASSOS (Modal Upload) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.upload-wizard-steps {
    display: flex;
    align-items: center;
    padding: 18px 24px;
    background: var(--brand);
    border-bottom: none;
    border-radius: 14px 14px 0 0;
    gap: 0;
    position: relative;
}

.upload-step {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: default;
    transition: all 0.3s ease;
    z-index: 2;
}

.upload-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.upload-step-label {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    white-space: nowrap;
    transition: all 0.3s ease;
}

.upload-step.active .upload-step-circle {
    background: #ffffff;
    border-color: #ffffff;
    color: var(--brand);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.upload-step.active .upload-step-label {
    color: #ffffff;
    font-weight: 700;
}

.upload-step.completed .upload-step-circle {
    background: var(--brand-light);
    border-color: var(--brand-light);
    color: #ffffff;
}

.upload-step.completed .upload-step-circle::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
}

.upload-step.completed .upload-step-circle span {
    display: none;
}

.upload-step.completed .upload-step-label {
    color: rgba(255, 255, 255, 0.9);
}

.upload-step-line {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 20px;
    border-radius: 2px;
    position: relative;
}

/* BotÃ£o fechar no wizard */
.upload-wizard-close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    z-index: 10;
    padding: 5px;
}

.upload-wizard-close:hover {
    color: #ffffff;
    transform: scale(1.15);
}

/* --- FIM DO FICHEIRO --- */


.user-card-info {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.user-card-name {
    display: block;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card-dept {
    display: block;
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: white;
}

.user-card-item.selected .user-card-checkbox {
    background: var(--brand-mid);
    border-color: var(--brand-mid);
}

.user-card-item.selected .user-card-checkbox::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: white;
    font-size: 10px;
}

.user-card-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.user-selection-toolbar {
    background: var(--brand-ghost);
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.user-selection-toolbar .form-select-sm,
.user-selection-toolbar .form-control-sm {
    border-radius: 8px;
    border: 1px solid rgba(22, 33, 84, 0.1);
}


/* --- FIDELITY USER SELECTION DESIGN (IMAGE MATCH) ------- */
.premium-selection-box {
    border: 1px solid #dbe9fe;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.04);
}

.premium-selection-header {
    background: #0047ff;
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.premium-selection-header h6 {
    margin: 0;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.premium-selection-badge {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.premium-selection-body {
    padding: 20px;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    display: block;
}

.premium-filter-input {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    transition: all 0.2s;
    background: #fff;
}

.premium-filter-input:focus {
    border-color: #0047ff;
    box-shadow: 0 0 0 3px rgba(0, 71, 255, 0.1);
    outline: none;
}

.premium-user-list {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 8px;
    margin-top: 20px;
    max-height: 250px;
    overflow-y: auto;
}

.premium-user-row {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.premium-user-row:hover {
    border-color: #0047ff;
    background: #f0f7ff;
}

.premium-user-row.selected {
    border-color: #0047ff;
    background: #eff6ff;
}

.premium-user-row .form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}

.premium-user-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
}

.premium-info-footer {
    padding: 12px 20px;
    border-top: 1px dashed #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
}

.premium-info-footer i {
    color: #0047ff;
}

/* User Selection Items (Boxes) */
.user-selection-item {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.user-selection-item:hover {
    border-color: var(--brand-light);
    background: #f8faff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 33, 84, 0.05);
}

.user-selection-item.selected {
    border-color: var(--brand-mid);
    background: var(--brand-ghost);
    box-shadow: 0 4px 15px rgba(1, 61, 254, 0.1);
}

.user-selection-item .form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    border: 2px solid #cbd5e1;
}

.user-selection-item .form-check-input:checked {
    background-color: var(--brand-mid);
    border-color: var(--brand-mid);
}

.user-selection-item .user-avatar-small {
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    color: var(--brand);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.user-selection-item .user-info {
    flex: 1;
    min-width: 0;
}

.user-selection-item .user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    display: block;
    white-space: nowrap;
}


/* --- FIDELITY USER SELECTION DESIGN (IMAGE MATCH) ------- */
.premium-selection-box {
    border: 1px solid #dbe9fe;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.04);
}

.premium-selection-header {
    background: #0047ff;
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.premium-selection-header h6 {
    margin: 0;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.premium-selection-badge {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.premium-selection-body {
    padding: 20px;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    display: block;
}

.premium-filter-input {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    transition: all 0.2s;
    background: #fff;
}

.premium-filter-input:focus {
    border-color: #0047ff;
    box-shadow: 0 0 0 3px rgba(0, 71, 255, 0.1);
    outline: none;
}

.premium-user-list {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 8px;
    margin-top: 20px;
    max-height: 250px;
    overflow-y: auto;
}

.premium-user-row {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.premium-user-row:hover {
    border-color: #0047ff;
    background: #f0f7ff;
}

.premium-user-row.selected {
    border-color: #0047ff;
    background: #eff6ff;
}

.premium-user-row .form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}

.premium-user-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
}

.premium-info-footer {
    padding: 12px 20px;
    border-top: 1px dashed #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
}

.premium-info-footer i {
    color: #0047ff;
}

/* User Selection Items (Boxes) */
.user-selection-item {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.user-selection-item:hover {
    border-color: var(--brand-light);
    background: #f8faff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 33, 84, 0.05);
}

.user-selection-item.selected {
    border-color: var(--brand-mid);
    background: var(--brand-ghost);
    box-shadow: 0 4px 15px rgba(1, 61, 254, 0.1);
}

.user-selection-item .form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    border: 2px solid #cbd5e1;
}

.user-selection-item .form-check-input:checked {
    background-color: var(--brand-mid);
    border-color: var(--brand-mid);
}

.user-selection-item .user-avatar-small {
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    color: var(--brand);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.user-selection-item .user-info {
    flex: 1;
    min-width: 0;
}

.user-selection-item .user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.user-selection-item .user-dept {
    display: none !important;
}

/* Custom Scrollbar para Lista de Utilizadores */
.user-list-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.user-list-container::-webkit-scrollbar-track {
    background: transparent;
}

.user-list-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.user-list-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* â”€â”€â”€ MODALS PREMIUM REDESIGN â”€â”€â”€ */
.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(22, 33, 84, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    background: linear-gradient(145deg, #ffffff, #f8faff);
    overflow: hidden;
}

.modal-header {
    background: transparent;
    border-bottom: 1px solid rgba(22, 33, 84, 0.06);
    padding: 24px 28px 16px;
}

.modal-header .modal-title {
    font-weight: 800;
    font-size: 18px;
    color: var(--brand);
    /* Usando a cor de marca (azul marinho) */
    display: flex;
    align-items: center;
}

/* Os icones originais nos titulos perdem as classes text-warning, porque este overwrite cuida deles */
.modal-header .modal-title i {
    background: var(--brand-ghost);
    padding: 10px;
    border-radius: 12px;
    margin-right: 14px !important;
    font-size: 16px;
    color: var(--brand-light);
}

.modal-header .btn-close {
    background-color: var(--bg);
    border-radius: 50%;
    padding: 12px;
    opacity: 0.7;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.modal-header .btn-close:hover {
    opacity: 1;
    background-color: var(--brand-ghost);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px 28px;
}

.modal-footer {
    border-top: none;
    background: #f8fafc;
    padding: 20px 28px;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    position: relative;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.01) inset;
}

.modal-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 28px;
    right: 28px;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(22, 33, 84, 0.08), transparent);
}

.modal-footer .btn {
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-footer .btn-secondary {
    background: #ffffff;
    border: 1.5px solid var(--border);
    color: var(--text);
}

.modal-footer .btn-secondary:hover {
    background: var(--bg);
    border-color: #cbd5e1;
}

.modal-footer .btn-primary {
    background: var(--brand);
    border: none;
    box-shadow: 0 4px 14px rgba(22, 33, 84, 0.25);
    color: white;
}

.modal-footer .btn-primary:hover {
    background: var(--brand-mid);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(1, 61, 254, 0.3);
}

/* â”€â”€â”€ MODERN TREE VIEW DEPARTMENTS â”€â”€â”€ */
.modern-tree-selection {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    max-height: 200px !important;
    overflow-y: auto;
}

.tree-dept-group {
    display: flex;
    flex-direction: column;
}

.tree-dept-header {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    font-weight: 600;
    color: var(--brand);
}

.tree-dept-header:hover {
    background: #f1f5f9;
}

.tree-dept-header .chevron {
    margin-left: auto;
    font-size: 11px;
    color: var(--muted);
    transition: transform 0.2s;
}

.tree-dept-header.open .chevron {
    transform: rotate(180deg);
}

.tree-users-list {
    display: flex;
    flex-direction: column;
    margin-left: 20px;
    padding-left: 12px;
    border-left: 2px solid #e2e8f0;
    margin-top: 4px;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.tree-users-list.collapsed {
    max-height: 0 !important;
    opacity: 0;
    margin-top: 0;
}

.tree-user-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 6px;
    position: relative;
}

.tree-user-item:hover {
    background: #f8fafc;
}


/* ��� MODERN TREE SELECTION (Design Fiel � Imagem) ����������������� */
.dd-section-panel {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #ffffff;
}

.dd-section-header {
    background: #162154;
    color: #ffffff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 15px;
}

.badge-opcional {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 50px;
    padding: 3px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dd-section-body {
    background: #f8fafc;
    padding: 20px;
}

.modern-tree-selection {
    max-height: 200px !important;
    overflow-y: auto;
    padding: 5px;
}

/* Estilo Card para os Departamentos */
.tree-dept-group.card-style {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.tree-dept-group.card-style:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.tree-dept-group.card-style .tree-dept-header {
    background: transparent;
    padding: 14px 20px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
}

.tree-dept-icon {
    color: #3b82f6;
    /* Azul Folder */
    font-size: 18px;
}

.tree-dept-group.card-style .dept-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    border-color: #cbd5e1;
}

.tree-dept-group.card-style .tree-toggle {
    font-size: 14px;
    color: #94a3b8;
    margin-left: 10px;
    transition: transform 0.2s;
}

.tree-dept-group.card-style.collapsed .tree-toggle {
    transform: rotate(0deg);
}

/* Quando expandido, a seta pode girar ou mudar (neste caso optei por chevron-right/down via JS) */

.tree-dept-content {
    padding: 0 20px 15px 45px;
    display: block;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, opacity 0.2s;
}

.tree-dept-group.collapsed .tree-dept-content {
    max-height: 0;
    opacity: 0;
    padding-bottom: 0;
    pointer-events: none;
}

.tree-user-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    margin-bottom: 4px;
}

.tree-user-item:hover {
    background: #f1f5f9;
}

.tree-user-item.selected {
    background: #e0e7ff;
    color: var(--brand);
}

.dd-footer-info {
    font-size: 12.5px;
    color: #64748b;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
}

/* Scrollbar Custom */
.modern-tree-selection::-webkit-scrollbar {
    width: 6px;
}

.modern-tree-selection::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.modern-tree-selection::-webkit-scrollbar-track {
    background: transparent;
}

.tree-dept-group.collapsed .tree-dept-content {
    max-height: 0;
    opacity: 0;
    padding-bottom: 0;
    pointer-events: none;
}

.tree-dept-group.card-style.collapsed .tree-toggle {
    transform: rotate(0deg);
}



/* === MODAL OVERLAY - Escurece TODO o fundo uniformemente === */
/* O ::before existe sempre, mas com opacity 0 por defeito */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1045;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.7s ease;
    /* Saída lenta (0.7s) */
}

/* Quando modal está ativo: fade in rápido + bloqueio de cliques */
body.modal-active-blur::before {
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.3s ease;
    /* Entrada rápida (0.3s) */
}

body.modal-active-blur .global-navbar,
body.modal-active-blur .sidebar,
body.modal-active-blur .main-content {
    pointer-events: none;
}