/* =========================================
       1. LAYOUT & CONTENITORI
       ========================================= */
.dashboard-ui {
    width: 100%;
    max-width: 1532px;
    margin: 0 auto;
    padding: 40px 72px;
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-sizing: border-box;
}

.ui-row {
    width: 100%;
    max-width: 1388px;
}

/* =========================================
       2. TIPOGRAFIA & INTESTAZIONE
       ========================================= */
.page-title {
    font-family: 'Titillium Web', sans-serif;
    font-weight: 600;
    font-size: 32px;
    line-height: 28px;
    color: #000000;
    margin: 0;
}

/* =========================================
       3. TOOLBAR PERSONALIZZATA
       ========================================= */
.toolbar-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Componente Ricerca */
.search-proxy {
    width: 636px;
    height: 44px;
    position: relative;
}

.search-proxy input {
    width: 100%;
    height: 100%;
    border-radius: 100px;
    border: 1px solid #CCCCCC;
    background: #FFFFFF;
    padding-left: 20px;
    font-family: 'Lato', sans-serif;
    font-weight: 500;
    font-size: 16px;
    color: #000000;
    box-shadow: none !important;
}

.search-proxy button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #D11525;
    border: none;
    position: absolute;
    top: 8px;
    right: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    padding: 0;
}

.search-proxy button i {
    color: #FFFFFF;
    font-size: 12px;
}

/* =========================================
   STILE BOTTONE CREA
========================================= */

/* Contenitore Bottone */
a.btn-create-new,
a.btn-create-new:hover,
a.btn-create-new:focus,
a.btn-create-new:active {
    display: inline-flex;
    /* inline-flex si adatta al contenuto */
    height: 42px;
    border-radius: 12px;
    background-color: #D11525;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    /* Padding uguale a destra e sinistra */
    box-sizing: border-box;
    transition: background-color 0.2s ease;
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
    color: #FFFFFF !important;
    white-space: nowrap;
    font-family: 'Lato', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1;
}

/* --- STILE ICONA SVG (NITIDEZZA MASSIMA) --- */
.btn-create-new svg.bi {
    fill: #FFFFFF !important;

    width: 20px;
    height: 20px;
    display: block;
    flex-shrink: 0;

    overflow: visible;
}

.btn-create-new svg.bi path {
    stroke: #FFFFFF !important;
    stroke-width: 0.5px;
    shape-rendering: geometricPrecision;
}

a.btn-create-new:hover {
    background-color: #980613;
}

/* Etichetta di testo */
.btn-create-new .btn-label {
    margin-right: 12px;
    /* Spazio tra testo e icona */
}

/* Stile dell'Icona SVG (Croce) */
.btn-create-new svg.bi {
    fill: #FFFFFF !important;
    /* Colore bianco */
    width: 20px;
    /* Dimensione più grande */
    height: 20px;
    display: block;
    flex-shrink: 0;
    /* Non si schiaccia */
}

/* =========================================
       4. STILE GRIGLIA DATI
       ========================================= */
.grid-card {
    width: 100%;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border: 1px solid #E5E7EB;
    background: #FFFFFF;
    overflow: hidden;
}

/* Wrapper visivo tipo card */
.entity-grid {
    width: 100%;
    /* border-radius: 12px; */
    border: 1px solid #E5E7EB;
    background: #FFFFFF;
    overflow: hidden;
}


/* Reset Controlli Nativi */
.view-grid,
.table-responsive,
table.table {
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Anti-Flicker: Nasconde tabella finché non scatta evento JS 'loaded' */
.entitylist .entity-grid table {
    opacity: 0;
    transition: opacity 0.2s ease-in;
}

/* Nasconde forzatamente toolbar native */
/* SOLO per entity list */

.entitylist .view-toolbar,
.entitylist .toolbar-actions {
    display: none;
}

.entity-grid-search,
.view-search {
    display: none !important;
}

/* Intestazione Tabella */
.grid-card thead th {
    background-color: #F9FAFB !important;
    color: #4B5563 !important;
    font-weight: 600 !important;
    padding: 16px 24px !important;
    border-bottom: 1px solid #E5E7EB !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
}

.grid-card thead th:last-child {
    color: transparent !important;
}

/* Corpo Tabella */
.grid-card tbody tr {
    background-color: #FFFFFF !important;
}

.grid-card tbody td {
    padding: 20px 24px !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #E5E7EB !important;
    border-top: none !important;
    color: #000000;
}

.grid-card tbody tr:last-child td {
    border-bottom: none !important;
}

/* --- EVIDENZIAZIONE PRIMA COLONNA (ID) --- */
/* Target sia testo cella che link interno per garantire colore ROSSO */
.grid-card tbody td:first-child,
.grid-card tbody td:first-child a {
    color: #D11525 !important;
    font-weight: 500 !important;
    text-decoration: none !important;
}

/* Badge di Stato */
.civis-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
}

.badge-gray {
    background: #F3F4F6;
    color: #4B5563;
}

/* =========================================
       5. BOTTONI AZIONE (DROPDOWN)
       ========================================= */
/* Nasconde tutti i bottoni nativi eccetto il toggle dropdown */
.grid-card tbody td .action .btn,
.grid-card tbody td .dropdown .btn:not([data-bs-toggle="dropdown"]) {
    display: none !important;
}

/* Stile Bottone Toggle */
.grid-card tbody td .dropdown .btn[data-bs-toggle="dropdown"] {
    width: 65px !important;
    height: 32px !important;
    border-radius: 50px !important;
    border: 1px solid #980613 !important;
    color: #980613 !important;
    background: transparent !important;
    display: flex !important;
    justify-content: center;
    align-items: center;
    padding: 0 !important;
    margin-left: auto !important;
    box-shadow: none !important;
    font-size: 0 !important;
}

/* Pulisce icone/testo interni */
.grid-card tbody td .dropdown .btn[data-bs-toggle="dropdown"] * {
    display: none !important;
}

.dropdown-toggle::after {
    display: none !important;
    content: none !important;
}

/* Inietta Icona Chevron Personalizzata */
.grid-card tbody td .dropdown .btn[data-bs-toggle="dropdown"]::after {
    content: "\f078";
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 12px !important;
    color: #980613;
    display: block !important;
    border: none !important;
    margin: 0 !important;
}

/* Footer Paginazione */
.entity-grid-footer {
    border-top: 1px solid #E5E7EB;
    padding: 15px;
    background: #FFFFFF;
}


/* =========================================
   FIX GLOBALE PULIZIA FORM 
   ========================================= */

.crmEntityFormView,
.crmEntityFormView .tab,
.crmEntityFormView .section,
.crmEntityFormView fieldset,
.crmEntityFormView table,
.crmEntityFormView tbody,
.crmEntityFormView tr,
.crmEntityFormView td {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.grid-actions .toolbar-actions .input-group.float-start.view-search.entitylist-search {
    display: table !important;
}

/* By Luca :) */
/* Css per i bottoni di lookup */
.btn.btn-default.launchentitylookup {
    height: 40px;
    border-radius: 0px 8px 8px 0px;
    border-color: lightgray;
}

.btn.btn-default.clearlookupfield {
    height: 40px;
    border: 1px solid lightgrey;
}

/* Css per i bottoni del datepicker */
.input-append.input-group.datetimepicker .input-group-addon.btn {
    border-radius: 0px 8px 8px 0px;
}

/* Css per gli input della picklist */
.picklist.vertical input {
    margin: 5px 5px 0px 0px !important;
}

#content .nav-account .nav-item .nav-link {
    background: #D11525 !important;
}

.civis-input-slot .clearfix.cell.checkbox-cell .control {
    position: relative;
    bottom: 24px;
}

div[name="webChat"] {
    display: none !important;
}

.modal.fade.modal-lookup.show .entitylist-search button {
    height: 40px;
    border: 1px solid lightgray;
    border-radius: 0px 8px 8px 0px !important;
}

.modal.fade.modal-lookup.show .entity-grid {
    border: none !important;
}

.modal.fade.modal-lookup.show tr.selected {
    margin-bottom: 0px !important;
    padding-bottom: 0px !important;
}

.page-item a.page-link {
    background-color: white !important;
    color: #D11525 !important;
}

.page-item.active a.page-link {
    background-color: #D11525 !important;
    color: white !important;
}

ul.pagination {
    margin-bottom: 12px !important;
}

.civis-step {
    width: 160px !important;
}