/* ==========================================================================
   StoreManager Theme — Flat Minimal
   Inspired by Linear/Vercel design language
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- Base --- */
html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: #fafafa;
    color: #171717;
    font-size: 14px;
    line-height: 1.5;
}

a { color: #2563eb; text-decoration: none; }
a:hover { color: #1d4ed8; }

/* --- Sticky Footer --- */
#wrap {
    min-height: 100%;
    margin: 0 auto -48px;
}

#push, #footer {
    height: 48px;
}

#footer {
    background: #18181b;
    height: 48px;
    line-height: 48px;
    border-top: 1px solid #27272a;
}

#footer p {
    color: #71717a;
    margin: 0;
    padding: 0 24px;
    line-height: 48px;
    font-size: 12px;
    letter-spacing: 0.01em;
}

/* --- Navbar --- */
.navbar-inner {
    background: #18181b;
    background-image: none;
    border: none;
    box-shadow: none;
    border-bottom: 1px solid #27272a;
}

.navbar .brand {
    color: #fafafa;
    font-weight: 600;
    text-shadow: none;
    font-size: 15px;
    letter-spacing: -0.01em;
}

.navbar .nav > li > a {
    color: #a1a1aa;
    text-shadow: none;
    font-size: 13px;
    font-weight: 500;
    transition: color .15s;
}

.navbar .nav > li > a:hover,
.navbar .nav > li > a:focus {
    color: #fafafa;
    background: transparent;
}

.navbar .nav > .active > a,
.navbar .nav > .active > a:hover {
    color: #fafafa;
    background: rgba(255,255,255,.08);
    box-shadow: none;
}

.navbar .nav .dropdown-toggle .caret {
    border-top-color: #a1a1aa;
    border-bottom-color: #a1a1aa;
}

.navbar .nav .dropdown-toggle:hover .caret {
    border-top-color: #fafafa;
    border-bottom-color: #fafafa;
}

/* Stock/Warehouse selector button — navbar inline */
.tmp_btnChangeStock {
    float: left;
    display: inline-block;
    height: 40px;
    line-height: 40px;
    padding: 0 14px;
    margin: 0;
    background: #3f3f46;
    color: #fafafa;
    border: none;
    border-right: 1px solid #52525b;
    text-shadow: none;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s;
}
.tmp_btnChangeStock i {
    margin-right: 4px;
}
.tmp_btnChangeStock:hover {
    background: #52525b;
    color: #fff;
    text-decoration: none;
}

/* Dropdown menus */
.navbar .dropdown-menu {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04);
    padding: 4px;
}

.navbar .dropdown-menu li > a {
    color: #171717;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background .1s;
}

.navbar .dropdown-menu li > a:hover {
    background: #f5f5f5;
    color: #171717;
}

.navbar .dropdown-menu .nav-header {
    color: #a1a1aa;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    padding: 8px 12px 4px;
}

.navbar .dropdown-menu .divider {
    background-color: #e5e5e5;
    border-bottom: none;
    margin: 4px 0;
}

/* --- Breadcrumbs --- */
.breadcrumb {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 12px 0;
    box-shadow: none;
    margin-bottom: 8px;
    font-size: 13px;
}

.breadcrumb a { color: #2563eb; }
.breadcrumb .active { color: #a1a1aa; }
.breadcrumb .divider { color: #d4d4d4; }

/* --- Bootstrap Widget --- */
.bootstrap-widget .bootstrap-widget-header,
.block .block-head {
    background: #fafafa;
    border-bottom: 1px solid #e5e5e5;
    color: #171717;
    font-weight: 600;
}

.block .block-head {
    border: 1px solid #e5e5e5;
    border-radius: 8px 8px 0 0;
}

.block .block-head h3 { color: #171717; }

.block .block-content {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

/* --- Grid View / Tables --- */
.grid-view table.items,
table.items,
.table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.grid-view {
    overflow-x: auto;
}

.grid-view table.items th,
table.items thead th,
.table thead th {
    background: #fafafa;
    color: #737373;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e5e5;
    font-weight: 600;
    padding: 8px 10px;
    white-space: nowrap;
}

.grid-view table.items td,
table.items td,
.table td {
    border-color: #e5e5e5;
    vertical-align: middle;
    padding: 8px 10px;
    font-size: 13px;
    color: #404040;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Colonne che possono andare a capo */
.grid-view table.items td.wrap-cell,
table.items td.wrap-cell {
    white-space: normal;
    max-width: none;
}


.grid-view table.items tr:hover,
table.items tbody tr:hover,
.table tbody tr:hover {
    background: #f0efed;
}

.grid-view table.items tr.odd,
table.items tbody > tr:nth-child(odd) > td,
.table-striped tbody > tr:nth-child(odd) > td {
    background: #f5f5f4;
}

.grid-view table.items tr.odd:hover,
table.items tbody > tr:nth-child(odd):hover > td,
.table-striped tbody > tr:nth-child(odd):hover > td {
    background: #e7e5e4;
}

.grid-view table.items tfoot,
table.items tfoot,
.table tfoot {
    border-top: 1px solid #e5e5e5;
}

/* Grid filter inputs */
.grid-view table thead .filters td {
    padding: 6px 4px;
}

.grid-view table thead .filters input,
.grid-view table thead .filters select,
table.items thead .filters input,
table.items thead .filters select {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 12px;
    background: #fff;
    transition: border-color .15s;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

/* Chosen dropdowns in filters */
.grid-view .chosen-container {
    font-size: 12px;
}

.grid-view .chosen-container .chosen-single {
    height: 28px;
    line-height: 28px;
    padding: 0 6px;
    font-size: 12px;
}

.grid-view table thead .filters input:focus,
table.items thead .filters input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
    outline: none;
}

/* --- Buttons --- */
.btn {
    border-radius: 6px;
    text-shadow: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    transition: all .15s;
    border: 1px solid #e5e5e5;
}

.btn:hover {
    background: #f5f5f5;
}

.btn-primary,
.btn-primary.disabled,
.btn-primary[disabled] {
    background: #2563eb;
    background-image: none;
    border-color: #2563eb;
    color: #fff;
    text-shadow: none;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

.btn-danger,
.btn-danger.disabled,
.btn-danger[disabled] {
    background: #dc2626;
    background-image: none;
    border-color: #dc2626;
    color: #fff;
    text-shadow: none;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.btn-danger.active {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

.btn-success,
.btn-success.disabled,
.btn-success[disabled] {
    background: #16a34a;
    background-image: none;
    border-color: #16a34a;
    color: #fff;
    text-shadow: none;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active,
.btn-success.active {
    background: #15803d;
    border-color: #15803d;
    color: #fff;
}

.btn-info,
.btn-info.disabled,
.btn-info[disabled] {
    background: #0ea5e9;
    background-image: none;
    border-color: #0ea5e9;
    color: #fff;
    text-shadow: none;
}

.btn-info:hover,
.btn-info:focus,
.btn-info:active,
.btn-info.active {
    background: #0284c7;
    border-color: #0284c7;
    color: #fff;
}

.btn-warning,
.btn-warning.disabled,
.btn-warning[disabled] {
    background: #f59e0b;
    background-image: none;
    border-color: #f59e0b;
    color: #fff;
    text-shadow: none;
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active,
.btn-warning.active {
    background: #d97706;
    border-color: #d97706;
    color: #fff;
}

.btn-inverse,
.btn-inverse.disabled,
.btn-inverse[disabled] {
    background: #404040;
    background-image: none;
    border-color: #404040;
    color: #fff;
    text-shadow: none;
}

.btn-inverse:hover,
.btn-inverse:focus,
.btn-inverse:active,
.btn-inverse.active {
    background: #262626;
    border-color: #262626;
    color: #fff;
}

/* --- Pagination --- */
.pagination ul {
    display: flex;
    gap: 2px;
    box-shadow: none;
    border: none;
}

.pagination ul > li > a,
.pagination ul > li > span {
    border-radius: 6px;
    border: 1px solid #e5e5e5;
    color: #525252;
    padding: 6px 12px;
    margin-left: 0;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    transition: all .15s;
}

.pagination ul > li > a:hover {
    background: #f5f5f5;
    border-color: #d4d4d4;
    color: #171717;
}

.pagination ul > .active > a,
.pagination ul > .active > span,
.pagination ul > .active > a:hover {
    background: #171717;
    border-color: #171717;
    color: #fff;
}

/* --- Form focus --- */
input, textarea, select {
    font-family: inherit;
    border-radius: 6px;
}

input:focus,
textarea:focus,
select:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
    outline: none;
}

/* --- Summary box --- */
.summary {
    border: none;
    border-radius: 0;
    padding: 8px 0;
    background: transparent;
    color: #a1a1aa;
    font-size: 12px;
}

/* --- Flash messages --- */
.alert {
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid;
    padding: 12px 16px;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* --- Modal --- */
.modal {
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 16px 48px rgba(0,0,0,.12);
}

.modal-header {
    background: #fff;
    border-bottom: 1px solid #f5f5f5;
    border-radius: 12px 12px 0 0;
    padding: 16px 20px;
}

.modal-header h3 {
    color: #171717;
    font-size: 16px;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    clear: both;
    background: #fafafa;
    border-top: 1px solid #f5f5f5;
    border-radius: 0 0 12px 12px;
    padding: 12px 20px;
}

/* --- Section top — fix overflow --- */
section.top {
    display: block;
    width: 100%;
    margin: 0 0 24px;
    border-bottom: 1px solid #e5e5e5;
    box-shadow: none;
}
section.top .page-header {
    margin-top: 0;
    padding-top: 8px;
    margin-bottom: 12px;
}

/* Only the section containing wide tables should scroll */
section.top:has(table.order),
section.top:has(#table_orderDetail),
section.top:has(#table_fulfillDetail),
section.top:has(.divTableWithFloatingHeader) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.divTableWithFloatingHeader {
    min-width: 100%;
}

/* --- Variant grids (order + fulfill) --- */
#table_orderDetail,
#table_fulfillDetail {
    border-color: #e5e5e5;
}
#table_orderDetail thead th,
#table_fulfillDetail thead th {
    background: #fafafa;
    color: #525252;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-color: #e5e5e5;
    padding: 6px 4px;
    text-align: center;
    vertical-align: middle;
}
#table_orderDetail thead th.tLeft,
#table_fulfillDetail thead th.tLeft {
    text-align: left;
}
#table_orderDetail tbody td,
#table_fulfillDetail tbody td {
    border-color: #e5e5e5;
    padding: 4px;
    vertical-align: top;
    text-align: center;
}
#table_orderDetail tbody td small,
#table_fulfillDetail tbody td small {
    display: block;
    color: #a3a3a3;
    font-size: 9px;
    line-height: 1;
    margin-bottom: 2px;
    float: none;
    clear: none;
}
#table_orderDetail input.tSize,
#table_fulfillDetail input.tSize {
    border: 1px solid #a3a3a3;
    border-radius: 4px;
    background: #fff;
    color: #171717;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 2px;
    width: 100%;
    min-width: 32px;
    box-sizing: border-box;
    float: none !important;
    clear: none !important;
    display: block;
    margin: 0 auto;
    transition: border-color .15s, box-shadow .15s;
}
#table_orderDetail input.tSize:focus,
#table_fulfillDetail input.tSize:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,.15);
    outline: none;
}
#table_orderDetail input.tSize.qnt,
#table_fulfillDetail input.tSize.qnt {
    color: #171717;
}
/* Fulfill: ordinato (blue), ricevuto (gray), inarrivo (editable) */
#table_fulfillDetail input.tSize.ordinato {
    background: transparent;
    border: none;
    color: #2563eb;
    font-weight: 600;
    padding: 2px;
}
#table_fulfillDetail input.tSize.ricevuto {
    background: transparent;
    border: none;
    color: #737373;
    font-size: 11px;
    padding: 1px;
    height: 21px;
}
#table_fulfillDetail input.tSize.inarrivo {
    border: 1px solid #a3a3a3;
    background: #fff;
    color: #171717;
}
#table_fulfillDetail .td-qnt {
    vertical-align: top;
    padding: 4px 2px;
}
/* Compact size columns in variant grids */
#table_orderDetail,
#table_fulfillDetail {
    width: auto;
    min-width: 0;
}
#table_orderDetail thead th:not(.tLeft):not(.tMinWidth):not(.tMid):not(.tLast),
#table_fulfillDetail thead th:not(.tLeft):not(.tMinWidth):not(.tMid):not(.tLast) {
    width: 52px;
    min-width: 42px;
    max-width: 70px;
}
#table_orderDetail tbody td.td-qnt,
#table_fulfillDetail tbody td.td-qnt {
    width: 52px;
    min-width: 42px;
    max-width: 70px;
}
/* Constrain colore + label columns */
#table_fulfillDetail thead th.tLeft:first-of-type {
    width: 90px;
    min-width: 70px;
    max-width: 120px;
}
#table_fulfillDetail thead th.tLeft:nth-of-type(2) {
    width: 60px;
    min-width: 50px;
    max-width: 80px;
}
/* Match body cells to header widths */
#table_fulfillDetail tbody td:nth-child(2) {
    width: 90px;
    min-width: 70px;
    max-width: 120px;
}
#table_fulfillDetail tbody td:nth-child(3) {
    width: 60px;
    min-width: 50px;
    max-width: 80px;
}
/* Fulfill row labels (ordinato / ricevuto / in arrivo) */
#table_fulfillDetail tbody td > div {
    font-size: 10px;
    text-align: right;
    padding-right: 6px;
    white-space: nowrap;
    box-sizing: border-box;
    display: block;
}
#table_fulfillDetail tbody td > div:first-of-type {
    color: #2563eb;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    height: 21px;
    line-height: 21px;
}
#table_fulfillDetail tbody td > div:nth-of-type(2) {
    color: #a3a3a3;
    font-weight: 400;
    height: 21px;
    line-height: 21px;
}
#table_fulfillDetail tbody td > div:nth-of-type(3) {
    color: #171717;
    font-weight: 600;
    height: 28px;
    line-height: 28px;
}
#table_orderDetail input.tSize.tMini,
#table_fulfillDetail input.tSize.tMini {
    font-size: 11px;
    padding: 3px 2px;
    margin-bottom: 1px;
}
#table_orderDetail input.tLast,
#table_orderDetail input.tMid,
#table_fulfillDetail input.tLast,
#table_fulfillDetail input.tMid {
    border: 1px solid #a3a3a3;
    border-radius: 4px;
    background: #fff;
    color: #171717;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 6px;
    box-sizing: border-box;
}
#table_orderDetail input.tLast:focus,
#table_orderDetail input.tMid:focus,
#table_fulfillDetail input.tLast:focus,
#table_fulfillDetail input.tMid:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,.15);
    outline: none;
}
#table_orderDetail input.tFirst,
#table_orderDetail input.tFirstMini,
#table_fulfillDetail input.tFirst,
#table_fulfillDetail input.tFirstMini {
    border: 1px solid #a3a3a3;
    border-radius: 4px;
    background: #fff;
    color: #171717;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 8px;
    box-sizing: border-box;
    float: none !important;
    clear: none !important;
}
#table_orderDetail input:disabled,
#table_orderDetail input[readonly],
#table_fulfillDetail input:disabled,
#table_fulfillDetail input[readonly] {
    background: #f5f5f5;
    color: #404040;
    border-color: #a3a3a3;
    opacity: 1;
    -webkit-text-fill-color: #404040;
    cursor: default;
}
/* Override disabled for fulfill display-only inputs (.hid) */
#table_fulfillDetail input.hid,
#table_fulfillDetail input.hid:disabled,
#table_fulfillDetail input.hid[disabled] {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    opacity: 1;
    padding: 2px;
    height: auto;
    line-height: 1.4;
}
#table_fulfillDetail input.ordinato.hid,
#table_fulfillDetail input.ordinato.hid:disabled {
    -webkit-text-fill-color: #2563eb;
    color: #2563eb !important;
    font-weight: 600;
}
#table_fulfillDetail input.ricevuto.hid,
#table_fulfillDetail input.ricevuto.hid:disabled {
    -webkit-text-fill-color: #737373;
    color: #737373 !important;
    font-size: 11px;
}
/* QNT/Acquisto/Totale: force vertical stacking + align with size cells */
#table_fulfillDetail input.tMid,
#table_fulfillDetail input.tLast {
    display: block !important;
    margin: 0 auto;
    box-sizing: border-box;
}
#table_fulfillDetail input.tMid.hid,
#table_fulfillDetail input.tLast.hid {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    text-align: center;
    padding: 2px;
    line-height: 1.4;
    color: #525252 !important;
    -webkit-text-fill-color: #525252;
    font-weight: 500;
}
/* Match hid row heights with size cells */
#table_fulfillDetail input.hid {
    height: 21px;
}
#table_fulfillDetail input.tSize.inarrivo,
#table_fulfillDetail input.tMid:not(.hid),
#table_fulfillDetail input.tLast:not(.hid) {
    height: 28px;
}
/* Ensure the editable inarrivo inputs stay visible */
#table_fulfillDetail input.inarrivo,
#table_fulfillDetail input.sum-qnt-inarrivo,
#table_fulfillDetail input.sum-tot-inarrivo,
#table_fulfillDetail input.tMid:not(.hid),
#table_fulfillDetail input.tLast.eur:not(.hid) {
    border: 1px solid #a3a3a3 !important;
    background: #fff !important;
    color: #171717 !important;
    -webkit-text-fill-color: #171717;
}
#table_orderDetail tfoot td {
    background: #fafafa;
    font-weight: 600;
    color: #171717;
    border-color: #e5e5e5;
}

/* --- Misc --- */
.well {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: none;
}

/* --- Login page --- */
#login-bg {
    background: #fafafa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#login-bg .login {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    padding: 40px;
    max-width: 380px;
    width: 100%;
}

#login-bg .login h3,
#login-bg .login h2,
#login-bg .login h1 {
    color: #171717;
    font-weight: 700;
    letter-spacing: -0.02em;
}

#login-bg .footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #18181b;
    height: 48px;
    line-height: 48px;
}

#login-bg .footer p {
    color: #71717a;
    font-size: 12px;
    line-height: 48px;
    margin: 0;
    padding: 0 24px;
}

/* ==========================================================================
   Dashboard — Flat Minimal
   ========================================================================== */

/* Period tabs */
.dash-period-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: #f5f5f5;
    padding: 4px;
    border-radius: 8px;
    width: fit-content;
}

.dash-period-tabs button {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #737373;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition: all .15s;
}

.dash-period-tabs button:hover {
    color: #171717;
}

.dash-period-tabs button.active {
    background: #fff;
    color: #171717;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

/* Filters */
.dash-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.dash-filters label {
    font-size: 13px;
    font-weight: 500;
    color: #525252;
}

.dash-filters select {
    padding: 6px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    font-family: inherit;
    color: #171717;
}

/* Composable blocks */
.dash-block {
    margin-bottom: 16px;
    transition: opacity .2s, box-shadow .2s;
}

.dash-block-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px 8px 0 0;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.dash-block-header:active {
    cursor: grabbing;
}

.dash-block-body {
    border: 1px solid #e5e5e5;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 16px;
    background: transparent;
    transition: max-height .3s ease, padding .3s ease, opacity .3s ease;
    overflow: hidden;
}

.dash-block-collapsed .dash-block-header {
    border-radius: 8px;
}

.dash-block-collapsed .dash-block-body {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    border: none;
}

.dash-drag-handle {
    color: #a1a1aa;
    font-size: 14px;
    flex-shrink: 0;
}

.dash-block-title {
    font-size: 12px;
    font-weight: 600;
    color: #737373;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex: 1;
}

.dash-block-toggle {
    background: none;
    border: none;
    color: #a1a1aa;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    transition: background .15s, color .15s;
}

.dash-block-toggle:hover {
    background: #e5e5e5;
    color: #171717;
}

.dash-block-dragging {
    opacity: 0.4;
}

.dash-block-dragover {
    box-shadow: 0 -3px 0 0 #2563eb;
}

.dash-block-body > .dash-kpi-row,
.dash-block-body > .dash-grid,
.dash-block-body > .dash-quick-actions {
    margin-bottom: 0;
}

.dash-block-body > .dash-filters {
    margin-bottom: 0;
}

/* Quick actions */
.dash-quick-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.dash-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    text-decoration: none;
    color: #171717;
    font-size: 13px;
    font-weight: 600;
    transition: all .15s;
    flex: 1;
    min-width: 140px;
}

.dash-action-btn:hover {
    border-color: #d4d4d4;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    text-decoration: none;
    color: #171717;
}

.dash-action-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.dash-action-icon.blue   { background: #eff6ff; color: #2563eb; }
.dash-action-icon.green  { background: #f0fdf4; color: #16a34a; }
.dash-action-icon.amber  { background: #fffbeb; color: #d97706; }
.dash-action-icon.purple { background: #f5f3ff; color: #7c3aed; }

@media (max-width: 600px) {
    .dash-quick-actions { flex-direction: column; }
    .dash-action-btn { min-width: auto; }
}

/* KPI row */
.dash-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 992px) {
    .dash-kpi-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .dash-kpi-row { grid-template-columns: 1fr; }
}

.dash-kpi {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.dash-kpi .kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.dash-kpi .kpi-icon.blue   { background: #eff6ff; color: #2563eb; }
.dash-kpi .kpi-icon.green  { background: #f0fdf4; color: #16a34a; }
.dash-kpi .kpi-icon.amber  { background: #fffbeb; color: #d97706; }
.dash-kpi .kpi-icon.purple { background: #f5f3ff; color: #7c3aed; }

.dash-kpi .kpi-body h3 {
    margin: 0 0 2px;
    font-size: 28px;
    font-weight: 700;
    color: #171717;
    letter-spacing: -0.02em;
    line-height: 1;
}

.dash-kpi .kpi-body p {
    margin: 0;
    font-size: 13px;
    color: #a1a1aa;
    font-weight: 500;
}

.dash-kpi .kpi-delta {
    display: block;
    margin-top: 4px;
    min-height: 16px;
}

a.dash-chart-link {
    text-decoration: none;
    color: inherit;
}

a.dash-chart-link:hover h4 {
    color: #2563eb;
}

a.dash-chart-link h4 {
    transition: color .15s;
}

/* Chart grid */
.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 992px) {
    .dash-grid { grid-template-columns: 1fr; }
}

.dash-chart-box {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 20px;
}

.dash-chart-box h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #171717;
    letter-spacing: -0.01em;
}

.dash-desc {
    margin: 0 0 14px;
    font-size: 12px;
    color: #a1a1aa;
    line-height: 1.4;
}

/* Dashboard tables */
.dash-table {
    width: 100%;
    border-collapse: collapse;
}

.dash-table th {
    background: transparent;
    color: #a1a1aa;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    padding: 8px 12px;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
}

.dash-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f5f5f5;
    color: #404040;
    font-size: 13px;
}

.dash-table tr:last-child td {
    border-bottom: none;
}

.dash-table tr:hover td {
    background: #fafafa;
}

.dash-table .text-right { text-align: right; }
.dash-table .text-center { text-align: center; }

.dash-table .badge-warning {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

/* Loading state */
.dash-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #a1a1aa;
    font-size: 14px;
    gap: 12px;
}

.dash-loading .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e5e5e5;
    border-top-color: #171717;
    border-radius: 50%;
    animation: dash-spin .5s linear infinite;
}

@keyframes dash-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Forms — Modern control-group / labels
   ========================================================================== */

.control-group {
    margin-bottom: 16px;
}

.control-label {
    color: #404040;
    font-weight: 500;
    font-size: 13px;
}

.controls input[type="text"],
.controls input[type="password"],
.controls input[type="email"],
.controls input[type="number"],
.controls input[type="tel"],
.controls input[type="url"],
.controls select,
.controls textarea {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    color: #171717;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.controls input:focus,
.controls select:focus,
.controls textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
    outline: none;
}

.help-inline {
    color: #dc2626;
    font-size: 12px;
}

.control-label.error {
    color: #dc2626;
}

.input-prepend .add-on,
.input-append .add-on {
    border-radius: 6px 0 0 6px;
    border: 1px solid #e5e5e5;
    background: #fafafa;
    color: #737373;
    font-size: 13px;
}

.input-append .add-on {
    border-radius: 0 6px 6px 0;
}

.actions {
    background: transparent;
    border-top: 1px solid #e5e5e5;
    border-radius: 0;
    padding: 16px 20px;
    margin-top: 16px;
    margin-bottom: 16px;
}

/* ==========================================================================
   Blocks / Cards — Container principali
   ========================================================================== */

.block .block_head {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px 8px 0 0;
    box-shadow: none;
    padding: 12px 16px;
    padding-right: 8px;
}

.block .block_content.box {
    border: 1px solid #e5e5e5;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 12px;
}

.block.update .block_head {
    background: #fffbeb;
    border-color: #fde68a;
}

.block.update .block_content.box {
    background: #fffdf7;
    border-color: #fde68a;
}

.block_head h2,
.block_head h3,
.block .block_head h2,
.block .block_head h3 {
    color: #171717;
    text-shadow: none;
    font-weight: 600;
    font-size: 16px;
    border: none;
    padding: 0 4px;
    line-height: 36px;
}

h2 span, h3 span {
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
    border-radius: 999px;
    color: #525252;
    font-weight: 500;
}

h2 span {
    font-size: 14px;
    padding: 2px 10px;
    margin-left: 4px;
}

h3 span {
    font-size: 12px;
    padding: 2px 8px;
    margin-left: 4px;
}

.block_head h2 a.btn,
.block_head h3 a.btn {
    float: right;
    margin-left: 8px;
}

/* ==========================================================================
   Fixed Footer Bar (#div-fixfoot) — Retail/POS
   ========================================================================== */

#div-fixfoot {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid #e5e5e5;
    box-shadow: 0 -1px 3px rgba(0,0,0,.04);
}

#div-fixfoot:hover {
    background: rgba(255,255,255,1);
}

/* ==========================================================================
   Grid View — tfoot
   ========================================================================== */

.grid-view tfoot td {
    background: #fafafa;
    border-top: 1px solid #e5e5e5;
    font-weight: 600;
    font-size: 14px;
    color: #171717;
    height: 40px;
    vertical-align: middle;
    text-align: right;
}

/* ==========================================================================
   Popover — Modernizzare
   ========================================================================== */

.popover {
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 4px 16px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04);
}

.popover-title {
    background: #fff;
    border-bottom: 1px solid #f5f5f5;
    border-radius: 8px 8px 0 0;
    color: #171717;
    font-weight: 600;
    font-size: 13px;
    padding: 10px 14px;
}

.popover-content {
    padding: 12px 16px;
    font-size: 13px;
    color: #404040;
}

/* ==========================================================================
   Highlights / Row Colors — Armonizzare
   ========================================================================== */

.thighlight,
.table-striped tbody tr.thighlight:nth-child(2n+1) td,
.table-striped tbody tr.thighlight:nth-child(2n+1) th,
.table tbody tr.thighlight:hover td,
.table tbody tr.thighlight:hover th {
    background-color: #fefce8 !important;
}

.thighBLU,
.table-striped tbody tr.thighBLU:nth-child(2n+1) td,
.table-striped tbody tr.thighBLU:nth-child(2n+1) th,
.table tbody tr.thighBLU:hover td,
.table tbody tr.thighBLU:hover th {
    background-color: #eff6ff !important;
}

.thighRED,
.table-striped tbody tr.thighRED:nth-child(2n+1) td,
.table-striped tbody tr.thighRED:nth-child(2n+1) th,
.table tbody tr.thighRED:hover td,
.table tbody tr.thighRED:hover th {
    background-color: #fef2f2 !important;
}

.extrarow {
    background-color: #eff6ff !important;
}

table.items tr.selected td,
.items tr.selected {
    background: #fefce8 !important;
}

/* ==========================================================================
   Button Column — Pulizia
   ========================================================================== */

.btn-column a.btn {
    border-radius: 6px;
    border-right: 1px solid #e5e5e5;
    margin: 0 1px;
}

.btn-column a.btn:first-of-type {
    border-radius: 6px;
}

.btn-column a.btn:last-of-type {
    border-radius: 6px;
    border-right: 1px solid #e5e5e5;
}

.btn-column a.btn:first-of-type:last-of-type {
    border-radius: 6px;
}

/* ==========================================================================
   Login — Completare
   ========================================================================== */

#login-form input[type="text"],
#login-form input[type="password"] {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

#login-form .barcode input {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 28px;
    height: 48px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    letter-spacing: 2px;
}

/* ==========================================================================
   Utility — Color helper classes
   ========================================================================== */

.red {
    color: #dc2626 !important;
    font-weight: bold;
}

.green {
    color: #16a34a !important;
    font-weight: bold;
}

.blu {
    color: #2563eb !important;
    font-weight: bold;
}

.tot-ven {
    color: #2563eb;
}

.tot-inc {
    color: #16a34a;
}

.tot-ric {
    color: #15803d;
}

.tot-tot {
    color: #1d4ed8;
}

.tot-sos {
    color: #78716c;
}

.tot-sos-r {
    color: #dc2626;
}

.tot-ord {
    color: #d97706;
}

/* ==========================================================================
   Chosen dropdown focus — armonizzare col tema
   ========================================================================== */

.chzn-container-active .chzn-single {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
    outline: none;
}

/* ==========================================================================
   Print CSS
   ========================================================================== */

@media print {
    .navbar, .navbar-inner,
    #footer, #push,
    .breadcrumb,
    .btn, .btn-group,
    .pagination,
    .grid-view .filters,
    #div-fixfoot {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12px;
    }

    #wrap {
        margin-bottom: 0;
    }

    .block .block_head {
        border: none;
        background: none;
        padding: 4px 0;
    }

    .block .block_content.box {
        border: none;
    }

    table.items td,
    .grid-view table.items td {
        max-width: none;
        white-space: normal;
        font-size: 11px;
        padding: 4px 6px;
    }

    a { color: #000; text-decoration: none; }

    .summary { display: none; }

    .dash-block-header { display: none !important; }
    .dash-block-body { border: none !important; padding: 0 !important; }
    .dash-block-collapsed .dash-block-body { max-height: none; opacity: 1; display: block; }
}
