body { padding-top: 62px; background: #fff; }
body.bg-arrears { background: lightcoral; }
body.bg-inpost { background: #edffdb; }

.nav-search { background: #212121; border-color: transparent; color: #fff; width: 9.5rem; }
.nav-search::placeholder { color: #aaa; }
.nav-search:focus { background: #2d2d2d; color: #fff; }

kbd { font-size: .7em; }
.key-hint { font-size: .7rem; text-align: center; opacity: .55; margin-top: 2px; }

/* Icone cliccabili */
.icon-btn { background: none; border: 0; padding: 2px 6px; color: inherit; cursor: pointer; font-size: 1.3em; line-height: 1; display: inline-block; text-decoration: none; }
.icon-btn.big { font-size: 1.9em; }
.icon-btn:hover, .icon-btn:focus-visible { color: #e00; }
.icon-btn.dim { opacity: .2; }
.icon-btn.dim:hover { opacity: 1; }
.icon-btn.on { color: #198754; }
.icon-btn.disabled { opacity: .2; cursor: not-allowed; }
.icon-btn.disabled:hover { color: inherit; }
.bi.dim { opacity: .2; }
.doc-number { font-size: 1.4rem; font-weight: 600; }

.table-dark a { color: #fff; font-weight: 600; }
.table-dark a:hover { color: #ffe200; }
.text-paid td { color: darkseagreen !important; }
.customer-note { color: darkorange; }

.stat-panel { background: #eaeaea; padding: 12px; border-radius: 6px; }
.stat { display: flex; flex-direction: column; margin-bottom: 10px; }
.stat-label { font-size: 1.05rem; font-weight: 600; }
.stat-value { font-size: 1.9rem; line-height: 1.1; }
.big-total { font-size: 2.6rem; font-weight: 700; }

.order-status td { vertical-align: middle; }
.order-description .description-input { display: inline-block; width: auto; min-width: 16rem; }
.payment-panel { background: #f6f6f6; border: 1px solid #ddd; border-radius: 8px; padding: 8px 12px; }
.paylink-field { width: 22rem; max-width: 100%; }
.tracking-group { min-width: 18rem; }

#detailAddRow { background: #343a40; }
#detailAddRow.editing { background: #9a1b1e; }
#detailAddRow .form-control, #detailAddRow .form-select { min-width: 5.5rem; }
.details-table .tag-input { width: 6rem; }
.archived-order { margin-top: 10px; }

.shipping-banner { position: sticky; bottom: 0; z-index: 1020; background: #ffbf00; color: #000; text-align: center; padding: 10px 15px; font-size: 1.15em; font-weight: bold; box-shadow: 0 -2px 6px rgba(0,0,0,.2); }

/* Righe delle pagine di lavorazione (stessi colori del vecchio gestionale) */
.work-table tr.row-m > * { background-color: #3eb249 !important; }
.work-table tr.row-l > * { background-color: #009b93 !important; }
.work-table tr.row-xl > * { background-color: #b24926 !important; }
.work-table tr.row-king > * { background-color: #41586b !important; }
.work-table tr.removing { opacity: .3; transition: opacity .3s; }

/* Ricerca tag grande per tablet */
.tablet-tag-search { position: sticky; top: 62px; z-index: 1000; margin: 4px auto 14px; padding: 10px; background: rgba(255,255,255,.96); border: 1px solid #ddd; border-radius: 12px; box-shadow: 0 3px 12px rgba(0,0,0,.12); max-width: 760px; }
.tablet-tag-search input { height: 58px; font-size: 28px; font-weight: 600; text-align: center; }
.tablet-tag-search button { min-width: 100px; font-size: 24px; }
.tablet-tag-search .hint { margin-top: 5px; text-align: center; font-size: 13px; color: #777; }

/* Su tablet e telefono le tabelle dettagli e lavorazioni diventano schede */
@media (max-width: 991.98px) {
    .details-table thead, .work-table thead { display: none; }
    .details-table tbody tr, .work-table tbody tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 10px; margin-bottom: 10px; border-radius: 12px; background: #343a40; }
    .details-table tbody td, .work-table tbody td { display: flex; flex-direction: column; justify-content: center; border: 0; padding: 6px !important; overflow-wrap: anywhere; min-height: 56px; }
    .details-table tbody td::before, .work-table tbody td::before { content: attr(data-label); font-size: 11px; text-transform: uppercase; opacity: .65; margin-bottom: 4px; letter-spacing: .04em; }
    .details-table tfoot tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 10px; border-radius: 12px; }
    .details-table tfoot td { border: 0; }
    .details-table .tag-input { width: 100%; min-height: 44px; font-size: 19px; }
    .icon-btn.big { font-size: 2.2em; }
    .order-status, .order-status tbody, .order-status tr { display: block; }
    .order-status thead { display: none; }
    .order-status td { display: inline-block; border: 1px solid #ddd; border-radius: 10px; margin: 4px; padding: 10px !important; min-width: 120px; }
    .order-status td::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; opacity: .6; margin-bottom: 4px; }
}
@media (max-width: 575.98px) {
    .details-table tbody tr, .work-table tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.login-page { background: #f2f2f2; padding-top: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-box { background: #fff; padding: 32px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.08); width: 100%; max-width: 380px; margin: 16px; }
.login-logo { display: block; width: 180px; max-width: 100%; margin: 0 auto 16px; }
