﻿body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    width: 100% !important;
}

    body.modal-open {
        overflow: hidden;
    }

/* Estilos da Sidebar */
.sidebar {
    width: 280px; /* Largura padrão expandida */
    background-color: #1f1f23; /* Fundo mais escuro */
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.4);
    position: fixed;
    height: 100vh;
    top: 0;
    left: 0;
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transform: translateX(0); /* Visível por padrão em desktop */
    transition: transform 0.3s ease-in-out, width 0.3s ease-in-out;
    z-index: 50;
}
    /* Estado colapsado da sidebar */
    .sidebar.collapsed {
        width: 85px; /* Largura quando colapsada (apenas ícones) */
        overflow: hidden; /* Esconde conteúdo que extrapola */
    }
    /* Estado para esconder completamente no mobile */
    .sidebar.hidden-mobile {
        transform: translateX(-100%);
    }
    /* Estado para mostrar a sidebar no mobile (quando ativa) */
    .sidebar.active {
        transform: translateX(0) !important;
    }

    /* Logo/Título da Sidebar */
    .sidebar .logo-container {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        height: 48px;
        margin-bottom: 2rem;
        overflow: hidden;
        transition: all 0.3s ease-in-out;
        position: relative;
    }

    .sidebar.collapsed .logo-container {
        justify-content: center;
        padding-right: 0;
    }

    .sidebar .logo-text {
        white-space: nowrap;
        opacity: 1;
        transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    }

    .sidebar.collapsed .logo-text {
        opacity: 0;
        transform: translateX(-100%);
        position: absolute;
        left: 50%;
    }

    .sidebar .logo-container .bg-[#22c55e] {
        flex-shrink: 0;
    }

    /* User Info no Topo da Sidebar (separado do logout) */
    .sidebar .user-info-top {
        display: flex;
        align-items: center;
        padding: 0.75rem 1rem;
        border-radius: 0.5rem;
        margin-bottom: 1rem; /* Espaço após o user info */
        border: 1px solid transparent;
        transition: background-color 0.2s, border-color 0.2s;
        overflow: hidden;
        flex-shrink: 0; /* Impede que ele encolha */
    }

        .sidebar .user-info-top:hover {
            background-color: #2e2e33;
            border-color: #3a3a3a;
        }

    .sidebar .user-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background-color: #60a5fa; /* Cor de avatar padrão */
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.875rem; /* text-sm */
        font-weight: 600;
        color: #fff;
        flex-shrink: 0;
    }

    .sidebar .user-details-top {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-left: 0.75rem;
        opacity: 1;
        transition: opacity 0.3s ease-in-out, margin-left 0.3s ease-in-out;
    }

        .sidebar .user-details-top .user-name {
            font-weight: 600;
            color: #e0e0e0;
        }

        .sidebar .user-details-top .user-email {
            font-size: 0.75rem; /* text-xs */
            color: #9ca3af; /* gray-400 */
        }
    /* Sidebar Colapsada - User Info no Topo */
    .sidebar.collapsed .user-info-top {
        justify-content: center; /* Centraliza o avatar */
        padding: 0.75rem; /* Padding menor */
        width: 50px; /* Largura do avatar + padding */
        margin-right: auto; /* Garante centralização visual */
        margin-left: auto;
        border-color: transparent; /* Remove borda */
    }

    .sidebar.collapsed .user-details-top {
        opacity: 0;
        margin-left: 0;
        width: 0;
        visibility: hidden;
    }
    /* Tooltip para user-info-top colapsado */
    .sidebar.collapsed .user-info-top .tooltip-text {
        visibility: hidden;
        width: max-content;
        background-color: #555;
        color: #fff;
        text-align: center;
        border-radius: 6px;
        padding: 5px 10px;
        position: absolute;
        z-index: 9999;
        left: calc(100% + 10px); /* Posiciona à direita do ícone */
        top: 50%;
        transform: translateY(-50%);
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .sidebar.collapsed .user-info-top:hover .tooltip-text {
        visibility: visible;
        opacity: 1;
    }

    .sidebar.collapsed .user-info-top .tooltip-text::after {
        content: "";
        position: absolute;
        top: 50%;
        right: 100%;
        margin-top: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: transparent #555 transparent transparent;
    }

    /* Itens de Navegação da Sidebar */
    .sidebar a {
        display: flex;
        align-items: center;
        padding: 0.75rem 1rem;
        border-radius: 0.5rem;
        color: #b0b0b0;
        text-decoration: none;
        transition: background-color 0.2s, color 0.2s;
        font-weight: 500;
        position: relative; /* Para o tooltip */
    }

        .sidebar a:hover {
            background-color: #2e2e33;
            color: #e0e0e0;
        }

        .sidebar a.active {
            background-color: #22c55e;
            color: #0e0e10;
            font-weight: 600;
        }

            .sidebar a.active svg {
                color: #0e0e10;
            }

        .sidebar a .link-text {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-left: 0.75rem;
            opacity: 1; /* Visível por padrão */
            transition: opacity 0.3s ease-in-out, margin-left 0.3s ease-in-out;
        }
    /* Quando a sidebar está colapsada, o texto do link some */
    .sidebar.collapsed a .link-text {
        opacity: 0;
        margin-left: 0;
        width: 0;
        visibility: hidden;
    }

    .sidebar a svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        color: #b0b0b0;
        transition: color 0.2s;
    }
    /* Tooltip para sidebar colapsada */
    .sidebar a .tooltip-text {
        visibility: hidden;
        opacity: 0;
        width: max-content;
        background-color: #555;
        color: #fff;
        text-align: center;
        border-radius: 6px;
        padding: 5px 10px;
        position: absolute;
        z-index: 100;
        left: calc(100% + 10px);
        top: 50%;
        transform: translateY(-50%);
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .sidebar.collapsed a:hover .tooltip-text {
        visibility: visible;
        opacity: 1;
    }

    .sidebar.collapsed a .tooltip-text::after {
        content: "";
        position: absolute;
        top: 50%;
        right: 100%;
        margin-top: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: transparent #555 transparent transparent;
        z-index: 9999 !important;
    }

    /* Botão Sair no Bottom da Sidebar */
    .sidebar .logout-button-bottom {
        margin-top: auto; /* Empurra para o final da sidebar */
        padding-top: 1rem; /* Espaço antes do botão */
        border-top: 1px solid #2e2e33; /* Separador */
    }

        .sidebar .logout-button-bottom a {
            width: 100%;
            justify-content: flex-start; /* Alinha o conteúdo à esquerda */
        }
    /* Sidebar Colapsada - Botão Sair */
    .sidebar.collapsed .logout-button-bottom {
        padding-top: 0.5rem; /* Ajuste o padding no colapsado */
        border-top: none; /* Remove a borda no modo colapsado */
        margin-right: auto; /* Centraliza o ícone */
        margin-left: auto;
        width: 50px; /* Largura para o ícone + padding */
        text-align: center;
    }

        .sidebar.collapsed .logout-button-bottom a {
            padding: 0.75rem; /* Padding menor */
            justify-content: center; /* Centraliza o ícone */
        }


/* Conteúdo Principal e Ajuste de Margem (mantidos) */
.main-content-wrapper {
    flex-grow: 1;
    margin-left: 280px;
    transition: margin-left 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

    .main-content-wrapper.collapsed-sidebar {
        margin-left: 70px;
    }

/* Header no topo do conteúdo principal (mantido) */
.content-header {
    background-color: #0e0e10;
    padding: 1rem 2rem;
    border-bottom: 1px solid #1f1f23;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 40;
    position: sticky;
    top: 0;
}

.user-greeting {
    color: #e0e0e0;
    font-weight: 500;
    margin-right: 1rem;
    white-space: nowrap;
}

    .user-greeting .text-gray-400 {
        font-size: 0.875rem;
    }

/* Overlay para mobile (mantido) */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 45;
    display: none;
}

    .overlay.visible {
        display: block;
    }

/* Ajustes Responsivos */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
    }

        .sidebar.active {
            transform: translateX(0) !important;
        }

    .main-content-wrapper {
        margin-left: 0;
    }

        .main-content-wrapper.collapsed-sidebar {
            margin-left: 0;
        }

    .header-desktop-toggle {
        display: none;
    }

    .header-mobile-toggle {
        display: flex;
    }
    /* Em mobile, o tooltip-text nunca deve aparecer */
    .sidebar a .tooltip-text,
    .sidebar .user-info-top .tooltip-text, /* Ajustado */
    .sidebar .logout-button-bottom a .tooltip-text { /* Ajustado */
        display: none;
    }

    .sidebar .logo-text,
    .sidebar .user-details-top { /* Ajustado */
        opacity: 1;
        transform: translateX(0);
        position: static;
    }

    .sidebar .logo-container {
        justify-content: flex-start;
    }

    .sidebar .user-info-top { /* Em mobile, sempre expandido se a sidebar estiver aberta */
        justify-content: flex-start;
        padding: 0.75rem 1rem;
        width: auto;
        margin-left: 0;
        margin-right: 0;
        border-color: transparent;
    }

    .sidebar .user-avatar {
        margin-right: 0.75rem;
    }

    .sidebar .logout-button-bottom { /* Em mobile, o botão sair sempre expandido se sidebar aberta */
        width: 100%;
        margin: auto auto 0; /* Força o botão para o final */
        border-top: 1px solid #2e2e33;
        padding-top: 1rem;
    }

        .sidebar .logout-button-bottom a {
            justify-content: flex-start;
            padding: 0.75rem 1rem;
        }
}

@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0) !important;
    }

        .sidebar.active {
            width: 280px;
        }

        .sidebar.collapsed {
            width: 85px;
        }

    .main-content-wrapper {
        margin-left: 280px;
    }

        .main-content-wrapper.collapsed-sidebar {
            margin-left: 90px;
        }

    .header-desktop-toggle {
        display: flex;
    }

    .header-mobile-toggle {
        display: none;
    }
    /* Garante visibilidade dos textos quando não colapsada no desktop */
    .sidebar:not(.collapsed) .link-text,
    .sidebar:not(.collapsed) .logo-text,
    .sidebar:not(.collapsed) .user-details-top { /* Ajustado */
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
        position: static;
        width: auto;
    }

    .sidebar:not(.collapsed) .link-text,
    .sidebar:not(.collapsed) .user-details-top { /* Ajusta margens seletivamente */
        margin-left: 0.75rem;
    }

    .sidebar.collapsed .link-text,
    .sidebar.collapsed .logo-text,
    .sidebar.collapsed .user-details-top { /* Ajustado */
        opacity: 0;
        visibility: hidden;
        width: 0;
        margin: 0;
        position: absolute;
    }

    .sidebar.collapsed .logo-text {
        transform: translateX(-100%);
        left: 50%;
    }

    .sidebar.collapsed .user-details-top {
        transform: translateX(-100%);
        left: 50%;
    }

    .sidebar.collapsed .logo-container,
    .sidebar.collapsed .user-info-top { /* Ajustado */
        justify-content: center;
        padding-right: 0;
        padding-left: 0;
    }

    .sidebar.collapsed .user-info-top {
        width: 50px;
        padding: 0.75rem;
        margin-right: auto;
        margin-left: auto;
        border-color: transparent;
    }

    /* Em desktop, o tooltip-text deve estar escondido quando a sidebar está expandida */
    .sidebar:not(.collapsed) a .tooltip-text,
    .sidebar:not(.collapsed) .user-info-top .tooltip-text, /* Ajustado */
    .sidebar:not(.collapsed) .logout-button-bottom a .tooltip-text { /* Ajustado */
        display: none;
    }
    /* Botão Sair no bottom da sidebar colapsada */
    .sidebar.collapsed .logout-button-bottom {
        margin-top: auto; /* Empurra para o final */
        padding-top: 0.5rem;
        border-top: none; /* Remove a borda */
        width: 50px; /* Largura para o ícone */
        margin-left: auto;
        margin-right: auto;
    }

        .sidebar.collapsed .logout-button-bottom a {
            justify-content: center; /* Centraliza o ícone */
            padding: 0.75rem;
        }
}
/* Estilos de utilidade (mantidos) */
.metric-card {
    background-color: rgba(9, 9, 11, 0.5);
    border-radius: 0.5rem;
    padding: 1.5rem;
    border: 1px solid #2e2e33;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: background-color 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-green {
    background-color: #22c55e;
    color: #0e0e10;
    border: none;
}

    .btn-green:hover {
        background-color: #1f9b4c;
    }

.btn-secondary-dark {
    background-color: #1c1c1e;
    color: #e0e0e0;
    border: 1px solid #2e2e33;
}

    .btn-secondary-dark:hover {
        background-color: #2e2e33;
    }

.input-dark {
    background-color: #0e0e10;
    border: 1px solid #2e2e33;
    color: #e0e0e0;
    padding: 0.75rem;
    border-radius: 0.375rem;
    width: 100%;
}

    .input-dark:focus {
        outline: none;
        box-shadow: 0 0 0 1px #22c55e;
        border-color: #22c55e;
    }






.card {
    background-color: #2a2a2a;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
}


.btn-primary {
    background-color: #28a745;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

    .btn-primary:hover {
        background-color: #218838;
    }

.btn-secondary {
    background-color: #3a3a3a;
    color: #e0e0e0;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

    .btn-secondary:hover {
        background-color: #4a4a4a;
    }

.input-field {
    background-color: #3a3a3a;
    border: 1px solid #555;
    color: #e0e0e0;
    padding: 0.75rem;
    border-radius: 0.375rem;
    width: 100%;
}

/* Table specific styles */
.table-auto {
    width: 100%;
    border-collapse: collapse;
}

    .table-auto th, .table-auto td {
        padding: 0.75rem;
        border-bottom: 1px solid #3a3a3a;
        text-align: left;
    }

    .table-auto th {
        background-color: #0e0e10;
        font-weight: 600;
    }

    .table-auto tbody tr:hover {
        background-color: #3a3a3a;
    }




#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMC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g2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}
