/*
 * GIS Gestionale - CSS isolato
 * Tutte le nuove componenti sono confinati in .gis-app o .gis-admin.
 * Il markup legacy viene migrato progressivamente alle classi gis-*.
 */

/* #################################################################################################### §00. SCOPE E TOKEN */
:where(.gis-app, .gis-admin) {
    --gis-color-primary: #0b7171;
    --gis-color-primary-dark: #005c5e;
    --gis-color-success: #198754;
    --gis-color-danger: #dc3545;
    --gis-color-warning: #ffc107;
    --gis-color-info: #0dcaf0;
    --gis-color-surface: #ffffff;
    --gis-color-muted: #6c757d;
    --gis-color-border: #dee2e6;
    --gis-color-text: #212529;
    --gis-radius: 4px;
    --gis-shadow: 0 8px 24px rgb(0 0 0 / 18%);
    --gis-z-search: 100;
    --gis-z-nav: 200;
    --gis-z-dropdown: 300;
    --gis-z-border: 400;
    --gis-z-sipario-backdrop: 500;
    --gis-z-sipario-panel: 600;
    --gis-z-modal: 700;
    --gis-z-footer: 800;
    --gis-z-context: 900;
    color: var(--gis-color-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    isolation: isolate;
}

:where(.gis-app, .gis-admin) *,
:where(.gis-app, .gis-admin) *::before,
:where(.gis-app, .gis-admin) *::after {
    box-sizing: border-box;
}

:where(.gis-app, .gis-admin) button,
:is(.gis-app, .gis-admin) input,
:is(.gis-app, .gis-admin) select,
:is(.gis-app, .gis-admin) textarea {
    color: var(--gis-color-text) !important;
    font: inherit;
}

.gis-admin {
    margin-right: 20px;
}

.gis-app #gis_footer {
    bottom: 0;
    left: 0;
    position: fixed;
    right: 0;
    z-index: 800;
}

#gis_footer.gis-footer {
    bottom: 0 !important;
    left: 0 !important;
    position: fixed !important;
    right: 0 !important;
    transform: translateZ(0);
}

@scope (.gis-app, .gis-admin) {

/* #################################################################################################### §01. LAYOUT */
.gis-container,
.gis-container-fluid {
    margin-inline: auto;
    padding-inline: 1rem;
    width: 100%;
}

.gis-container { max-width: 1320px; }
.gis-row { display: grid; gap: 1rem; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.gis-row.gis-row-tight { gap: .5rem; }
.gis-row.gis-row-wide { gap: 2rem; }
.gis-col { min-width: 0; }
.gis-col-12 { grid-column: span 12; }
.gis-col-9 { grid-column: span 9; }
.gis-col-6 { grid-column: span 6; }
.gis-col-5 { grid-column: span 5; }
.gis-col-4 { grid-column: span 4; }
.gis-col-3 { grid-column: span 3; }
.gis-col-2 { grid-column: span 2; }
.gis-flex { display: flex; }
.gis-flex-wrap { flex-wrap: wrap; }
.gis-items-start { align-items: flex-start; }
.gis-items-center { align-items: center; }
.gis-justify-between { justify-content: space-between; }
.gis-justify-end { justify-content: flex-end; }
.gis-gap-1 { gap: .5rem; }
.gis-gap-2 { gap: 1rem; }
.gis-mt-2 { margin-top: 1rem; }
.gis-mb-3 { margin-bottom: 1rem; }
.gis-p-2 { padding: 1rem; }
.gis-text-center { text-align: center; }
.gis-text-end { text-align: end; }
.gis-text-nowrap { white-space: nowrap; }
.gis-hidden { display: none !important; }
.gis-visible-lg { display: none; }
.gis-footer { bottom: 0; color: #fff; left: 0; padding: .5rem; position: fixed; right: 0; z-index: var(--gis-z-footer); }
.gis-footer .gis-btn { white-space: nowrap; width: max-content; }
.gis-footer .gis-btn > span { display: inline; }
.gis-search-box { overflow: hidden; position: sticky; top: 0; z-index: var(--gis-z-search); }
.gis-hidden-mobile { display: none; }

/* #################################################################################################### §02. PULSANTI E FORM */
.gis-btn {
    align-items: center;
    background: var(--gis-color-surface);
    border: 1px solid transparent;
    border-radius: var(--gis-radius);
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    line-height: 1.25;
    min-height: 2.4rem;
    padding: .5rem .9rem;
    text-align: center;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.gis-btn:hover { filter: brightness(.94); }
.gis-btn > span { margin-left: .35rem; margin-right: .35rem; }
.gis-btn:focus-visible,
.gis-form-control:focus-visible,
.gis-form-select:focus-visible,
.gis-tab:focus-visible,
.gis-nav-toggle:focus-visible { outline: 3px solid rgb(13 110 253 / 42%); outline-offset: 2px; }
.gis-btn:disabled,
.gis-btn.gis-is-disabled { cursor: not-allowed; opacity: .6; pointer-events: none; }
.gis-btn-lg { font-size: 1.1rem; min-height: 3rem; padding: .7rem 1.1rem; }
.gis-btn-primary { background: var(--gis-color-primary); border-color: var(--gis-color-primary); color: #fff; }
.gis-btn-secondary { background: #6c757d; border-color: #6c757d; color: #fff; }
.gis-btn-success { background: var(--gis-color-success); border-color: var(--gis-color-success); color: #fff; }
.gis-btn-danger { background: var(--gis-color-danger); border-color: var(--gis-color-danger); color: #fff; }
.gis-btn-warning { background: var(--gis-color-warning); border-color: var(--gis-color-warning); color: #212529; }
.gis-btn-light { background: #f8f9fa; border-color: #f8f9fa; color: #212529; }
.gis-btn-outline-primary { background: transparent; border-color: var(--gis-color-primary); color: var(--gis-color-primary); }
.gis-btn-close { appearance: none; background: transparent; border: 0; color: currentColor; cursor: pointer; font-size: 1.5rem; line-height: 1; padding: .25rem .5rem; }
.gis-btn-close::before { content: "❌"; }

.gis-form-control,
.gis-form-select {
    background: #fff !important;
    border: 1px solid #adb5bd;
    border-radius: var(--gis-radius);
    color: var(--gis-color-text) !important;
    display: block;
    min-height: 2.6rem;
    padding: .45rem .7rem;
    width: 100%;
}
.gis-form-select { appearance: auto; }
.gis-form-control.gis-is-valid,
.gis-form-select.gis-is-valid { border-color: var(--gis-color-success); }
.gis-form-control.gis-is-invalid,
.gis-form-select.gis-is-invalid { border-color: var(--gis-color-danger); }
.gis-form-check { align-items: center; display: inline-flex; gap: .45rem; }
.gis-form-check-input { accent-color: var(--gis-color-primary); margin: 0; }

/* #################################################################################################### §03. TABELLE E STATI */
.gis-table { border-collapse: collapse; width: 100%; }
.gis-table th,
.gis-table td { border-bottom: 1px solid var(--gis-color-border); padding: .55rem; vertical-align: middle; }
.gis-table th { font-weight: 700; text-align: inherit; }
.gis-table-hover tbody tr:hover { background: rgb(0 0 0 / 4%); }
.gis-table-success { background-color: #d1e7dd !important; }
.gis-table-danger { background-color: #f8d7da !important; }
.gis-bg-evi { background-color: #ccc !important; }
.gis-bg-green { background-color: #d5fbe9 !important; }
.gis-bg-yellow { background-color: #fff3cd !important; }
.gis-bg-red { background-color: #f8d7da !important; }

/* #################################################################################################### §04. NAVIGAZIONE, DROPDOWN E TAB */
.gis-nav { background: var(--gis-color-primary-dark); color: #fff; position: relative; z-index: var(--gis-z-nav); }
.gis-nav-inner { align-items: center; display: flex; flex-wrap: wrap; gap: .75rem; min-height: 3.5rem; padding: .5rem 1rem; }
.gis-nav-brand { color: inherit; display: inline-flex; text-decoration: none; }
.gis-nav-collapse { margin-left: auto; }
.gis-nav-menu { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.gis-nav-link { color: #fff; display: block; padding: .5rem .75rem; text-decoration: none; }
.gis-nav-toggle { background: transparent; border: 1px solid rgb(255 255 255 / 55%); border-radius: var(--gis-radius); color: #fff; cursor: pointer; display: none; font-size: 1.25rem; margin-left: auto; padding: .25rem .5rem; }
.gis-dropdown { position: relative; }
.gis-dropdown-menu { background: #004949; box-shadow: var(--gis-shadow); display: none; list-style: none; margin: 0; min-width: 12rem; padding: .35rem 0; position: absolute; right: 0; top: 100%; z-index: var(--gis-z-dropdown); }
.gis-dropdown.gis-is-open > .gis-dropdown-menu { display: block; }
.gis-dropdown-item { color: #fff; display: block; padding: .45rem .8rem; text-decoration: none; }
.gis-dropdown-item:hover { background-color: var(--gis-color-primary); }
.gis-tabs { border-bottom: 1px solid var(--gis-color-border); display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.gis-tab { background: transparent; border: 1px solid transparent; border-bottom: 0; color: var(--gis-color-primary); cursor: pointer; padding: .55rem .85rem; }
.gis-tab.gis-is-active { background: #fff; border-color: var(--gis-color-border); color: var(--gis-color-text); }
.gis-tab-panel { display: none; padding: 1.5rem; }
.gis-tab-panel.gis-is-active { display: block; }

/* #################################################################################################### §05. MODAL, FEEDBACK E LOADING */
.gis-modal { align-items: center; background: rgb(0 0 0 / 50%); display: none; inset: 0; justify-content: center; padding: 1rem; position: fixed; z-index: var(--gis-z-modal); }
.gis-modal.gis-is-open { display: flex; }
.gis-modal-dialog { max-height: calc(100vh - 2rem); max-width: min(1140px, 100%); overflow: auto; width: 100%; }
.gis-modal-dialog-sm { max-width: 500px; }
.gis-modal-dialog-lg { max-width: 800px; }
.gis-modal-content { background: #fff; border-radius: var(--gis-radius); box-shadow: var(--gis-shadow); }
.gis-modal-header,
.gis-modal-footer { align-items: center; display: flex; gap: .5rem; padding: 1rem; }
.gis-modal-header { border-bottom: 1px solid var(--gis-color-border); justify-content: space-between; background-color: var(--gis-color-primary); color: #fff; position: sticky; top: 0; z-index: 1; }
.gis-modal-header h5 { margin: 0; font-size: 1.25rem; font-weight: 500; }
.gis-modal-body { padding: 1rem; }
.gis-modal-footer { border-top: 1px solid var(--gis-color-border); justify-content: flex-end; }
.gis-spinner { animation: gis-spin .75s linear infinite; border: .2rem solid rgb(255 255 255 / 40%); border-right-color: currentColor; border-radius: 50%; display: inline-block; height: 1rem; width: 1rem; }
@keyframes gis-spin { to { transform: rotate(360deg); } }

/* #################################################################################################### §06. BREAKPOINT */
@media (min-width: 576px) {
    .gis-col-sm-4 { grid-column: span 4; }
    .gis-hidden-mobile { display: table-cell; }
}
@media (min-width: 992px) {
    .gis-visible-lg { display: inline; }
    .gis-col-lg-2 { grid-column: span 2; }
    .gis-col-lg-3 { grid-column: span 3; }
    .gis-col-lg-4 { grid-column: span 4; }
    .gis-col-lg-5 { grid-column: span 5; }
    .gis-col-lg-6 { grid-column: span 6; }
    .gis-col-lg-9 { grid-column: span 9; }
    .gis-col-lg-10 { grid-column: span 10; }
}
@media (max-width: 575px) {
    .gis-nav-toggle { display: inline-flex; }
    .gis-nav-collapse { flex-basis: 100%; margin-left: 0; }
    .gis-nav-menu { display: none; flex-direction: column; }
    .gis-nav.gis-is-open .gis-nav-menu { display: flex; }
    .gis-dropdown-menu { position: static; }
    .gis-feedback { display: none; }
    .gis-search-box > .gis-row:first-child > .gis-col-lg-3 { display: none; }
    .gis-footer .gis-btn > span { display: none; }
}

}

/* #################################################################################################### §07. STILI LEGACY GIS */

/* Il bordo viene applicato al body solo nelle finestre EXPECT del plugin. */
body {
    margin: 0;
}

body.gis-body-border {
    padding: 20px;
    box-sizing: border-box;
    min-height: 100vh;
}

body.gis-body-border::before {
    content: '';
    position: fixed;
    top: var(--wp-admin--admin-bar--height, 0px);
    left: 0;
    right: 0;
    bottom: 0;
    box-sizing: border-box;
    border: 20px solid #FFA500;
    border-image-source: url('/wp-content/plugins/gis_gest-core/img/brd-warning.png');
    border-image-slice: 640 640;
    border-image-repeat: round round;
    pointer-events: none;
    z-index: 400;
}

body.gis-body-border .gis-app #gis_footer {
    bottom: 20px;
    left: 20px;
    right: 20px;
    height: 75px !important;
    width: auto;
}

@scope (.gis-app, .gis-admin) {

/*

Ver.: 231115.1

MENU

§_01. BLINK

§A_01. ADMIN: TITOLI PAGINA SETTAGGI
§A_02. ADMIN: TABELLA SETTAGGI
§A_03. ADMIN: LOG

§F_01. FRONT: DIV UTILITY - SIPARIO, CORNICE, MENU
§F_02. FRONT: BOX DI RICERCA
§F_03. FRONT: FOOTER
§F_04. FRONT: TABELLA PRINCIPALE
§F_05. FRONT: TABELLA FORNITORI
§F_06. FRONT: FORM PRINCIPALE
§F_07. FRONT: DRAG & DROP
§F_08. FRONT: BOTTONI MOVIMENTI
§F_09. FRONT: CONTEXT MENU
§F_10. FRONT: CLASSE "BLINK"

*/



/* #################################################################################################### §_01. BLINK */
.blink_me {
    animation: gis-blinker 5s linear infinite;
}
@keyframes gis-blinker {
    50% {
        opacity: 0.3;
    }
}


/* #################################################################################################### §A_01. ADMIN: TITOLI PAGINA SETTAGGI */
.gis_tag-settaggi {
    background-color:cornflowerblue;
    padding:10px;
    border-radius:0 30px 30px 0;
    margin-bottom:0;
}


/* #################################################################################################### §A_02. ADMIN: TABELLA SETTAGGI */
.gis_settaggi tr { height: 3em; }
.gis_settaggi tr td { padding:5px; }
.gis_settaggi { border-collapse: collapse; }


/* #################################################################################################### §A_03. ADMIN: LOG */
#log-screen {
    padding: 20px;
    font-size: 15px;
    font-family: 'Courier New', Courier, monospace;
}
.gis_log-sx { /* colonna sinistra */
    float:left;
    width:200px;
}
.gis_log-dx { /* colonna destra */
    float:left;
    width:calc(100% - 200px);
    white-space:normal;
}









/* #################################################################################################### §F_01. FRONT: DIV UTILITY - SIPARIO, CORNICE, MENU */

.sotto-sipario {
    position: absolute;
    background-color:#666;
    opacity:0.9;
    top:0;
    left:0;
    width:100%;
    height:100%;
    z-index: var(--gis-z-sipario-backdrop);
}

.sopra-sipario {
    position: absolute;
    top:0;
    left:0;
    width:100%;
    height:100%;
    z-index: var(--gis-z-sipario-panel);
    display:flex;
    justify-content:center;
    align-items:center;
}

.sopra-sipario div {
    width: 30%;
    min-width: 300px;
    height: 30%;
    min-height: 200px;
    box-sizing: border-box;
    padding:30px;

    border: 20px solid #FFA500;
    border-image-source: url('/wp-content/plugins/gis_gest-core/img/brd-warning.png');
    border-image-slice: 640 640; /* perché l'immagine è un 3x3 fatta da 9 immagini 640x640 */
    border-image-repeat: round round;

    background-color: white;

    overflow-y: auto;
}

.sopra-sipario div h1 span {
    font-size: 25px;
    color:#b27300;
}

/* BORDO EXPECT */

.gis-dropdown-item:hover {
    background-color:#0B7171 !important;
}


/* #################################################################################################### §F_02. FRONT: BOX DI RICERCA */
#gis_src_box {
    background-color:#ccc;
    overflow: hidden;
    z-index: var(--gis-z-search);
}
.ricerca-box-chiuso {
    height: 80px;
}

.gis-body-border .gis-app #gis_src_box {
    /* si ferma appena sotto la cornice fissa invece che sotto top:0 */
    top: calc(var(--wp-admin--admin-bar--height, 0px) + 20px);
}


/* #################################################################################################### §F_03. FRONT: FOOTER */
#gis_footer {
    color: white;
    background-color: #333;
    z-index: var(--gis-z-footer);
}

/* Keep footer action buttons consistent even if theme/plugin styles override .btn
#gis_footer .btn-light {
    color: #212529 !important;
    background-color: #f8f9fa !important;
    border-color: #f8f9fa !important;
}

#gis_footer .btn-secondary {
    color: #fff !important;
    background-color: #6c757d !important;
    border-color: #6c757d !important;
}

#gis_footer .btn-success {
    color: #fff !important;
    background-color: #198754 !important;
    border-color: #198754 !important;
}

#gis_footer .btn-danger {
    color: #fff !important;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}
*/

.foot_wip {
    display: none;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #ffa500;
}

.foot_err {
    display: none;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: red;
    color: white;
    text-align: center;
}


/* #################################################################################################### §F_04. FRONT: TABELLA PRINCIPALE */
.gis-table thead tr th a {
    text-decoration: none;
}

.grosso {
    font-size: x-large;
}

.narrow {
    font-family: "Helvetica Narrow","Arial Narrow",Tahoma,Arial,Helvetica,sans-serif;
}

.bg-evi {
    background-color:#CCC !important; /* GRIGIO */
    /* background-color:#FFC !important; /* GIALLO */
    /* background-color:#FCC !important; /* ROSSO */
}

.bg-green { background-color:#d5fbe9 !important; /* GREEN */ }
.bg-yellow { background-color:#fff3cd !important; /* YELLOW */ }
.bg-red { background-color:#f8d7da !important; /* RED */ }



.idtag {
    font-size: x-small;
    color: #999;

}


/* #################################################################################################### §F_05. FRONT: TABELLA FORNITORI */
.riga-tab-fornitore input {
    width: 100%;
    border: 1px solid #DDDDDD;
}

.tf_term_txt {
    cursor:pointer;
}


/* #################################################################################################### §F_05. FRONT: TABELLA FORNITORI */
.tablav-item input {
    width: 100%;
    border: 1px solid #DDDDDD;
}
.tablavDIS-item input {
    width: 100%;
    border: 1px solid #DDDDDD;
}
.tablavMOV-item input {
    width: 100%;
    border: 1px solid #DDDDDD;
}


/* #################################################################################################### §F_06. FRONT: FORM PRINCIPALE */
#f1_err {
    text-align:center;
    color:red;
    font-weight:bold;
}


/* #################################################################################################### §F_07. FRONT: DRAG & DROP */

.drag-list {
    cursor:move;
}


/* #################################################################################################### §F_08. FRONT: BOTTONI MOVIMENTI */

.btn-mov {
    padding: 10px;
    border: none;
    border-radius:5px;
}

.btn-mov-acc {
    background-color: #005C5E;
    color: white;
}

.btn-mov-spe {
    background-color: #CCC;
    color: #333;
    cursor:move;
}


/* #################################################################################################### §F_09. FRONT: CONTEXT MENU */

#gis_ctx_menu {
    position: fixed;
    z-index: var(--gis-z-context);
    width: 150px;
    background-color: #005C5E;
    border-radius: 3px;
    box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.2);
    padding:5px;
    display: none; /* è sempre nascosto tranne quando lo chiamo */
}

.gis_ctx_item {
    padding: 8px 10px;
    color: white;
    cursor: pointer;
}

.gis_ctx_item:hover {
    background-color: #208484;
}


/* #################################################################################################### §F_10. FRONT: CLASSE "BLINK" */

@keyframes gis-blink {
  50% { opacity: 0.3; }
}
.blink {
    animation: gis-blink 1s steps(1, start) infinite;
}


/* #################################################################################################### §F_11. FRONT: FISARMONICA COSTI */

.gis_chev {
    display: inline-block;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    padding: 3px;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
    vertical-align: middle;
    margin-right: 4px;
    margin-top: 5px;
}
.gis_chev-open {
    transform: rotate(45deg);
}

.gis_row-tot > td:first-child { border-left: 4px solid #997404; padding-left: 6px; }
.gis_row-ann > td:first-child { border-left: 4px solid #0d6efd; padding-left: 6px; }
.gis_row-mes > td:first-child { border-left: 4px solid #0dcaf0; padding-left: 20px; }
.gis_row-doc > td:first-child { border-left: 4px solid #dee2e6; padding-left: 36px; }

}

