/* ========================================
   BETHA LAYOUT - CSS PRINCIPAL
   ======================================== */

body {
    font-family: 'Open Sans', Arial, sans-serif;
}

.main-body, body {
    background-color: #EDEDEE;
}

/* ----------------------------------------
   CONTAINER PRINCIPAL
   ---------------------------------------- */
.betha-container {
    margin-right: auto;
    margin-left: auto;
    margin-top: 5px;
    padding: 0 15px;
    padding-bottom: 20px;
    width: calc(100% - 16px);
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

    .betha-container .card {
        border: none;
        box-shadow: none;
        background: transparent;
    }

    .betha-container .card-body {
        padding: 0;
    }

    .betha-container hr {
        border-top: 1px solid #ededee;
        margin: 10px 0;
    }

/* ----------------------------------------
   HEADER BETHA
   ---------------------------------------- */
.betha-header {
    background: #ffffff;
    height: 40px;
    position: sticky;
    top: 0;
    z-index: 1050;
    border-bottom: 1px solid #e3e3e3;
    padding: 0 !important;
}

.betha-header-link {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 10px;
    color: #59595a;
}

    .betha-header-link:hover {
        background: #ededee;
        color: #242424;
        text-decoration: none;
    }

.betha-avatar {
    height: 22px !important;
    width: 22px;
    object-fit: cover;
}

.betha-avatar-sm {
    height: 20px;
    border-radius: 50%;
    margin-right: 6px;
}

.betha-entity-name {
    font-size: 14px;
    font-weight: 500;
}

/* ----------------------------------------
   PAGE HEADER
   ---------------------------------------- */
.bth-page-header {
    border-bottom: none;
    margin: 0;
    padding: 14px 11px 0 11px;
}

    .bth-page-header .row {
        margin-bottom: 10px;
        padding: 0;
    }

    .bth-page-header h1,
    .betha-container h1 {
        font-family: 'Open Sans', Arial, sans-serif;
        font-size: 22px;
        font-weight: 500;
        line-height: 1.1;
        color: #242424;
        margin: 0;
    }

.bth-page-title {
    padding: 14px 0;
}

/* ----------------------------------------
   HEADER FIXO
   ---------------------------------------- */

.betha-header-inner {
    width: calc(100% - 16px);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
}

/* ----------------------------------------
   BREADCRUMB
   ---------------------------------------- */
.bth-breadcrumb {
    float: right;
    background: none;
    margin: 0;
    padding: 0;
    list-style: none;
}

    .bth-breadcrumb li {
        display: inline-block;
        color: #757576;
        font-size: 12px;
        line-height: 22px;
    }

        .bth-breadcrumb li + li::before {
            content: "\f105";
            font-family: FontAwesome;
            font-size: 13px;
            font-weight: 600;
            color: #757576;
            padding: 0 5px;
        }

/* ----------------------------------------
   BARRA DE AÇÕES
   ---------------------------------------- */
.bth-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 11px;
}

/* ----------------------------------------
   BOTÕES PADRÃO BETHA
   ---------------------------------------- */
.bth-btn-group {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

    .bth-btn-group > .bth-btn-add {
        position: relative;
        float: left;
        margin-left: 0;
    }

.bth-btn-add {
    display: inline-block;
    margin-bottom: 0;
    text-align: center;
    vertical-align: middle;
    touch-action: manipulation;
    cursor: pointer;
    background-image: none;
    border: none;
    white-space: nowrap;
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.55;
    border-radius: 4px;
    font-family: 'Open Sans', Arial, sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    user-select: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

    .bth-btn-add::before {
        content: "\E145";
        display: inline-block;
        font-family: 'Material Icons', Arial, sans-serif;
        font-size: 16px;
        margin-top: -3px;
        padding-right: 4px;
        vertical-align: middle;
        font-weight: 400;
    }

    .bth-btn-add.bth-no-icon::before {
        content: none;
    }

    .bth-btn-add.bth-btn-success {
        background-color: #329a72;
        border: 1px solid #329a72;
        color: #fff;
    }

        .bth-btn-add.bth-btn-success:hover {
            background-color: #257456;
            border-color: #257456;
        }

        .bth-btn-add.bth-btn-success:active {
            background-color: #1e5c45;
            border-color: #1e5c45;
        }

        .bth-btn-add.bth-btn-success:focus {
            outline: none;
            box-shadow: 0 0 0 2px rgba(50, 154, 114, 0.3);
        }

    .bth-btn-add.bth-btn-primary {
        background-color: #3374db;
        border: 1px solid #3374db;
        color: #fff;
    }

        .bth-btn-add.bth-btn-primary:hover {
            background-color: #2860b8;
            border-color: #2860b8;
        }

        .bth-btn-add.bth-btn-primary:active {
            background-color: #1e4a8a;
            border-color: #1e4a8a;
        }

        .bth-btn-add.bth-btn-primary:focus {
            outline: none;
            box-shadow: 0 0 0 2px rgba(51, 116, 219, 0.3);
        }

    .bth-btn-add.bth-btn-sm {
        padding: 4px 8px;
        font-size: 11px;
    }

    .bth-btn-add.bth-btn-md {
        padding: 6px 12px;
        font-size: 13px;
    }

    .bth-btn-add.bth-btn-lg {
        padding: 8px 16px;
        font-size: 14px;
    }

/* ----------------------------------------
   CAMPO DE PESQUISA
   ---------------------------------------- */
.bth-search-input {
    width: 342px;
    height: 30px;
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.5;
    border: 1px solid #bfbfc0;
    border-radius: 4px;
    box-shadow: none;
    color: #242424;
    font-family: 'Open Sans', Arial, sans-serif;
    transition: border-color 0.15s ease-in-out;
}

    .bth-search-input:focus {
        border-color: #3374db;
        outline: none;
        box-shadow: 0 0 0 2px rgba(51, 116, 219, 0.15);
    }

    .bth-search-input::placeholder {
        color: #bfbfc0;
    }

.betha-container input[type="search"],
.betha-container #pesquisar {
    width: 250px;
    height: 34px;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
}

    .betha-container input[type="search"]:focus,
    .betha-container #pesquisar:focus {
        border-color: #3374db;
        outline: none;
        box-shadow: 0 0 0 2px rgba(51, 116, 219, 0.15);
    }

/* ----------------------------------------
   GRID CONTAINER
   ---------------------------------------- */
.bth-grid-container {
    padding: 0 11px;
}

.bth-empty-message {
    margin-bottom: 20px;
    font-size: 21px;
    font-weight: 300;
    line-height: 1.4;
    text-align: center;
    color: #757576;
}

/* ----------------------------------------
   DROPDOWN
   ---------------------------------------- */
.dropdown-menu {
    z-index: 2000 !important;
}

.betha-dropdown {
    border: 1px solid #e3e3e3;
    border-radius: 4px;
    box-shadow: 0 3px 6px rgba(0,0,0,.16);
    padding: 5px 0;
}

    .betha-dropdown .dropdown-item {
        padding: 6px 14px;
        font-size: 14px;
    }

        .betha-dropdown .dropdown-item:hover {
            background-color: #f5f5f5;
        }

/* ----------------------------------------
   CARDS - VISÃO GERAL
   ---------------------------------------- */
.betha-container .betha-page-header {
    border-bottom: none;
    margin: 14px 0;
    padding-bottom: 0;
}

    .betha-container .betha-page-header h3 {
        font-family: 'Open Sans', Arial, sans-serif;
        font-size: 20px;
        font-weight: 500;
        color: #242424;
        margin-top: 0;
        margin-bottom: 10px;
    }

.betha-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    margin-right: -10px;
    padding: 0;
    position: relative;
}

    .betha-list li {
        box-sizing: border-box;
        display: inline-flex;
        margin-bottom: 10px;
        padding-right: 10px;
        width: 33.33333%;
    }

.betha-card {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 24px;
    background-color: rgba(166, 184, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
    color: #1c1a23;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
    border: 1px solid rgba(166, 184, 255, 0.4);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

    .betha-card:hover {
        background-color: rgba(166, 184, 255, 0.6);
        text-decoration: none;
        color: #1c1a23;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
        border-color: rgba(166, 184, 255, 0.6);
    }

    .betha-card .betha-card-title {
        padding-right: 50px;
        cursor: pointer;
        font-size: 20px;
        font-family: 'Open Sans', Arial, sans-serif;
        font-weight: 400;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: block;
        color: #1c1a23;
    }

    .betha-card .betha-card-icon {
        position: absolute;
        width: 42px;
        height: 42px;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        margin: 0;
        padding: 0;
        cursor: default;
        pointer-events: none;
        text-align: center;
        background-color: rgba(166, 184, 255, 0.6);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .betha-card .betha-card-icon i {
            color: #1c1a23 !important;
            font-size: 22px !important;
        }

    /* Loading state do card */
    .betha-card.loading .card-value {
        position: relative;
        color: transparent !important;
        background: #e9ecef;
        border-radius: 6px;
        height: 22px;
        overflow: hidden;
    }

        .betha-card.loading .card-value::after {
            content: "";
            position: absolute;
            inset: 0;
            transform: translateX(-100%);
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
            animation: shimmer 1.2s infinite;
        }

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* ----------------------------------------
   CAMPO DE VISUALIZAÇÃO
   ---------------------------------------- */
.bth-field-view {
    margin-bottom: 10px;
}

    .bth-field-view .bth-label {
        font-size: 12px;
        color: #757576;
        margin-bottom: 2px;
        display: block;
    }

    .bth-field-view p {
        font-size: 14px;
        color: #242424;
        margin: 0;
        padding: 4px 0;
        font-weight: 500;
    }

/* ----------------------------------------
   ALERTAS E MODAIS
   ---------------------------------------- */
#alert-container {
    position: fixed !important;
    top: 60px !important;
    right: 20px !important;
    z-index: 2147483647 !important;
}

.modal-backdrop {
    z-index: 1040 !important;
}

.modal {
    z-index: 1050 !important;
}

body > #alert-container {
    z-index: 2147483647 !important;
}

/* ----------------------------------------
   MULTI-SELECT (CHOICES.JS)
   ---------------------------------------- */
.bth-scope .choices[data-type*="select-multiple"] .choices__inner,
.bth-body .choices[data-type*="select-multiple"] .choices__inner {
    min-height: 34px !important;
    max-height: 68px !important;
    overflow-y: auto !important;
    padding: 4px 8px !important;
}

.bth-scope .choices__list--multiple,
.bth-body .choices__list--multiple {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
}

    .bth-scope .choices__list--multiple .choices__item,
    .bth-body .choices__list--multiple .choices__item {
        background-color: #3374db !important;
        border: none !important;
        border-radius: 4px !important;
        padding: 3px 8px !important;
        font-size: 13px !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        color: #fff !important;
        flex-shrink: 0 !important;
    }

        .bth-scope .choices__list--multiple .choices__item .choices__button,
        .bth-body .choices__list--multiple .choices__item .choices__button {
            border-left: none !important;
            padding-left: 6px !important;
            margin-left: 6px !important;
            opacity: 0.8;
        }

            .bth-scope .choices__list--multiple .choices__item .choices__button:hover,
            .bth-body .choices__list--multiple .choices__item .choices__button:hover {
                opacity: 1;
            }

.bth-scope .choices[data-type*="select-multiple"]:has(.choices__item) .choices__input--cloned,
.bth-body .choices[data-type*="select-multiple"]:has(.choices__item) .choices__input--cloned {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

/* Estilo para valores na visualização */
.bth-value {
    margin: 0;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    min-height: 38px;
    word-wrap: break-word;
}

@media (max-width: 991px) {
    .betha-list li {
        width: 50%;
    }

    .bth-search-input {
        width: auto;
    }
}

@media (max-width: 767px) {
    .betha-container {
        width: 100%;
    }

    .bth-breadcrumb {
        float: left;
    }

    .bth-search-input {
        width: 100%;
    }

    .bth-actions-bar {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

@media (max-width: 576px) {
    .betha-list li {
        width: 100%;
    }
}