table.smartform th{
    vertical-align: top;
    font-size: 14px;
}
table.smartform th label{
    display: block;
}
table.smartform th input,
table.smartform th select{
    font-size: 14px;
    border: 1px solid #ccc;
}
table.smartform .tbody-template-row{
    display: none;
}
.api-banner button.close{
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;   
    background-color: transparent;
}
.api-banner p{
    margin: 10px 0 0 0;
}
.bav-muted-text{
    color: #ccc;
}
/* SELECT WITH SEARCH */
.custom-select-container {
    position: relative;
    display: inline-block;
    width: 200px;
  }

  .search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 5px;
    font-size: 14px;
  }

  .options-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #ccc;
    max-height: 150px;
    overflow-y: auto;
    position: absolute;
    width: 100%;
    background: white;
    z-index: 1000;
  }

  .options-list li {
    padding: 5px;
    cursor: pointer;
  }

  .options-list li:hover {
    background-color: #eee;
  }
/* SORTABLE COLUMNS (th[data-sortkey]) */
table.smartform th.smf-sortable{
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
table.smartform th.smf-sortable:hover{
    text-decoration: underline;
}
/* indicatorul sta dupa <label>-ul antetului; fara label, dupa continutul th-ului */
table.smartform th.smf-sortable > label::after,
table.smartform th.smf-sortable:not(:has(> label))::after{
    content: "\2195"; /* ↕ */
    display: inline-block;
    margin-left: 4px;
    opacity: .35;
    font-size: .85em;
}
table.smartform th.smf-sortable > label{
    cursor: pointer;
}
table.smartform th.smf-sorted-asc > label::after,
table.smartform th.smf-sorted-asc:not(:has(> label))::after{
    content: "\2191"; /* ↑ */
    opacity: 1;
}
table.smartform th.smf-sorted-desc > label::after,
table.smartform th.smf-sorted-desc:not(:has(> label))::after{
    content: "\2193"; /* ↓ */
    opacity: 1;
}

/* LOADING INDICATOR (draw_table) */
table.smartform tr.smf-loading-row td{
    padding: 12px;
}
table.smartform.smf-loading tbody tr:not(.smf-loading-row){
    opacity: .5;
    pointer-events: none;
}
/* Bootstrap 4 nu are .visually-hidden, Bootstrap 5 nu are .sr-only - acoperim ambele */
table.smartform .smf-loading-cell .sr-only,
table.smartform .smf-loading-cell .visually-hidden{
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* SELECT WITH data-search="1" (generated filter input) */
.smf-select-search{
    margin-bottom: 4px;
}

/* IMAGE PREVIEW (input[type=file][data-preview]) */
.smf-preview-thumb{
    max-width: 160px;
    max-height: 160px;
    margin: 4px 4px 0 0;
    object-fit: contain;
}

/* SERVER-SIDE SELECT SEARCH (data-search="server") */
select.smf-loading{
    opacity: .7;
}
select option[data-smf-state]{
    color: #888;
    font-style: italic;
}
/* wrapper optional: input de cautare + select unul langa altul (50/50) - doar pe calea de fallback (fara Tom Select);
   cu Tom Select activ (.ts-wrapper in grup) wrapperul ramane un bloc inert */
.smf-search-group:not(:has(.ts-wrapper)){
    display: flex;
    gap: 4px;
    align-items: stretch;
}
.smf-search-group:not(:has(.ts-wrapper)) > .smartform-select-filter,
.smf-search-group:not(:has(.ts-wrapper)) > select{
    flex: 1 1 50%;
    min-width: 0;
    margin-bottom: 0;
}

/* TOM SELECT (optional, 2026-09-11) - reguli minime, independente de tema */
.ts-wrapper.smf-ts .no-results{ color: #888; font-style: italic; }
.ts-dropdown.smf-ts .no-results{ color: #888; font-style: italic; }
/* eroarea de validare (is-invalid pe selectul ascuns) se vede pe control; mesajul apare si in wrapperul .smf-search-group */
select.is-invalid + .ts-wrapper.form-select,
select.is-invalid + .ts-wrapper:not(.form-select) .ts-control{ border-color: #dc3545; }
.include-in-api-call.has-validation-errors > .invalid-feedback{ display: block; }

/* EDITARE INLINE IN TABELE (.smartable-with-inline-edit, 2026-09-11) */
table.smartform .smf-dirty-cell{ background: rgba(255, 193, 7, .08); }
/* rand nou inline (SmfInlineAddRow, 2026-09-18): marcaj discret pe prima celula pana la salvare */
table.smartform tr.smf-new-row > td:first-child{ box-shadow: inset 3px 0 0 var(--bs-success, #198754); }
table.smartform td .invalid-feedback{ display: block; white-space: normal; }
table.smartform .smf-row-message{ font-size: .75rem; white-space: normal; }
table.smartform tr.smf-row-flash{ transition: background-color .4s; }
table.smartform tr.smf-saving-row{ opacity: .6; }

/* TABLE SETTINGS (2026-09-14) — rotita "Setarile tabelului": latime manuala pe coloane + coloane inghetate.
   Clasele Bootstrap de pe buton sunt doar cosmetice; regulile de aici tin si fara Bootstrap. */
.smf-table-settings-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
}
.smf-table-settings-btn .smf-gear-icon{
    width: 1em;
    height: 1em;
}
.smf-table-settings-menu,
.smf-col-context-menu{
    position: fixed;
    z-index: 1060; /* peste antetul tabelului, peste coloanele inghetate si peste .ts-dropdown */
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
    border: 1px solid var(--bs-border-color, rgba(0, 0, 0, .175));
    border-radius: .375rem;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175);
    font-size: .875rem;
    font-weight: 400;
    text-align: left;
}
.smf-table-settings-menu{
    min-width: 16rem;
    padding: .5rem;
}
.smf-table-settings-menu .smf-menu-title{
    font-weight: 600;
    padding: .15rem .35rem .4rem;
}
.smf-table-settings-menu label.smf-menu-item{
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    padding: .3rem .35rem;
    border-radius: .25rem;
    cursor: pointer;
    white-space: normal;
}
.smf-table-settings-menu label.smf-menu-item:hover{
    background: rgba(125, 125, 125, .14);
}
.smf-table-settings-menu label.smf-menu-item input{
    margin: 0;
    flex: none;
    cursor: pointer;
}
.smf-menu-link{
    display: block;
    width: 100%;
    padding: .3rem .35rem;
    border: 0;
    background: none;
    color: inherit;
    font-size: .8125rem;
    text-align: left;
    opacity: .85;
    cursor: pointer;
}
.smf-menu-link:hover{
    opacity: 1;
    text-decoration: underline;
}
.smf-col-context-menu{
    min-width: 12rem;
    padding: .25rem;
}
.smf-col-context-menu button{
    display: block;
    width: 100%;
    padding: .35rem .6rem;
    border: 0;
    border-radius: .25rem;
    background: none;
    color: inherit;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}
.smf-col-context-menu button:hover{
    background: rgba(125, 125, 125, .14);
}
/* manerul de redimensionare (marginea dreapta a <th>-urilor din primul rand) */
table.smf-resizable th{
    position: relative;
}
.smf-col-resizer{
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    touch-action: none;
    user-select: none;
    z-index: 3;
}
.smf-col-resizer:hover,
.smf-col-resizer.smf-col-resizer-active{
    background: rgba(13, 110, 253, .35);
}
table.smf-resizing{
    user-select: none;
    cursor: col-resize;
}
/* cu latimi fixe continutul trebuie sa se opreasca in celula (altfel curge peste coloana vecina) */
table.smf-resizable > thead > tr:first-child > th,
table.smf-resizable > tbody > tr > td{
    overflow: hidden;
    text-overflow: ellipsis;
}
/* coloane inghetate: raman pe ecran la scroll orizontal; `left` se pune din JS (suma latimilor din stanga) */
table.smartform .smf-frozen{
    position: sticky;
    z-index: 2;
    background: var(--bs-card-bg, var(--bs-body-bg, #fff));
    background-clip: padding-box;
}
table.smartform th.smf-frozen{
    z-index: 3;
}
/* ultima coloana dintr-un grup contiguu de coloane inghetate = granita zonei fixe */
table.smartform .smf-frozen-last{
    box-shadow: 2px 0 0 rgba(0, 0, 0, .08);
}
.smf-frozen-pin{
    display: inline-block;
    margin-left: .25rem;
    opacity: .55;
    vertical-align: middle;
}

/* BARA GRILEI (2026-09-16) — 1:1 cu bara grilelor AdSelect: ? · pâlnie · + · radieră · butoanele ecranului · titlu … contor · ⊘ · rotita.
   Un singur rand; sub 576px se poate rupe. Butoanele generice sunt patrate de 28px. */
.smf-grid-toolbar{
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: nowrap;
    padding: .5rem .75rem;
    min-height: 44px;
}
.smf-grid-toolbar .smf-tb-left,
.smf-grid-toolbar .smf-tb-right,
.smf-grid-toolbar .smf-tb-items{
    display: flex;
    align-items: center;
    gap: .375rem;
    flex: none;
}
.smf-grid-toolbar .smf-tb-items:empty{ display: none; }
.smf-grid-toolbar .smf-tb-right{ margin-left: auto; }
.smf-grid-toolbar .smf-tb-title{
    flex: 0 1 auto;
    min-width: 0;
    margin-left: 1.5rem;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.smf-grid-toolbar .smf-tb-title:empty{ display: none; }
.smf-grid-toolbar .smf-tb-title .smf-tb-title-text{
    display: inline;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}
.smf-grid-toolbar .smf-tb-counter{
    font-size: 16px;
    white-space: nowrap;
}
.smf-grid-toolbar .smf-tb-btn.btn-icon{
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.smf-grid-toolbar .smf-tb-btn[hidden],
.smf-grid-toolbar [hidden]{ display: none !important; }
.smf-grid-toolbar .smf-tb-glyph{ font-weight: 700; font-size: 15px; line-height: 1; }
.smf-grid-toolbar .btn-help,
.smf-grid-toolbar .btn-help:hover,
.smf-grid-toolbar .btn-help:focus{
    background: var(--smf-help-bg, rgb(191, 64, 191));
    border-color: var(--smf-help-bg, rgb(191, 64, 191));
    color: #fff;
}
.smf-grid-toolbar .smf-tb-confirm{ display: inline-flex; align-items: center; gap: .35rem; }
/* „Confirma Selectia” doar in fereastra LOV cu selectie multipla */
.modal:not(.smf-lov-multiple) .smf-grid-toolbar .smf-tb-confirm{ display: none !important; }
.modal:not(.smf-lov-multiple) table.smartform .smf-lov-check,
.modal:not(.smf-lov-multiple) table.smartform .smf-lov-check-all{ display: none !important; }
table.smartform[data-lov] tbody tr{ cursor: pointer; }
table.smartform tr.smf-lov-selected > td{ background: rgba(13, 110, 253, .12); }
/* containerele ale caror butoane au intrat in bara */
.smf-tb-adopted{ display: none !important; }
@media (max-width: 575.98px){
    .smf-grid-toolbar{ flex-wrap: wrap; }
    .smf-grid-toolbar .smf-tb-title{ margin-left: 0; }
}
/* cu bara activa, butoanele vechi Filtrează / Reset din antet nu se mai afiseaza (raman in DOM pentru apelurile programatice) */
table.smartform.smf-has-toolbar .smartform-filter,
table.smartform.smf-has-toolbar .smartform-filter-reset{ display: none !important; }
/* pâlnia: randul de filtre ascuns (etichetele si sortarea raman) */
table.smartform.smf-filters-hidden > thead > tr:not(.tbody-template-row) > th > :not(label):not(.smf-col-resizer):not(.smf-frozen-pin){ display: none !important; }
table.smartform.smf-filters-hidden > thead > tr.smf-filter-row{ display: none; }
/* filtre avansate: operator · control · +/cos, pe un rand in celula antetului */
table.smartform .smf-adv-cond{
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 2px;
}
table.smartform .smf-adv-cond > .smf-adv-op{
    flex: 0 0 auto;
    width: auto;
    min-width: 4.25rem;
    max-width: 7rem;
    padding-right: 1.5rem;
    font-size: 12px;
}
table.smartform .smf-adv-cond > :not(.smf-adv-op):not(.smf-adv-add):not(.smf-adv-del){
    flex: 1 1 auto;
    min-width: 5rem;
}
table.smartform .smf-adv-cond > .smf-adv-add,
table.smartform .smf-adv-cond > .smf-adv-del{
    flex: none;
    width: 22px;
    height: 22px;
    min-width: 22px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/* „?” — help-ul contextual: 90vw x 80vh, fundal #DFEDF8, fara titlu, doar × */
.smf-help-modal .smf-help-dialog{
    max-width: 90vw;
    width: 90vw;
    margin: 10vh auto;
}
.smf-help-modal .smf-help-content{
    height: 80vh;
    background: #DFEDF8;
    color: #212529;
    position: relative;
}
.smf-help-modal .smf-help-close{
    position: absolute;
    top: .5rem;
    right: .5rem;
    z-index: 2;
}
.smf-help-modal .smf-help-body{
    overflow: auto;
    padding: 2rem 1.5rem 1.5rem;
}
.smf-help-modal .smf-help-body img{ max-width: 100%; height: auto; }
