/* Bridge AdminLTE / Bootstrap 3 markup → Velzon / Bootstrap 5 */

/* Grid: restore BS3 xs columns */
.col-xs-1 { flex: 0 0 auto; width: 8.33333333%; }
.col-xs-2 { flex: 0 0 auto; width: 16.66666667%; }
.col-xs-3 { flex: 0 0 auto; width: 25%; }
.col-xs-4 { flex: 0 0 auto; width: 33.33333333%; }
.col-xs-5 { flex: 0 0 auto; width: 41.66666667%; }
.col-xs-6 { flex: 0 0 auto; width: 50%; }
.col-xs-7 { flex: 0 0 auto; width: 58.33333333%; }
.col-xs-8 { flex: 0 0 auto; width: 66.66666667%; }
.col-xs-9 { flex: 0 0 auto; width: 75%; }
.col-xs-10 { flex: 0 0 auto; width: 83.33333333%; }
.col-xs-11 { flex: 0 0 auto; width: 91.66666667%; }
.col-xs-12 { flex: 0 0 auto; width: 100%; }

.pull-right { float: right !important; }
.pull-left { float: left !important; }
.clearfix { clear: both; }
.img-responsive { max-width: 100%; height: auto; display: block; }
.img-circle { border-radius: 50%; }
.center-block { display: block; margin-left: auto; margin-right: auto; }
.hidden { display: none !important; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.hidden-xs { display: none !important; }
@media (min-width: 768px) {
    .hidden-xs { display: initial !important; }
}
.visible-xs { display: block !important; }
@media (min-width: 768px) {
    .visible-xs { display: none !important; }
}

/* Labels → badges */
.label {
    display: inline-block;
    padding: .25em .5em;
    font-size: 75%;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: .25rem;
    background: #6c757d;
}
.label-default { background: #6c757d; }
.label-primary { background: #00388d; }
.label-success, .bg-green, .bg-success { background-color: #008d4c !important; color: #fff !important; }
.label-info, .bg-aqua, .bg-info { background-color: #3c8dbc !important; color: #fff !important; }
.label-warning, .bg-yellow, .bg-warning { background-color: #f39c12 !important; color: #fff !important; }
.label-danger, .bg-red, .bg-danger { background-color: #dd4b39 !important; color: #fff !important; }

/* AdminLTE boxes → cards */
.box,
.box.box-default,
.box.box-primary,
.box.box-success,
.box.box-warning,
.box.box-danger,
.box.box-info {
    position: relative;
    background: #fff;
    border: 1px solid #c5d0e0;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 18px rgba(15, 34, 58, 0.1);
    width: 100%;
}
.box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #d7e0ec;
    background: linear-gradient(180deg, #f7f9fc 0%, #eef3f9 100%);
    color: #495057;
    border-radius: 12px 12px 0 0;
}
.box-header.with-border { border-bottom: 1px solid #d7e0ec; }
.box-title {
    display: inline-block;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: #00388d;
    letter-spacing: -0.01em;
}
.box-tools { margin-left: auto; }
.box-body {
    padding: 1.25rem;
    background: #fff;
    overflow: auto;
}
.box-body::after {
    content: "";
    display: table;
    clear: both;
}
.box-body.no-padding { padding: 0; }
.box-body.with-border {
    border-bottom: 1px solid #e4ebf4;
    background: #f8fafc;
}
.box-footer {
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #d7e0ec;
    border-radius: 0 0 12px 12px;
}
.box-primary { border-top: 3px solid #00388d; }
.box-success { border-top: 3px solid #008d4c; }
.box-warning { border-top: 3px solid #f39c12; }
.box-danger { border-top: 3px solid #dd4b39; }
.box-info { border-top: 3px solid #3c8dbc; }
.btn-box-tool {
    background: transparent;
    border: 0;
    color: #878a99;
    padding: .15rem .35rem;
}

/* Small boxes */
.small-box {
    border-radius: 12px;
    position: relative;
    display: block;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 12px rgba(15, 34, 58, 0.08);
    color: #fff !important;
    overflow: hidden;
}
.small-box > .inner { padding: 1.1rem 1.25rem; }
.small-box h3 {
    font-size: 1.7rem;
    font-weight: 700;
    margin: 0 0 .35rem;
    white-space: nowrap;
    padding: 0;
    color: inherit;
}
.small-box p { font-size: .95rem; margin: 0; color: inherit; }
.small-box .icon {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 4rem;
    opacity: .18;
}
.small-box-footer {
    display: block;
    padding: .55rem 0;
    text-align: center;
    color: rgba(255, 255, 255, .9) !important;
    background: rgba(0, 0, 0, .08);
    text-decoration: none;
}
.small-box-footer:hover { color: #fff !important; background: rgba(0, 0, 0, .14); }

/* Content shell leftovers */
.content-wrapper,
.content-header,
section.content {
    background: transparent;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}
.content-header > h1 { display: none; }
.main-footer { display: none; }
.control-sidebar,
.control-sidebar-bg { display: none !important; }

/* Forms BS3 */
.form-group { margin-bottom: 1rem; }
.has-feedback { position: relative; }
.form-control-feedback {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    display: block;
    width: 34px;
    height: 34px;
    line-height: 34px;
    text-align: center;
    pointer-events: none;
    color: #878a99;
}
.help-block {
    display: block;
    margin-top: .25rem;
    color: #dd4b39;
    font-size: .8125rem;
}
.has-error .form-control,
.form-control.is-invalid {
    border-color: #dd4b39;
}
.has-success .form-control {
    border-color: #008d4c;
}
.input-group {
    flex-wrap: nowrap;
}
.input-group-addon,
.input-group > .input-group-text {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .375rem .75rem;
    min-width: 2.5rem;
    background: #eff2f7;
    border: 1px solid #ced4da;
    color: #495057;
    font-size: .875rem;
    white-space: nowrap;
}
.input-group-addon i,
.input-group-addon .fa,
.input-group-addon .glyphicon,
.input-group-addon [class^="ri-"],
.input-group-text i,
.input-group-text .fa,
.input-group-text .glyphicon,
.input-group-text [class^="ri-"] {
    display: inline-block;
    font-size: 1rem;
    line-height: 1;
    color: #878a99;
    vertical-align: middle;
}
.input-group > .input-group-addon:first-child,
.input-group > .input-group-text:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 0;
    border-top-left-radius: var(--vz-border-radius, .25rem);
    border-bottom-left-radius: var(--vz-border-radius, .25rem);
}
.input-group > .form-control:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.input-group > .input-group-addon:last-child,
.input-group > .input-group-text:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 0;
    border-top-right-radius: var(--vz-border-radius, .25rem);
    border-bottom-right-radius: var(--vz-border-radius, .25rem);
}
.input-group > .form-control:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.input-group-btn {
    display: flex;
    align-items: stretch;
}
.input-group-btn > .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Buttons */
.btn-default,
.btn-flat {
    color: #495057;
    background: #fff;
    border: 1px solid #dbe0e6;
}
.btn-default:hover { background: #f3f6f9; }
.btn-block { display: block; width: 100%; }

/* BS3 btn-xs restored — BS5 dropped it, legacy grids rely on it */
.btn-xs,
.btn-group-xs > .btn {
    --vz-btn-padding-y: .2rem;
    --vz-btn-padding-x: .4rem;
    --vz-btn-font-size: .72rem;
    --vz-btn-border-radius: .3rem;
    padding: .2rem .4rem;
    font-size: .72rem;
    line-height: 1.2;
    border-radius: .3rem;
}

/* Compact action buttons in GridView / tables */
.grid-view td .btn-xs,
.kv-grid-table td .btn-xs,
.table td .btn-xs,
.box-body .table td .btn-xs,
.grid-actions .btn-xs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    margin: 0 1px;
    border-radius: 6px;
    line-height: 1.2;
    box-shadow: none !important;
    vertical-align: middle;
}

/* Icon-only action buttons → compact soft squares.
   :only-child ignores text nodes, so <i></i> Aggiungi would match: skip .btn-block and buttons with a label span. */
.grid-view td .btn-xs:has(> i:only-child):not(.btn-block):not(:has(span)),
.kv-grid-table td .btn-xs:has(> i:only-child):not(.btn-block):not(:has(span)),
.table td .btn-xs:has(> i:only-child):not(.btn-block):not(:has(span)),
.box-body .table td .btn-xs:has(> i:only-child):not(.btn-block):not(:has(span)),
.grid-actions .btn-xs:has(> i:only-child):not(.btn-block):not(:has(span)) {
    width: 26px;
    height: 26px;
    min-width: 26px;
    padding: 0;
}

.grid-view td .btn-xs.btn-primary,
.kv-grid-table td .btn-xs.btn-primary,
.table td .btn-xs.btn-primary,
.box-body .table td .btn-xs.btn-primary,
.grid-actions .btn-xs.btn-primary {
    color: #00388d !important;
    background: #e8eef8 !important;
    border: 1px solid transparent !important;
}
.grid-view td .btn-xs.btn-primary:hover,
.kv-grid-table td .btn-xs.btn-primary:hover,
.table td .btn-xs.btn-primary:hover,
.box-body .table td .btn-xs.btn-primary:hover,
.grid-actions .btn-xs.btn-primary:hover {
    color: #fff !important;
    background: #00388d !important;
}
.grid-view td .btn-xs.btn-danger,
.kv-grid-table td .btn-xs.btn-danger,
.table td .btn-xs.btn-danger,
.box-body .table td .btn-xs.btn-danger,
.grid-actions .btn-xs.btn-danger {
    color: #dd4b39 !important;
    background: #fbecea !important;
    border: 1px solid transparent !important;
}
.grid-view td .btn-xs.btn-danger:hover,
.kv-grid-table td .btn-xs.btn-danger:hover,
.table td .btn-xs.btn-danger:hover,
.box-body .table td .btn-xs.btn-danger:hover,
.grid-actions .btn-xs.btn-danger:hover {
    color: #fff !important;
    background: #dd4b39 !important;
}
.grid-view td .btn-xs.btn-success,
.kv-grid-table td .btn-xs.btn-success,
.table td .btn-xs.btn-success {
    color: #008d4c !important;
    background: #e6f5ee !important;
    border: 1px solid transparent !important;
}
.grid-view td .btn-xs.btn-warning,
.kv-grid-table td .btn-xs.btn-warning,
.table td .btn-xs.btn-warning,
.box-body .table td .btn-xs.btn-warning,
.grid-actions .btn-xs.btn-warning {
    color: #b9770e !important;
    background: #fef5e6 !important;
    border: 1px solid transparent !important;
}
.grid-view td .btn-xs.btn-warning:hover,
.kv-grid-table td .btn-xs.btn-warning:hover,
.table td .btn-xs.btn-warning:hover,
.grid-actions .btn-xs.btn-warning:hover {
    color: #fff !important;
    background: #f39c12 !important;
}
.grid-view td .btn-xs.btn-info,
.kv-grid-table td .btn-xs.btn-info,
.table td .btn-xs.btn-info,
.box-body .table td .btn-xs.btn-info,
.grid-actions .btn-xs.btn-info {
    color: #3c8dbc !important;
    background: #e8f4fa !important;
    border: 1px solid transparent !important;
}
.grid-view td .btn-xs.btn-info:hover,
.kv-grid-table td .btn-xs.btn-info:hover,
.table td .btn-xs.btn-info:hover,
.grid-actions .btn-xs.btn-info:hover {
    color: #fff !important;
    background: #3c8dbc !important;
}
.grid-view td .btn-xs .fa,
.grid-view td .btn-xs .ri,
.grid-view td .btn-xs i,
.kv-grid-table td .btn-xs .fa,
.kv-grid-table td .btn-xs .ri,
.kv-grid-table td .btn-xs i,
.table td .btn-xs .fa,
.table td .btn-xs .ri,
.table td .btn-xs i,
.box-body .table td .btn-xs i,
.grid-actions .btn-xs i {
    font-size: 12px !important;
    line-height: 1 !important;
    width: auto;
    margin: 0 !important;
}

/* Status / inline FA icons in list cells */
.grid-view td > .fa,
.grid-view td > a > .fa,
.kv-grid-table td > .fa,
.kv-grid-table td > a > .fa,
.table td > .fa,
.table td > a.btn-link .fa,
.table td a:not(.btn) > .fa {
    font-size: 13px !important;
    line-height: 1;
    vertical-align: middle;
}
.grid-view td .fa.center-block,
.kv-grid-table td .fa.center-block,
.table td .fa.center-block {
    display: inline-block;
    font-size: 14px !important;
    width: auto;
    margin: 0 auto;
}

/* Action button groups in rows */
.grid-view td span[style*="nowrap"],
.kv-grid-table td span[style*="nowrap"],
.grid-actions {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

/* Selection checkbox always sits in the last column */
th.kv-row-select,
td.kv-row-select {
    width: 2.75rem;
    text-align: center !important;
    white-space: nowrap;
    vertical-align: middle !important;
}

/* Tables / panels */
.table > thead > tr > th,
.table > tbody > tr > th,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > tbody > tr > td,
.table > tfoot > tr > td {
    vertical-align: middle;
}
.panel {
    background: #fff;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(15, 34, 58, 0.06);
    margin-bottom: 1.25rem;
}
.panel-heading {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #eef2f7;
    font-weight: 600;
}
.panel-body { padding: 1.25rem; }
.well {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: .5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}
.nav-stacked > li > a {
    display: block;
    padding: .75rem 1rem;
    color: inherit;
    text-decoration: none;
}
.nav-stacked > li > a:hover { background: #f3f6f9; }

/* Modal BS3 attrs still present in markup */
.modal-backdrop.show { opacity: .5; }
.modal-dialog.modal-md { max-width: 500px; }
.close {
    float: right;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    opacity: .5;
    background: transparent;
    border: 0;
}
.close:hover { opacity: .75; }

/* Kartik / Select2 z-index under Velzon topbar */
.select2-dropdown,
.select2-container--open { z-index: 2050 !important; }
.datepicker,
.bootstrap-datetimepicker-widget { z-index: 2060 !important; }

/* Pagination BS3 */
.pagination > li { display: inline; }
.pagination > li > a,
.pagination > li > span {
    position: relative;
    float: left;
    padding: .375rem .75rem;
    margin-left: -1px;
    line-height: 1.5;
    color: #00388d;
    text-decoration: none;
    background-color: #fff;
    border: 1px solid #dee2e6;
}
.pagination > .active > a,
.pagination > .active > span {
    z-index: 3;
    color: #fff;
    background-color: #00388d;
    border-color: #00388d;
}
