/* ===================================================
   CBT Anagrafiche – CSS Pulito
   File:	/prokitex/assets/css/app.css
   =================================================== */
   
/* ============================
   VARIABILI
============================ */
:root {
    --bg-app: #eef5f7;
    --bg-login-start: #eef2f6;
    --bg-login-end: #e2e8ef;
    --primary: #2f80ed;
}

/* ============================
   COLONNA AZIONI
============================ */

/* DESKTOP: pulsanti inline e stessa larghezza */
td.col-actions .btn-group {
    display: inline-flex;
    gap: 6px;
}

td.col-actions .btn-group .btn {
    min-width: 100px;
    text-align: center;
}
/* ============================
   COLONNA AZIONI – ICONE ONLY
============================ */
td.col-actions.icon-only .btn-group .btn {
    min-width: auto !important;
    padding: 4px 6px;
}


/* =========================
   INPUT DISABILITATI
========================= */
input:disabled,
textarea:disabled,
select:disabled {
    background-color: #eeeeee !important;
    color: #777 !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

input:disabled:focus,
textarea:disabled:focus,
select:disabled:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* =========================
   SELECT2 DISABILITATA
========================= */
.select2-container--default.select2-container--disabled
.select2-selection--single {
    background-color: #eeeeee !important;
    cursor: not-allowed !important;
    color: #777 !important;
}

/* =========================
   DETAIL TABLE
========================= */
#detailTable {
    table-layout: fixed;
    width: 100% !important;
}

#detailTable th,
#detailTable td {
    vertical-align: middle !important;
}

#detailTable input:disabled,
#detailTable select:disabled,
#detailTable textarea:disabled {
    background-color: #eee !important;
    color: #777 !important;
    cursor: not-allowed;
}

#detailTable input.form-control {
    height: 32px;
    padding: 4px 6px;
}

#detailTable .form-control {
    width: 100% !important;
}

#detailTable .select2-container,
#detailTable .select2-selection {
    width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box;
}

#detailTable .select2-selection--single {
    height: 32px;
}

#detailTable .select2-selection__rendered {
    line-height: 30px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#detailTable select.prodotto {
    display: block !important;
    width: 100% !important;
}

#detailTable tbody tr,
#detailTable tbody tr:focus,
#detailTable tbody tr:focus-visible {
    outline: none !important;
    background-color: transparent !important;
}

#detailTable tbody tr.selected,
#detailTable tbody tr:hover {
    background-color: transparent !important;
}

/* colonne */
.col-product { width: 60%; }
.col-qty     { width: 40px; }
.col-price   { width: 50px; }
.col-total   { width: 210px; }
.col-actions { width: auto; text-align: center; }

/* =========================
   BOTTONI DISABILITATI
========================= */
button:disabled,
.btn:disabled {
    background-color: #cccccc !important;
    border-color: #bbbbbb !important;
    color: #666 !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

/* ============================
   PALETTE
============================ */
body {
    background-color: var(--bg-app);
}

body.login-page {
    background: linear-gradient(
        180deg,
        var(--bg-login-start) 0%,
        var(--bg-login-end) 100%
    );
}

/* ============================
   NAVBAR
============================ */
.page-purchase-detail {
    padding-top: 30px;
}

.navbar-default {
    background-color: #ffffff;
    border: none;
    border-bottom: 1px solid #e1e6eb;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.navbar-default .navbar-brand {
    color: #2f80ed;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.navbar-default .navbar-brand:hover {
    color: #256fcb;
}

.navbar-default .navbar-nav > li > a {
    color: #34495e;
    font-weight: 500;
    padding: 15px 16px;
    transition: background 0.2s ease, color 0.2s ease;
}

.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
    background-color: #f3f6f9;
    color: #2f80ed;
}

.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
    background-color: #e9f1fe;
    color: #2f80ed;
    font-weight: 600;
    border-bottom: 2px solid #2f80ed;
}

/* ============================
   BOTTONI
============================ */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #256fcb;
    border-color: #256fcb;
}

/* ============================
   TABELLE
============================ */
.table thead th {
    background-color: #f3f6f9;
    border-bottom: 2px solid #dcdfe3;
}

/* ============================
   LOGIN
============================ */
html, body {
    height: 100%;
}

/* wrapper centrale */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* card login */
.panel-login {
    width: 100%;
    max-width: 380px;
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.18);
    border: 1px solid #ddd;
}

/* contenuto */
.panel-login .panel-body {
    padding: 28px;
}

/* logo */
.login-logo {
    max-width: 240px;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 18px;
}

/* footer */
.login-footer {
    margin-top: 18px;
    font-size: 12px;
    color: #999;
    text-align: center;
}

/* ============================
   PAGE CARD
============================ */
.page-wrapper {
    padding: 90px 10px 30px;
}

.page-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    padding: 24px;
}

/* header pagina */
.page-header {
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e6ea;
}

.page-header h1 {
    font-size: 22px;
    margin: 0;
    font-weight: 600;
}

/* contenuto */
.page-content {
    margin-top: 20px;
}

/* ============================
   ORDER / SELECT2
============================ */
.form-group .select2-container,
#productSelectModal .select2-container {
    width: 100% !important;
}

#productSelectModal .select2-search__field {
    width: 100% !important;
    min-width: 100%;
}

.select2-container .select2-selection--single { height: 34px; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 34px; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 34px; }

.btn-touch { padding: 10px 12px; }

/* Evidenziazione errori */
.has-error input,
.has-error select,
.has-error .select2-selection {
    border-color: #d9534f !important;
}

.row-error {
    border-color:#a94442 !important;
    box-shadow: 0 0 0 1px rgba(169,68,66,0.2);
}

/* ============================
   DATATABLES
============================ */
.dataTables_wrapper {
    margin-top: 10px;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 12px;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 4px;
    border: 1px solid #ccc;
    padding: 4px 8px;
    margin-left: 6px;
}

.dataTables_wrapper .dataTables_info {
    font-size: 13px;
    color: #666;
    padding-top: 8px;
}

.dataTables_wrapper .pagination > li > a,
.dataTables_wrapper .pagination > li > span {
    padding: 6px 12px;
    border-radius: 4px;
}

.dataTables_wrapper .pagination > .active > a {
    background-color: #2f80ed;
    border-color: #2f80ed;
    color: #fff;
}

/* hover SOLO per tabelle NON scrollX */
.table:not(#detailTable) tbody tr:hover {
    background-color: #f6f9fc;
}

/* colonna azioni */
.table td:last-child {
    white-space: nowrap;
}

/* bottoni azione */
.table .btn-xs {
    padding: 4px 8px;
}

/* ============================
   UTILITIES
============================ */
.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-18 { margin-top: 18px; }

.mb-0 { margin-bottom: 0 !important; }
.mb-6 { margin-bottom: 6px; }
.mb-10 { margin-bottom: 10px; }
.mb-18 { margin-bottom: 18px; }

.p-10 { padding: 10px; }
.w-100 { width: 100%; }

.half-btn { width: 49%; }
.text-normal { font-weight: normal; }

/* ============================
   MODALI
============================ */
.modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 18px 40px rgba(0,0,0,0.25);
}

.modal-header {
    background-color: #f3f6f9;
    border-bottom: 1px solid #e1e6eb;
    border-radius: 8px 8px 0 0;
}

.modal-title {
    font-weight: 600;
    color: #2f80ed;
}

.modal-header .close {
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.modal-header .close:hover {
    opacity: 0.8;
}

.modal-body {
    padding: 24px;
    background-color: #ffffff;
}

.modal-footer {
    border-top: 1px solid #e1e6eb;
    background-color: #fafbfd;
    border-radius: 0 0 8px 8px;
}

.modal-footer .btn {
    min-width: 110px;
    font-weight: 500;
}

@media (min-width: 992px) {
    .modal-lg {
        width: 90%;
        max-width: 1100px;
    }
}

.modal-body table {
    margin-bottom: 0;
}

.modal-body .table thead th {
    background-color: #f3f6f9;
}

/* ============================
   FORM CONTROLS
============================ */
.form-control {
    border-radius: 6px;
    border: 1px solid #ccd3da;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(47,128,237,0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

label {
    font-weight: 600;
    color: #34495e;
}

.form-group {
    margin-bottom: 16px;
}

.select2-container--default.select2-container--focus
.select2-selection--single {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(47,128,237,0.15);
}

.btn-default {
    border-radius: 6px;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-default:hover {
    background-color: #f3f6f9;
}

/* ============================
   DASHBOARD KPI
============================ */
.kpi-card {
    background: #fff;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 20px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.kpi-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 600;
}

.kpi-primary { border-left: 4px solid #2f80ed; }
.kpi-success { border-left: 4px solid #27ae60; }
.kpi-info    { border-left: 4px solid #17a2b8; }
.kpi-warning { border-left: 4px solid #f39c12; }

.table > tbody > tr.success {
    background-color: #e9f9ef;
}

.table > tbody > tr.success:hover {
    background-color: #dff3e7;
}

.kpi-label {
    font-size: 12px;
    color: #777;
    margin-top: 4px;
}

/* ============================
   FIX OVERFLOW
============================ */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

.table-actions {
    position: relative;
}

/* ============================
   DESKTOP
============================ */
@media (min-width: 768px) {
    #rowsCards { display: none; }
    #detailTable_wrapper { display: block; }
}

/* ============================
   MOBILE
============================ */
@media (max-width: 767px) {

    /* sticky bar */
    #stickyBar {
        display: block !important;
        position: fixed !important;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        border-top: 1px solid #ddd;
        padding: 10px;
        z-index: 9999;
        box-shadow: 0 -2px 6px rgba(0,0,0,.08);
    }

    #stickyBar .btn {
        width: 100%;
        font-size: 16px;
        padding: 12px;
    }

    #stickyBar .tot {
        font-size:16px;
        font-weight:bold;
    }

    .page-wrapper {
        padding-bottom: 90px;
    }

    /* spazio sotto contenuto per non coprire l'ultima card */
    .page-card {
        padding-bottom: 90px;
    }

    /* DATATABLE vs CARDS */
    #detailTable_wrapper { display: none !important; }
    #rowsCards { display: block; }
    #detailTable { table-layout: auto; }
    #rowsCards { display: block !important; }

    /* AZIONI MOBILE */
    td.col-actions .btn-group {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 80%;
    }

    td.col-actions .btn-group .btn {
        width: 100%;
        margin-bottom: 6px;
        text-align: center;
    }

    td.col-actions .btn-group .btn:last-child {
        margin-bottom: 0;
    }

    /* TOOLBAR IN ALTO */
    .page-card > .btn-toolbar {
        position: sticky;
        top: 50px;
        z-index: 900;
        background: #fff;
        padding: 10px 0;
        border-bottom: 1px solid #ddd;
        box-shadow: 0 2px 6px rgba(0,0,0,.05);
    }

    .page-card > .btn-toolbar .btn-group,
    .page-card > .btn-toolbar .btn {
        width: 100%;
    }

	
}
	/* ============================
	   CBT – CARD MOBILE STANDARD
	============================ */
	.order-card-footer {
		display: flex;
		justify-content: flex-end;
	}


/* ============================
   ORDER DETAIL – HEADER
============================ */
.order-header {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.order-header label {
    font-weight: 600;
}

.order-header .form-control {
    height: 34px;
}

#orderStatus {
    margin-left: 10px;
    font-size: 13px;
    vertical-align: middle;
}

/* ============================
   SELECT2 FIX
============================ */
#detailTable .select2-container--bootstrap
.select2-selection--single:focus,
#detailTable .select2-container--bootstrap
.select2-selection--single.select2-selection--focus {
    background-color: #fff !important;
    box-shadow: none !important;
    outline: none !important;
}

.select2-results__option--highlighted,
.select2-container--default
.select2-results__option--highlighted[aria-selected] {
    background-color: #e9f1fe !important;
    color: #2f80ed !important;
}

.select2-dropdown {
    min-width: 360px !important;
    max-width: 360px !important;
}

/* ============================
   SELECT2 MODALE
============================ */
#productSelectModal .select2-search__field {
    width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box;
}

#productSelectModal .select2-container {
    width: 100% !important;
}

#productSelectModal .select2-selection--single {
    display: flex !important;
    align-items: center;
}

/* ============================
   SELECT2 ISOLAMENTO
============================ */
.select2-container input {
    width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box;
}

/* ============================
   ORDER DETAIL – MOBILE CARDS
============================ */
.order-card {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 14px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    overflow: hidden;
}

.order-card-header {
    background: #f3f6f9;
    padding: 10px 12px;
    border-bottom: 1px solid #e1e6eb;
}

.order-card-header .product {
    font-weight: 600;
    font-size: 14px;
    color: #34495e;
}

.order-card-body {
    display: flex;
    gap: 10px;
    padding: 12px;
}

.order-card-body .field {
    flex: 1;
}

.order-card-body label {
    font-size: 11px;
    color: #777;
    margin-bottom: 4px;
}

.order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-top: 1px solid #eee;
    background: #fafbfd;
}

.order-card-footer .totale {
    font-size: 14px;
}

/* ============================
   INPUT NUMERICI
============================ */
input[type="number"],
input.qty,
input.prezzo {
    text-align: right;
}
/* Badge arancione - Bootstrap 3 */
.badge-orange {
    background-color: #ff9800 !important;
    color: #ffffff !important;
}
/* Riduce leggermente il testo delle DataTables */
table.dataTable {
    font-size: 13.5px;
}
/* ======================================================
   USERS TABLE – NO SCROLL ORIZZONTALE
====================================================== */

/* I bottoni possono andare a capo */
.user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* Evita che i bottoni forzino la larghezza */
.user-actions .btn {
    white-space: nowrap;
}

/* Permette alle celle di restringersi */
#usersTable td,
#usersTable th {
    white-space: normal !important;
}

/* Colonna azioni: non deve avere larghezza fissa */
#usersTable .col-actions {
    width: 1%;
    white-space: normal !important;
}
/* ==========================
   FOOTER CBT OrderManager
========================== */

.app-footer {
    margin-top: 20px;
    padding: 10px 0;
    border-top: 1px solid #e5e5e5;
    background: #fff;
}

.footer-logo-img {
    max-height: 32px;
    width: auto;
    margin: 0 auto 6px;
    display: block;
    opacity: 0.85;
}

.footer-text {
    font-size: 12px;
    color: #777;
}

.footer-text a {
    color: #337ab7;
    text-decoration: none;
    font-weight: 600;
}

.footer-text a:hover {
    text-decoration: underline;
}
/* ============================
   CBT – Card anagrafiche
============================ */
.order-card-footer.actions-only {
    justify-content: flex-end;
}
/* =========================
   DESKTOP
========================= */
@media (min-width: 768px) {

    .cards-container {
        display: none !important;
    }

    .datatable-container {
        display: block !important;
    }
}

/* =========================
   MOBILE
========================= */
@media (max-width: 767px) {

    .datatable-container {
        display: none !important;
    }

    .cards-container {
        display: block !important;
    }
}
/* evita sovrapposizione badge mobile */
.order-state,
.order-badge{
  display:inline-block;
  line-height:1.4;
  margin-top:4px;
}
/* Navbar: voci disabilitate per permessi */
.navbar .disabled-nav > a {
    color: #999 !important;
    cursor: not-allowed;
    pointer-events: none;
    background-color: transparent !important;
    opacity: 0.6;
}
