:root {
    --bg: #f4f5ff;
    --sidebar-bg: #ffffff;
    --sidebar-border: rgba(15, 23, 42, 0.08);
    --brand: #2f2dd2;
    --text-primary: #1f1f33;
    --text-muted: #6d6e85;
    --accent: #f7f1ff;
    --card-bg: #ffffff;
    --card-border: #69707a54; // rgba(15, 23, 42, 0.05);
    --radius-lg: 24px;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text-primary);
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns 0.3s ease;
}

.sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    /*padding: 32px 24px;*/
    padding-bottom: 24px;
    padding-top: 24px;
    padding-right: 0;
    padding-left: 12px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    transition: padding 0.3s ease;
    overflow: hidden;
}

.sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.sidebar__brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 10px;
}

.sidebar__brand-link {
    display: flex;
    align-items: center;
    /* Center vertically */
    gap: 16px;
    /* Increased gap for better separation */
    text-decoration: none;
    color: inherit;
}

.sidebar__brand-link:hover {
    opacity: 0.85;
}

.sidebar__brand-link img {
    width: 48px;
    /* Slightly larger logo */
    height: 48px;
    object-fit: contain;
}

.sidebar__brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center text block vertically relative to icon */
    gap: 2px;
}

.sidebar__brand-text strong {
    font-size: 22px;
    /* Slightly larger title */
    line-height: 1.1;
    color: var(--brand);
    font-weight: 700;
}

.sidebar__brand-text strong span {
    color: #00ac69;
}

.sidebar__brand-text small {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.2;
    max-width: 160px;
    /* Prevent too wide text */
}

.sidebar__toggle {
    border: 1px solid var(--sidebar-border);
    background: #fff;
    color: var(--text-muted);
    border-radius: 8px;
    /* Soft square */
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;

    /* Resetting any inline overrides if present in HTML, though here we just clean the CSS class */
    position: relative;
    right: auto;
    top: auto;
    transform: none;
}

.sidebar__toggle:hover {
    background: var(--accent);
    color: var(--brand);
    border-color: rgba(47, 45, 210, 0.2);
}

.sidebar__toggle-icon::before {
    content: '\2039';
    /* Left chevron */
    display: block;
    line-height: 1;
}



.sidebar__nav-label {
    flex: 1;
}

.sidebar__section label {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 12px;
}

.sidebar__nav {
    list-style: none;
    margin: 5px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar__nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: background 0.2s ease;
}

.sidebar__nav a.is-active,
.sidebar__nav a:hover {
    background: rgba(47, 45, 210, 0.08);
    color: var(--brand);
}

.sidebar__nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: rgba(47, 45, 210, 0.09);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.sidebar__footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px 12px;
}

.sidebar__cta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    background: var(--accent);
    border-radius: 16px;
}

.sidebar__button {
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.sidebar__button--primary {
    background: var(--brand);
    color: #fff;
}

.sidebar__button--ghost {
    background: transparent;
    border: 1px solid rgba(47, 45, 210, 0.3);
    color: var(--brand);
}

.sidebar__button--ghost-danger {
    background: transparent;
    border: 1px solid rgb(174, 28, 42);
    color: rgb(174, 28, 42);
}

.sidebar__button:focus,
.sidebar__button:hover {
    transform: translateY(-1px);
}

body.sidebar-collapsed .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
    padding: 24px 12px;
    gap: 20px;
}

body.sidebar-collapsed .sidebar__header {
    flex-direction: column;
    align-items: center;
}

body.sidebar-collapsed .sidebar__brand-text,
body.sidebar-collapsed .sidebar__toggle-label,
body.sidebar-collapsed .sidebar__section label,
body.sidebar-collapsed .sidebar__footer {
    display: none;
}

body.sidebar-collapsed .sidebar__toggle {
    right: auto !important;
    transform: none;
    top: auto;
    background-color: transparent !important;
    color: var(--text-muted);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    border: 1px solid var(--sidebar-border);
    margin-top: 12px;
    /* Add some spacing if needed */
}

table {
    table-layout: auto;
    width: auto; /* opcional */
    white-space: nowrap; /* impede quebra de linha, força adaptar ao conteúdo */
}


table th {
    text-align: center;
    vertical-align: middle; /* opcional: centraliza verticalmente também */
}


.htmx-spinner {
    display: none !important;
}

.btn-outline-disabled-default {
    color: #6839cf;
    border-color: #6839cf;
}

.btn-outline-disabled-default:hover{
    color: #6839cf;
    border-color: #6839cf;
}



.page-link.htmx-request .htmx-spinner {
    display: inline-block!important;
}

body.sidebar-collapsed .sidebar__toggle:hover {
    background: var(--accent) !important;
    color: var(--brand);
    border-color: rgba(47, 45, 210, 0.2);
}

body.sidebar-collapsed .sidebar__toggle-icon::before {
    content: '\203A';
    /* Right chevron */
}

body.sidebar-collapsed .sidebar__nav a {
    justify-content: center;
    padding: 12px;
}

body.sidebar-collapsed .sidebar__nav-label,
body.sidebar-collapsed .sidebar__cta,
body.sidebar-collapsed .sidebar__button {
    display: none;
}

.page-area {
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.page-header__search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
}

.page-header__search input {
    border: none;
    flex: 1;
    font-size: 15px;
    outline: none;
}

.page-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
}

.user-name-nav {
    background:linear-gradient(279deg, #7b3cff 0%, #5f2ec2 100%);
    position: relative;
    overflow: hidden;
    color: #ffffff!important;
    gap: 12px;
    border-radius: 16px;
    padding: 12px 16px;
    border: 1px solid var(--card-border);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.avatar-pill img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--card-border);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.card--highlight {
    background:linear-gradient(279deg, #7b3cff 0%, #5f2ec2 100%);
    border: none;
    position: relative;
    overflow: hidden;
    color: #ffffff;
    box-shadow: 0 16px 40px #0000008c;
}

.card--alert-warning {
    background: linear-gradient(90deg, #ffe58f 0%, #ffc107 100%);
    border: none;
    position: relative;
    overflow: hidden;
    color: #212832;
    box-shadow: 0 16px 40px #0000008c;
}

.icon-bell-notification {
    color: darkred;
    cursor: pointer;
}

.icon-bell-notification:hover{
    color: red;
}

.bell-ring-without-notification {
    color: #d6d9e4;
    cursor: pointer;
}

.bell-ring {
    animation: ring 0.5s ease-in-out infinite alternate;
    color: red;
    cursor: pointer;
}

.input-empty {
    border: 1px solid red!important;
}

@keyframes ring {
    0%   { transform: rotate(0deg); }
    20%  { transform: rotate(15deg); }
    40%  { transform: rotate(-15deg); }
    60%  { transform: rotate(10deg); }
    80%  { transform: rotate(-10deg); }
    100% { transform: rotate(0deg); }
}


.card-notification-panel{
    padding: 18px;
    border-radius: 16px;
    border: 1px dashed rgb(22 20 218 / 87%);
    background: rgba(255, 255, 255, 0.9)
}

.spinner-default {
    color: #7b3cff;
    margin-bottom: 3px;
}

.input--highlight {
    background: #dcd9ff;
}

.title-panel-notifications {
    background:linear-gradient(279deg, #7b3cff 0%, #5f2ec2 100%);
    border: none;
    position: relative;
    overflow: hidden;
    color: #ffffff;
    box-shadow: 0 16px 40px #0000008c;
    border-radius: 4px;
    padding: 10px;
}

.card--highlight::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.2), transparent 60%);
    pointer-events: none;
}

.card--highlight small {
    color: rgba(255, 255, 255, 0.9);
}

.card--highlight h2,
.card--highlight p,
.card--highlight strong {
    color: #ffffff;
}

.card-highlight-secondary {
    border: 1px dashed #7b3cff!important;
}

.card small {
    color: #ffc107; //var(--text-muted);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.card--alert-warning small {
    color: #9120a4;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.card strong {
    display: block;
    font-size: 32px;
    margin-top: 12px;
}

.default-bold-text {
    color: #7b3cff;
    font: 500 16px/1.3 'Poppins', sans-serif;
    font-weight: bold;
}

.captcha-image {
    max-width: 200px!important;
    text-align: center!important;
    height: 50px;
    border-radius: 4px;
}

.captcha-input {
    max-width: 200px!important;
}

.btn-reload-captcha {
    margin-left: 0!important;
}

.captcha-solution {
    max-width: 200px!important;
    text-align: center!important;
}

.input-secondary-bg {
    background-color: #e0e5ec61;
}

.page-header_override {

    gap: 12px;
    border: 1px solid var(--brand);
    border-radius: 8px;
    text-align: end;
    /*box-shadow: 8px 8px 16px rgba(0, 0, 0, 0.15);*/
}

.page-header__actions_override {
    gap: 12px;
    border-radius: 8px;
}

.navbar {
    border-radius: 8px;
    text-align: end;
}

.bg-body-tertiary {
    background-color: transparent!important;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.user-info .user-name {
    font-weight: bold;
}

.navbar-brand{
   font-size: 0.9rem!important;
}

.user-info .enterprise-name {
    font-size: 0.9rem; /* opcional */
    opacity: 0.8;      /* opcional */
}


.progress-card__bar {
    margin-top: 16px;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(47, 45, 210, 0.15);
    overflow: hidden;
}

.progress-card__bar span {
    display: block;
    height: 100%;
    background: var(--brand);
    width: 70%;
}

.page-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.quick-action {
    padding: 18px;
    border-radius: 16px;
    border: 1px dashed rgba(47, 45, 210, 0.2);
    background: rgba(255, 255, 255, 0.9);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    margin-right: 16px;
    color: var(--text-primary);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.user-name-base {
    color: #2f2dd2;
}

.sidebar-overlay.is-visible {
    display: block;
    opacity: 1;
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 992px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
        padding-right: 12px;
        /* Restore padding */
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    /* Hide toggle button inside sidebar on mobile if present */
    .sidebar__toggle {
        display: none;
    }
}