/* ADCRM + AdminLTE 3.2
   Aquest fitxer només adapta les vistes existents del CRM a AdminLTE.
   La base visual real és /assets/vendor/adminlte/dist/css/adminlte.min.css
*/
:root {
    --adcrm-primary: #007bff;
    --adcrm-primary-dark: #0056b3;
    --adcrm-success: #28a745;
    --adcrm-danger: #dc3545;
    --adcrm-warning: #ffc107;
    --adcrm-info: #17a2b8;
    --adcrm-muted: #6c757d;
    --adcrm-border: #dee2e6;
    --adcrm-soft: #f4f6f9;
    --adcrm-alert-soft: #fff8e1;
    --adcrm-alert-border: #ffe082;
}

body { font-family: "Inter", "Segoe UI", Arial, sans-serif; }
a:hover { text-decoration: none; }

/* Layout / marca */
.brand-link {
    min-height: 57px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
}
.brand-logo-circle {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff, #00c0ef);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 0 0 3px rgba(255,255,255,.12);
}
.brand-logo-circle-lg { width: 46px; height: 46px; font-size: 1.3rem; vertical-align: middle; }
.brand-logo-img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: .35rem;    
    padding: 2px;
    box-shadow: 0 0 0 2px rgba(255,255,255,.18);
    flex: 0 0 auto;
}
.brand-logo-img-lg {
    width: 48px;
    height: 48px;
    vertical-align: middle;
    margin-right: .35rem;
}
.sidebar-collapse .brand-link .brand-text { display: none !important; }
.sidebar-avatar,
.user-avatar-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
}
.sidebar-avatar { width: 34px; height: 34px; }
.user-avatar-mini { width: 28px; height: 28px; }
.nav-sidebar .nav-header { letter-spacing: .06em; font-size: .72rem; color: #8995a5; }
.nav-sidebar .nav-link { border-radius: .35rem; }
.nav-sidebar .nav-link p { line-height: 1.25; }
.content-wrapper { background: #f4f6f9; }
.content-header h1 { font-size: 1.55rem; font-weight: 700; }
.main-footer { background: #fff; }

/* Compatibilitat amb les vistes antigues */
.content .card {
    border: 0;
    border-radius: .55rem;
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 .45rem 1.25rem rgba(0,0,0,.06);
    padding: 1.15rem;
    margin-bottom: 1rem;
}
.content .inner-card {
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
    background: #fbfcfd;
}
.content .card h2,
.content .card h3 {
    color: #343a40;
    font-weight: 700;
}
.content .card h2 { font-size: 1.15rem; margin: 0 0 .9rem; }
.content .card h3 { font-size: 1rem; margin: 0 0 .75rem; }
.mt { margin-top: 1rem; }
.mt-sm { margin-top: .5rem; }
.small { font-size: .85rem; }
.muted { color: var(--adcrm-muted) !important; }
.block { display: block; }

.grid { display: grid; gap: 1rem; }
.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.stat-card {
    position: relative;
    overflow: hidden;
    min-height: 116px;
    border-left: 4px solid var(--adcrm-primary) !important;
}
.stat-card::after {
    content: "";
    position: absolute;
    right: -28px;
    top: -28px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(0,123,255,.08);
}
.stat-card span { color: #6c757d; display: block; margin-bottom: .45rem; font-weight: 600; }
.stat-card strong { font-size: 2rem; line-height: 1; color: #212529; }
.cards-4 .stat-card:nth-child(2n) { border-left-color: var(--adcrm-info) !important; }
.cards-4 .stat-card:nth-child(3n) { border-left-color: var(--adcrm-success) !important; }
.cards-4 .stat-card:nth-child(4n) { border-left-color: var(--adcrm-warning) !important; }

.section-header,
.page-actions,
.compact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.section-header h2,
.page-actions h2,
.compact-header h3 { margin: 0; }
.page-actions p { margin: .25rem 0 0; color: var(--adcrm-muted); }
.action-row,
.actions-row,
.actions-cell { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.table-wrap,
.table-responsive { overflow-x: auto; }
.content table {
    width: 100%;
    background: #fff;
    border-collapse: collapse;
}
.content th {
    color: #495057;
    background: #f8f9fa;
    border-bottom: 1px solid var(--adcrm-border);
    padding: .75rem;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.content td {
    border-bottom: 1px solid #eef0f2;
    padding: .75rem;
    vertical-align: top;
}
.content tr:hover td { background: #fbfdff; }
.empty { text-align: center; color: var(--adcrm-muted); padding: 2rem; }

/* Badges i alertes legacy */
.badge { font-weight: 700; }
.badge.ok,
.badge.success { background: #d4edda; color: #155724; }
.badge.off,
.badge.danger { background: #f8d7da; color: #721c24; }
.badge.warn,
.badge.warning { background: #fff3cd; color: #856404; }
.alert.success { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.alert.error { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.alert.info { background: #d1ecf1; color: #0c5460; border-color: #bee5eb; }

/* Formularis legacy */
.form-stack { display: grid; gap: .9rem; }
.form-stack.compact { max-width: 620px; }
.filters,
.filters-grid {
    display: flex;
    gap: .85rem;
    align-items: end;
    flex-wrap: wrap;
}
.filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.filter-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Formulari de comercials: dades a l'esquerra i clients assignables a la dreta */
.sales-rep-form-grid {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(320px, 1fr);
    gap: 1.25rem;
    align-items: start;
}
.sales-rep-clients-box {
    border: 1px solid #e9ecef;
    border-radius: .75rem;
    padding: 1rem;
    background: #fbfcfd;
}
.clients-checklist-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: .75rem;
}
.clients-checklist-header p { margin: .25rem 0 0; }
.clients-checklist {
    display: grid;
    gap: .45rem;
    max-height: 520px;
    overflow: auto;
    padding-right: .25rem;
}
.client-check-row {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: flex-start;
    gap: .65rem;
    padding: .65rem .75rem;
    border: 1px solid #e9ecef;
    border-radius: .65rem;
    background: #fff;
    cursor: pointer;
    font-weight: 500 !important;
}
.client-check-row input { margin-top: .2rem; }
.client-check-row.is-assigned {
    border-color: #b6d7ff;
    background: #f2f8ff;
}
.client-check-name { display: block; color: #212529; }
.client-check-meta { display: block; margin-top: .15rem; color: #6c757d; font-size: .85rem; font-weight: 400; }
@media (max-width: 900px) {
    .sales-rep-form-grid { grid-template-columns: 1fr; }
    .clients-checklist { max-height: 320px; }
}
.content label { font-weight: 600; color: #343a40; }
.content label:not(.check-label) { display: grid; gap: .35rem; }
.content input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.content select,
.content textarea,
.form-control {
    display: block;
    width: 100%;
    min-height: calc(2.25rem + 2px);
    padding: .375rem .75rem;
    font-size: .9rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.content textarea { min-height: 92px; }
.content input:focus,
.content select:focus,
.content textarea:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(0,123,255,.25);
}
.check-label { display: flex !important; align-items: center; gap: .45rem; min-height: 38px; }
.check-label input { width: auto; }

/* Botons legacy */
.btn { font-weight: 600; }
.btn.primary { color: #fff; background-color: #007bff; border-color: #007bff; }
.btn.primary:hover { color: #fff; background-color: #0069d9; border-color: #0062cc; }
.btn.danger-line { color: #fff; background-color: #dc3545; border-color: #dc3545; }
.btn.danger-line:hover { color: #fff; background-color: #c82333; border-color: #bd2130; }
.small-btn { padding: .25rem .5rem; font-size: .8rem; border-radius: .2rem; }
.link-button { border: 0; background: none; color: #007bff; font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.link-button:hover { text-decoration: underline; }
.inline-form { display: inline; }
.dropdown-item-form { margin: 0; }
.dropdown-item-form .dropdown-item { width: 100%; text-align: left; background: transparent; border: 0; }

.details { display: grid; grid-template-columns: 170px 1fr; gap: .55rem 1rem; }
.details dt { color: #6c757d; font-weight: 700; }
.details dd { margin: 0; }

/* Fitxa client / comanda */
.client-hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.client-hero h2 { margin-bottom: .25rem; font-size: 1.45rem; }
.client-status-box { display: grid; gap: .45rem; justify-items: end; }
.order-client-box {
    display: grid;
    gap: .2rem;
    background: linear-gradient(135deg, #e7f1ff, #ffffff);
    border: 1px solid #b8daff;
    border-left: 4px solid #007bff;
    border-radius: .5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}
.order-client-box strong { font-size: 1.1rem; }
.order-client-box span,
.order-client-box small { color: #6c757d; }
.order-lines-table input { min-width: 120px; }

.recommendations-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.mini-card {
    border: 1px solid #e9ecef;
    border-radius: .5rem;
    padding: 1rem;
    background: #fff;
    max-height: 300px;
    overflow: auto;
}
.mini-card.wide { grid-column: span 2; }
.quick-product,
.compact-product {
    width: 100%;
    text-align: left;
    border: 1px solid #e9ecef;
    background: #fff;
    padding: .7rem;
    border-radius: .4rem;
    margin-bottom: .5rem;
}
.quick-product:hover { border-color: #007bff; box-shadow: 0 0 0 .15rem rgba(0,123,255,.12); }
.quick-product strong,
.compact-product strong { display: block; font-size: .88rem; }
.quick-product small,
.compact-product small { display: block; color: #6c757d; margin-top: .15rem; }

/* Llistes i notificacions */
.compact-list { display: grid; gap: .6rem; }
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid #e9ecef;
    border-radius: .5rem;
    padding: .8rem;
    background: #fff;
}
.list-item.unread { border-color: #ffc107; background: #fff8e1; }
.list-item.danger-soft { border-color: #f5c6cb; background: #fff5f5; }
.list-item strong { display: block; }
.list-item small { display: block; color: #6c757d; margin-top: .2rem; }
.row-unread td { background: #fff8e1; }

/* Catàleg */
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.catalog-card {
    border: 0;
    border-radius: .55rem;
    padding: 1rem;
    background: #fff;
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 .35rem 1rem rgba(0,0,0,.055);
}
.catalog-card.featured { border-top: 3px solid #ffc107; }
.catalog-card-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.catalog-card h3 { margin: 0 0 .5rem; font-size: 1.02rem; line-height: 1.25; }
.price-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-top: .75rem; }
.price-chips span { border: 1px solid #e9ecef; border-radius: .4rem; padding: .5rem; background: #f8f9fa; font-size: .78rem; color: #6c757d; }
.price-chips strong { display: block; color: #212529; margin-top: .1rem; font-size: .9rem; }

/* Sistema / logs */
.code-block,
.log-box {
    background: #1f2937;
    color: #f9fafb;
    border-radius: .5rem;
    padding: 1rem;
    overflow: auto;
    line-height: 1.45;
    font-size: .82rem;
}
.log-box { display: grid; gap: .5rem; max-height: 480px; }
.log-line { display: grid; gap: .2rem; border-bottom: 1px solid rgba(255,255,255,.08); padding-bottom: .5rem; }
.log-line strong { color: #d1d5db; font-size: .78rem; }
.log-line code { color: #f9fafb; white-space: pre-wrap; word-break: break-word; font-size: .78rem; }

/* Offline */
body.is-offline::after {
    content: "Sin connexión. Algunos datos pueden no estar actualizados.";
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 9999;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: .5rem;
    padding: .75rem 1rem;
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
    text-align: center;
    font-weight: 700;
}
.install-note {
    border: 1px solid #b8daff;
    background: #e7f1ff;
    border-radius: .5rem;
    padding: .85rem;
    color: #375a7f;
}
.offline-panel .cards-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.offline-panel .two-columns { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.offline-results { margin-top: 1rem; display: grid; gap: .75rem; max-height: 520px; overflow: auto; }
.offline-result-item { border: 1px solid #e5e7eb; border-radius: .5rem; padding: .75rem; background: #fff; display: grid; gap: .25rem; }
.offline-result-item strong { color: #212529; }
.offline-result-item small,
.offline-result-item span { color: #6c757d; }

/* Login */
.adcrm-login-page {
    background: radial-gradient(circle at top left, rgba(0,123,255,.22), transparent 32%), linear-gradient(135deg, #f4f6f9 0%, #e9eef5 100%);
}
.adcrm-login-box .login-logo a { color: #343a40; font-weight: 300; }
.adcrm-login-box .card { border-radius: .65rem; }

@media (max-width: 1200px) {
    .cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .cards-4,
    .two-cols,
    .recommendations-grid,
    .catalog-grid { grid-template-columns: 1fr; }
    .mini-card.wide { grid-column: span 1; }
    .section-header,
    .page-actions,
    .client-hero { align-items: flex-start; flex-direction: column; }
    .client-status-box { justify-items: start; }
    .details { grid-template-columns: 1fr; }
    .content .card { padding: .9rem; }
}


/* Pas 24: menú superior clar amb icones expansibles i lateral conservat */
.adcrm-adminlte-custom .main-header.adcrm-topbar-light {
    min-height: 57px;
    background: #fff !important;
    border-bottom: 1px solid #dee2e6 !important;
    z-index: 1040;
}
.adcrm-top-icon-menu {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .15rem;
    white-space: nowrap;
    overflow: visible;
}
.adcrm-top-item {
    position: relative;
    flex: 0 0 auto;
}
.adcrm-top-icon-link {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: flex-start;
    width: 48px;
    height: 44px;
    padding: 0 .78rem !important;
    border-radius: .55rem;
    color: #495057 !important;
    overflow: hidden;
    transition: width .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.adcrm-top-icon-link i {
    width: 24px;
    min-width: 24px;
    text-align: center;
    font-size: 1.2rem;
}
.adcrm-top-icon-link span:not(.badge) {
    display: inline-block;
    margin-left: .55rem;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    font-weight: 700;
    font-size: .86rem;
    transition: opacity .12s ease, max-width .16s ease;
}
.adcrm-top-icon-link:hover,
.adcrm-top-icon-link:focus,
.adcrm-hover-dropdown:hover > .adcrm-top-icon-link,
.adcrm-top-icon-link.active {
    width: 158px;
    color: #0056b3 !important;
    background: #eaf3ff;
    box-shadow: inset 0 0 0 1px rgba(0,123,255,.12);
}
.adcrm-top-icon-link:hover span:not(.badge),
.adcrm-top-icon-link:focus span:not(.badge),
.adcrm-hover-dropdown:hover > .adcrm-top-icon-link span:not(.badge),
.adcrm-top-icon-link.active span:not(.badge) {
    opacity: 1;
    max-width: 130px;
}
.adcrm-top-icon-link.active {
    color: #fff !important;
    background: linear-gradient(135deg, #007bff, #17a2b8);
    box-shadow: 0 .35rem .9rem rgba(0,123,255,.22);
}
.adcrm-top-separator {
    width: 1px;
    height: 28px;
    margin: 0 .35rem;
    background: #dee2e6;
}
.adcrm-top-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    transform: none;
}
.adcrm-hover-dropdown .adcrm-hover-menu {
    display: none;
    position: absolute;
    top: calc(100% + .3rem);
    left: 0;
    min-width: 245px;
    border: 0;
    border-radius: .65rem;
    padding: .45rem;
    box-shadow: 0 1rem 2.5rem rgba(15, 23, 42, .18);
    z-index: 1085;
}
.adcrm-hover-dropdown:hover > .adcrm-hover-menu,
.adcrm-hover-dropdown:focus-within > .adcrm-hover-menu {
    display: block;
}
.adcrm-hover-menu .dropdown-item {
    border-radius: .45rem;
    padding: .6rem .75rem;
    color: #243244;
    font-weight: 600;
}
.adcrm-hover-menu .dropdown-item:hover,
.adcrm-hover-menu .dropdown-item.active {
    background: #eaf3ff;
    color: #0056b3;
}
.adcrm-left-shell .sidebar {
    min-height: calc(100vh - 57px);
}
.adcrm-left-shell .adcrm-sidebar-empty-note {
    opacity: .55;
}
.sidebar-collapse .adcrm-left-shell .user-panel .info,
.sidebar-collapse .adcrm-left-shell .brand-text,
.sidebar-collapse .adcrm-sidebar-empty-note {
    display: none !important;
}
.adcrm-adminlte-custom .content-wrapper {
    background: #f4f6f9;
}

@media (max-width: 1199.98px) {
    .adcrm-top-icon-link,
    .adcrm-top-icon-link:hover,
    .adcrm-top-icon-link:focus,
    .adcrm-hover-dropdown:hover > .adcrm-top-icon-link,
    .adcrm-top-icon-link.active {
        width: 48px;
    }
    .adcrm-top-icon-link span:not(.badge) {
        display: none;
    }
    .adcrm-top-icon-menu {
        overflow-x: auto;
        overflow-y: visible;
        scrollbar-width: thin;
    }
}
@media (max-width: 767.98px) {
    .adcrm-user-menu .navbar-text { display: none !important; }
    .adcrm-top-separator { display: none; }
}

/* Pas 28: dashboard alineat amb la graella dels 5 KPIs */
.adcrm-kpi-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 15px;
    margin-left: 0;
    margin-right: 0;
}
.adcrm-kpi-row > [class*="col-"] {
    width: auto;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
    flex: none;
}
.adcrm-kpi-row .small-box {
    margin-bottom: 0;
    height: 100%;
}
.adcrm-dashboard-main-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 15px;
    margin-left: 0;
    margin-right: 0;
    margin-top: 15px;
}
.adcrm-dashboard-orders-col,
.adcrm-dashboard-alerts-col {
    position: relative;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}
.adcrm-dashboard-orders-col {
    grid-column: span 3;
}
.adcrm-dashboard-alerts-col {
    grid-column: span 2;
}
.adcrm-dashboard-main-row .card {
    padding: 0;
    margin-bottom: 0;
    height: 100%;
}
.adcrm-dashboard-main-row .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.adcrm-dashboard-alert-list .list-group-item {
    border-left: 0;
    border-right: 0;
}
.adcrm-dashboard-alert-list .list-group-item:first-child {
    border-top: 0;
}
.adcrm-dashboard-alert-list .list-group-item:last-child {
    border-bottom: 0;
}
.adcrm-alert-unread {
    background: #fff8e1;
}
@media (max-width: 1199.98px) {
    .adcrm-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 991.98px) {
    .adcrm-dashboard-main-row {
        grid-template-columns: 1fr;
    }
    .adcrm-dashboard-orders-col,
    .adcrm-dashboard-alerts-col {
        grid-column: auto;
    }
}
@media (max-width: 575.98px) {
    .adcrm-kpi-row {
        grid-template-columns: 1fr;
    }
}


.adcrm-sidebar-search-wrap {
    padding-left: .65rem;
    padding-right: .65rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.adcrm-sidebar-search-box {
    position: relative;
    display: flex;
    align-items: center;
}
.adcrm-sidebar-search-box > i {
    position: absolute;
    left: .72rem;
    color: #8f9baa;
    font-size: .82rem;
    pointer-events: none;
}
.adcrm-sidebar-search-input {
    width: 100%;
    height: 38px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: .55rem;
    background: rgba(255,255,255,.08);
    color: #fff;
    padding: .45rem 2.1rem .45rem 2rem;
    outline: 0;
    font-size: .86rem;
    font-weight: 600;
}
.adcrm-sidebar-search-input::placeholder {
    color: #aeb6c2;
    font-weight: 500;
}
.adcrm-sidebar-search-input:focus {
    border-color: rgba(23,162,184,.65);
    background: rgba(255,255,255,.12);
    box-shadow: 0 0 0 .12rem rgba(23,162,184,.18);
}
.adcrm-sidebar-search-clear {
    position: absolute;
    right: .35rem;
    display: none;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    color: #d5d9df;
    cursor: pointer;
}
.adcrm-sidebar-search-wrap.has-value .adcrm-sidebar-search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.adcrm-sidebar-search-clear:hover {
    background: rgba(255,255,255,.2);
    color: #fff;
}
.sidebar-collapse .adcrm-left-shell .adcrm-sidebar-search-wrap {
    display: none !important;
}

/* Pas 29: llistat de clients al lateral esquerre */
.adcrm-left-shell .sidebar {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.adcrm-sidebar-clients {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: .75rem;
}
.adcrm-sidebar-clients-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .35rem .85rem .55rem;
    color: #c2c7d0;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.adcrm-sidebar-clients-title small {
    display: inline-flex;
    min-width: 1.45rem;
    height: 1.45rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: .72rem;
}
.adcrm-sidebar-client-list {
    display: grid;
    gap: .18rem;
    padding: 0 .45rem;
    overflow: auto;
    max-height: calc(100vh - 205px);
    scrollbar-width: thin;
}
.adcrm-sidebar-client-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-height: 38px;
    padding: .38rem .45rem;
    border-radius: .45rem;
    color: #d5d9df;
    transition: background-color .12s ease, color .12s ease;
}
.adcrm-sidebar-client-item:hover,
.adcrm-sidebar-client-item:focus {
    color: #fff;
    background: rgba(255,255,255,.09);
}
.adcrm-sidebar-client-item.is-hidden,
.adcrm-sidebar-client-item.is-search-hidden {
    display: none;
}
.adcrm-sidebar-client-badge {
    flex: 0 0 auto;
    display: inline-flex;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}
.adcrm-sidebar-client-badge.order-today { background: #28a745; }
.adcrm-sidebar-client-badge.delivery-today { background: #28a745; }
.adcrm-sidebar-client-badge.delivery-tomorrow { background: #17a2b8; }
.adcrm-sidebar-client-badge.delivery-later { background: #6f42c1; }
.adcrm-sidebar-client-badge.stale { background: #6c757d; }

.adcrm-sidebar-client-item.order-state-draft {
    background: rgba(220, 53, 69, .12);
    color: #fff;
}
.adcrm-sidebar-client-item.order-state-finalized {
    background: rgba(40, 167, 69, .10);
    color: #fff;
}
.adcrm-sidebar-client-badge.order-draft {
    background: #dc3545;
    animation: adcrmBasketBlink 1s ease-in-out infinite;
}
.adcrm-sidebar-client-badge.order-finalized {
    background: #28a745;
}
@keyframes adcrmBasketBlink {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, .55); }
    50% { opacity: .45; transform: scale(1.08); box-shadow: 0 0 0 .28rem rgba(220, 53, 69, .14); }
}
.adcrm-sidebar-client-text {
    min-width: 0;
    display: grid;
    line-height: 1.08;
}
.adcrm-sidebar-client-name {
    display: block;
    max-width: 174px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .84rem;
    font-weight: 700;
}
.adcrm-sidebar-client-text small {
    margin-top: .14rem;
    color: #9aa4b2;
    font-size: .69rem;
}
.adcrm-sidebar-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    width: calc(100% - .9rem);
    margin: .55rem .45rem 0;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: .5rem;
    background: rgba(255,255,255,.06);
    color: #d5d9df;
    padding: .45rem;
    font-weight: 800;
    font-size: .78rem;
    cursor: pointer;
}
.adcrm-sidebar-more:hover {
    background: rgba(255,255,255,.11);
    color: #fff;
}
.adcrm-sidebar-empty,
.adcrm-sidebar-no-results {
    padding-top: .25rem;
}
.adcrm-sidebar-no-results {
    display: none;
    padding-left: .85rem;
    padding-right: .85rem;
    color: #9aa4b2;
    font-size: .78rem;
}
.adcrm-sidebar-clients.is-searching .adcrm-sidebar-more {
    display: none;
}
.adcrm-sidebar-clients.has-no-search-results .adcrm-sidebar-no-results {
    display: block;
}
.sidebar-collapse .adcrm-left-shell .adcrm-sidebar-clients-title span,
.sidebar-collapse .adcrm-left-shell .adcrm-sidebar-clients-title small,
.sidebar-collapse .adcrm-left-shell .adcrm-sidebar-client-text,
.sidebar-collapse .adcrm-left-shell .adcrm-sidebar-more,
.sidebar-collapse .adcrm-left-shell .adcrm-sidebar-empty {
    display: none !important;
}
.sidebar-collapse .adcrm-left-shell .adcrm-sidebar-client-list {
    padding: 0 .32rem;
    max-height: calc(100vh - 150px);
}
.sidebar-collapse .adcrm-left-shell .adcrm-sidebar-client-item {
    justify-content: center;
    padding-left: .2rem;
    padding-right: .2rem;
}
@media (max-width: 767.98px) {
    .adcrm-sidebar-client-list {
        max-height: calc(100vh - 235px);
    }
}

/* Pas 36: fitxa client capçalera en 3 columnes i sense KPIs */
.client-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
}
.client-summary-grid .card {
    height: 100%;
}
.client-identity-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: .85rem;
}
.client-identity-card h2 {
    margin: .15rem 0 .25rem;
    font-size: 1.45rem;
    line-height: 1.18;
}
.client-identity-card p {
    margin-bottom: 0;
}
.client-status-box.compact-left {
    justify-items: start;
    gap: .25rem;
}
.client-top-details-card h2 {
    margin-bottom: .85rem;
}
.compact-details {
    grid-template-columns: 130px 1fr;
    gap: .42rem .75rem;
    font-size: .9rem;
}
.compact-details dt,
.compact-details dd {
    min-width: 0;
    word-break: break-word;
}
@media (max-width: 1199.98px) {
    .client-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* Pas 37: fitxa de client més visual */
.client-profile-top .card {
    overflow: hidden;
}
.client-profile-hero {
    position: relative;
    color: #1f2937;
    border-top: 4px solid #28a745 !important;
    background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
}
.client-profile-hero::after {
    content: "";
    position: absolute;
    right: -36px;
    top: -36px;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background: rgba(40, 167, 69, .12);
    pointer-events: none;
}
.client-profile-hero.client-state-warning { border-top-color: #ffc107 !important; }
.client-profile-hero.client-state-warning::after { background: rgba(255, 193, 7, .16); }
.client-profile-hero.client-state-orange { border-top-color: #fd7e14 !important; }
.client-profile-hero.client-state-orange::after { background: rgba(253, 126, 20, .14); }
.client-profile-hero.client-state-danger { border-top-color: #dc3545 !important; }
.client-profile-hero.client-state-danger::after { background: rgba(220, 53, 69, .13); }
.client-profile-hero.client-state-empty { border-top-color: #17a2b8 !important; }
.client-profile-hero.client-state-empty::after { background: rgba(23, 162, 184, .13); }
.client-profile-hero.client-state-off { border-top-color: #6c757d !important; background: linear-gradient(135deg, #ffffff, #f3f4f6); }
.client-profile-hero.client-state-off::after { background: rgba(108, 117, 125, .16); }
.client-hero-main {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: .85rem;
}
.client-avatar {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #007bff, #17a2b8);
    box-shadow: 0 .55rem 1.15rem rgba(0, 123, 255, .25);
    font-size: 1.2rem;
}
.client-status-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    padding: .38rem .65rem;
    font-size: .76rem;
    font-weight: 800;
    background: #eaf8ef;
    color: #155724;
}
.client-state-warning .client-status-pill { background: #fff3cd; color: #856404; }
.client-state-orange .client-status-pill { background: #ffe8d3; color: #8a3d00; }
.client-state-danger .client-status-pill { background: #f8d7da; color: #721c24; }
.client-state-empty .client-status-pill { background: #d1ecf1; color: #0c5460; }
.client-state-off .client-status-pill { background: #e9ecef; color: #495057; }
.client-detail-card {
    position: relative;
    border-top: 4px solid #007bff !important;
}
.client-detail-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .85rem;
    margin-bottom: .85rem;
}
.client-detail-title-row h2 {
    margin: 0;
}
.client-detail-card.accent-purple { border-top-color: #6f42c1 !important; }
.client-detail-card.accent-blue h2 i { color: #007bff; }
.client-detail-card.accent-purple h2 i { color: #6f42c1; }
.client-commercial-conditions-card {
    position: relative;
}
.client-commercial-conditions-card .client-detail-title-row {
    padding-right: 5.6rem;
}
.client-postit-btn {
    position: absolute;
    top: .7rem;
    right: .85rem;
    z-index: 2;
    width: 72px;
    min-height: 54px;
    padding: .45rem .45rem .5rem;
    border: 0;
    border-radius: .22rem .22rem .55rem .22rem;
    background: linear-gradient(145deg, #fff3a8 0%, #ffd95c 100%);
    color: #5c4300;
    box-shadow: 0 .45rem .9rem rgba(101, 72, 0, .18), inset 0 1px 0 rgba(255,255,255,.65);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .08rem;
    font-size: .72rem;
    font-weight: 900;
    line-height: 1.05;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transform: rotate(1.6deg);
    transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}
.client-postit-btn::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    border-radius: .15rem 0 .5rem 0;
    background: linear-gradient(135deg, rgba(188, 133, 0, .22), rgba(255, 255, 255, .45));
}
.client-postit-btn:hover,
.client-postit-btn:focus {
    color: #4b3700;
    filter: brightness(1.02);
    box-shadow: 0 .6rem 1.15rem rgba(101, 72, 0, .23), inset 0 1px 0 rgba(255,255,255,.72);
    outline: none;
    transform: translateY(-1px) rotate(0deg);
}
.client-postit-btn i {
    font-size: 1.05rem;
}
.client-postit-text {
    display: block;
}
.client-postit-count {
    position: absolute;
    top: -.38rem;
    right: -.38rem;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 .28rem;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    box-shadow: 0 .2rem .45rem rgba(220, 53, 69, .35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 900;
    line-height: 1;
}
.client-insights-grid {
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}
.client-chart-card,
.client-commercial-state-card {
    min-height: 260px;
}
.client-sales-chart {
    display: grid;
    grid-template-columns: repeat(12, minmax(32px, 1fr));
    gap: .55rem;
    height: 205px;
    align-items: end;
    padding-top: 1rem;
}
.client-sales-bar-wrap {
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: .35rem;
}
.client-sales-bar-value {
    min-height: 22px;
    max-width: 100%;
    color: #6c757d;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
}
.client-sales-bar {
    width: 100%;
    min-height: 6px;
    border-radius: .5rem .5rem .2rem .2rem;
    background: linear-gradient(180deg, #17a2b8, #007bff);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 .45rem .8rem rgba(0, 123, 255, .14);
}
.client-sales-bar-wrap small {
    color: #6c757d;
    font-size: .67rem;
    font-weight: 700;
    white-space: nowrap;
}

.client-weekday-card {
    min-height: 260px;
}
.client-weekday-chart {
    display: grid;
    grid-template-columns: repeat(7, minmax(30px, 1fr));
    gap: .48rem;
    height: 190px;
    align-items: end;
    padding-top: .8rem;
}
.client-weekday-bar-wrap {
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: .28rem;
}
.client-weekday-bar-value {
    min-height: 18px;
    color: #6c757d;
    font-size: .74rem;
    font-weight: 800;
    line-height: 1;
}
.client-weekday-bar {
    width: 100%;
    min-height: 0;
    border-radius: .5rem .5rem .18rem .18rem;
    background: linear-gradient(180deg, #ffc107, #fd7e14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 .45rem .8rem rgba(253, 126, 20, .14);
}
.client-weekday-bar-wrap strong {
    color: #343a40;
    font-size: .74rem;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}
.client-weekday-bar-wrap small {
    color: #6c757d;
    font-size: .64rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}
.client-empty-visual.compact {
    min-height: 165px;
}
.client-state-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
}
.client-state-metrics div {
    border-radius: .7rem;
    background: linear-gradient(135deg, #f8f9fa, #fff);
    border: 1px solid #eef0f3;
    padding: .85rem;
}
.client-state-metrics span,
.client-state-metrics small {
    display: block;
    color: #6c757d;
    font-weight: 700;
    font-size: .76rem;
}
.client-state-metrics strong {
    display: block;
    margin: .25rem 0;
    color: #212529;
    font-size: 1.28rem;
    line-height: 1.05;
}
.client-commercial-state-row {
    width: 100%;
}
.client-commercial-state-row .client-commercial-state-card {
    min-height: 0;
}
.client-commercial-state-row .client-commercial-state-card h2 {
    margin-bottom: .85rem;
}
.client-commercial-state-row .client-state-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1199.98px) {
    .client-commercial-state-row .client-state-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


.client-empty-visual {
    min-height: 180px;
    border: 1px dashed #cfd6de;
    border-radius: .7rem;
    background: #fbfcfd;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    text-align: center;
    gap: .3rem;
}
.client-empty-visual i {
    font-size: 2rem;
    color: #17a2b8;
}
.client-product-sections .mini-card {
    max-height: 380px;
    padding: .85rem;
    background: linear-gradient(180deg, #ffffff, #fbfcfd);
}
.client-product-section h3 i { color: #007bff; }
.client-product-tile {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: .7rem;
    align-items: center;
    border: 1px solid #edf0f3;
    background: #fff;
    border-radius: .7rem;
    padding: .58rem;
    margin-bottom: .55rem;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.client-product-tile:hover {
    transform: translateY(-1px);
    border-color: #c7def8;
    box-shadow: 0 .5rem 1.15rem rgba(15, 23, 42, .07);
}
.client-product-tile strong {
    display: block;
    color: #1f2937;
    font-size: .86rem;
    line-height: 1.18;
}
.client-product-tile small,
.client-product-tile span {
    display: block;
    color: #6c757d;
    font-size: .73rem;
    margin-top: .12rem;
    line-height: 1.2;
}
.product-thumb {
    width: 42px;
    height: 42px;
    border-radius: .75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .75rem;
    font-weight: 900;
    letter-spacing: .02em;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.product-thumb.tone-1 { background: linear-gradient(135deg, #007bff, #17a2b8); }
.product-thumb.tone-2 { background: linear-gradient(135deg, #28a745, #20c997); }
.product-thumb.tone-3 { background: linear-gradient(135deg, #fd7e14, #ffc107); }
.product-thumb.tone-4 { background: linear-gradient(135deg, #6f42c1, #e83e8c); }
.product-thumb.tone-5 { background: linear-gradient(135deg, #dc3545, #fd7e14); }
.product-thumb.tone-6 { background: linear-gradient(135deg, #343a40, #6c757d); }
.product-thumb.has-image {
    background: #f4f6f9;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    padding: 0;
    box-shadow: 0 .18rem .45rem rgba(15, 23, 42, .08);
}
.product-thumb.has-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}
.client-bottom-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}
@media (max-width: 1199.98px) {
    .client-insights-grid,
    .client-bottom-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 767.98px) {
    .client-sales-chart {
        overflow-x: auto;
        grid-template-columns: repeat(12, 44px);
        padding-bottom: .5rem;
    }
    .client-weekday-chart {
        overflow-x: auto;
        grid-template-columns: repeat(7, 42px);
        padding-bottom: .5rem;
    }
    .client-state-metrics {
        grid-template-columns: 1fr;
    }
}

/* Pas 39: gestor de fotos de producte */
.product-image-admin-intro code { color: #0056b3; }

.product-images-section-header {
    align-items: flex-start;
}
.product-image-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eef0f3;
}
.product-image-load-more .btn {
    min-width: 190px;
}
.product-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.product-image-card {
    border: 1px solid #e5e9ef;
    border-radius: .7rem;
    background: #fff;
    padding: .75rem;
    box-shadow: 0 .25rem .75rem rgba(15, 23, 42, .04);
    display: flex;
    flex-direction: column;
    gap: .65rem;
}
.product-image-thumb-link {
    display: block;
    border-radius: .6rem;
    overflow: hidden;
    background: #f4f6f9;
    border: 1px solid #eef0f3;
}
.product-image-thumb {
    width: 100%;
    height: 180px;
    object-fit: contain;
    display: block;
    background: repeating-conic-gradient(#f8f9fb 0% 25%, #eef1f5 0% 50%) 50% / 18px 18px;
}
.product-image-meta strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-image-assign-form {
    display: grid;
    gap: .5rem;
}
.product-search-results {
    position: relative;
    display: grid;
    gap: .35rem;
    max-height: 230px;
    overflow: auto;
}
.product-search-result {
    border: 1px solid #e7edf5;
    background: #fff;
    border-radius: .45rem;
    padding: .45rem;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: .55rem;
    text-align: left;
    align-items: center;
    cursor: pointer;
}
.product-search-result:hover {
    border-color: #007bff;
    box-shadow: 0 0 0 .15rem rgba(0,123,255,.1);
}
.product-search-result img,
.product-search-no-img {
    width: 42px;
    height: 42px;
    border-radius: .4rem;
    object-fit: contain;
    background: #f4f6f9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}
.product-search-result strong { color: #111827; }
.product-search-result small {
    display: block;
    color: #6c757d;
    line-height: 1.2;
}
.product-search-loading,
.product-search-empty,
.selected-product {
    font-size: .82rem;
    color: #6c757d;
}
.product-image-ignore-form { text-align: right; }
.recent-product-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: .75rem;
}
.recent-product-image {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: .65rem;
    align-items: center;
    border: 1px solid #edf0f4;
    background: #fff;
    border-radius: .6rem;
    padding: .55rem;
    color: #212529;
}
.recent-product-image img,
.product-list-photo,
.product-detail-gallery-item img {
    object-fit: contain;
    background: #f8f9fb;
}
.recent-product-image img {
    width: 58px;
    height: 58px;
    border-radius: .5rem;
}
.recent-product-image strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.recent-product-image small { color: #6c757d; display: block; }
.product-list-photo-cell { width: 62px; }
.product-list-photo,
.product-list-photo-placeholder {
    width: 46px;
    height: 46px;
    border-radius: .45rem;
    border: 1px solid #e9edf2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    background: #f8f9fb;
}
.catalog-product-photo {
    height: 145px;
    border-radius: .7rem;
    background: linear-gradient(135deg, #f8f9fb, #eef2f7);
    border: 1px solid #e7ebf1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .8rem;
    overflow: hidden;
}
.catalog-product-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.catalog-product-photo span {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    background: #fff;
    box-shadow: 0 .35rem .9rem rgba(15, 23, 42, .08);
}
.product-view-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}
.product-view-image img,
.product-view-placeholder {
    width: 100%;
    height: 240px;
    object-fit: contain;
    border: 1px solid #e9edf2;
    border-radius: .75rem;
    background: #f8f9fb;
}
.product-view-placeholder {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}
.product-view-placeholder i { font-size: 2rem; }
.product-detail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}
.product-detail-gallery-item {
    border: 1px solid #edf0f4;
    border-radius: .65rem;
    background: #fff;
    padding: .65rem;
    display: grid;
    gap: .55rem;
}
.product-detail-gallery-item img {
    width: 100%;
    height: 140px;
    border-radius: .5rem;
}
@media (max-width: 767.98px) {
    .product-view-layout { grid-template-columns: 1fr; }
    .product-image-grid { grid-template-columns: 1fr; }
}

/* Step 43: força mida fixa de miniatures en fitxa de client */
.client-product-tile {
    grid-template-columns: 46px minmax(0, 1fr);
}
.client-product-tile > .product-thumb,
.client-product-tile .product-thumb {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    aspect-ratio: 1 / 1;
    flex: 0 0 42px;
    overflow: hidden;
    box-sizing: border-box;
}
.client-product-tile > .product-thumb.has-image,
.client-product-tile .product-thumb.has-image {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    background: #f8f9fb;
    border: 1px solid #e2e8f0;
}
.client-product-tile > .product-thumb.has-image > img,
.client-product-tile .product-thumb.has-image img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    display: block;
    object-fit: cover;
    object-position: center;
}

/* Step 48: detall de producte amb tarifes al costat dret */
.product-detail-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1rem;
    align-items: start;
}
.product-detail-main-card,
.product-detail-prices-card {
    margin-bottom: 0;
}
.product-detail-prices-card h2 {
    margin-bottom: .75rem;
}
.product-detail-prices-table table th,
.product-detail-prices-table table td {
    padding: .58rem .7rem;
}
.product-detail-prices-table table td:last-child {
    text-align: right;
    font-weight: 700;
    white-space: nowrap;
}
.product-detail-main-details {
    margin-bottom: 0;
}
@media (max-width: 1199.98px) {
    .product-detail-top-grid {
        grid-template-columns: 1fr;
    }
    .product-detail-prices-card {
        margin-top: 1rem;
    }
}
@media (min-width: 1200px) {
    .product-detail-top-grid .product-view-layout {
        grid-template-columns: 220px minmax(0, 1fr);
    }
    .product-detail-top-grid .product-view-image img,
    .product-detail-top-grid .product-view-placeholder {
        height: 215px;
    }
}

/* Catàleg comercial avançat / Agrupacions */
.badge.offer {
    background: #ffe8cc;
    color: #8a4b00;
}
.catalog-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    overflow: hidden;
    position: relative;
}
.catalog-hero::after {
    content: "";
    position: absolute;
    right: -48px;
    top: -64px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 193, 7, .14);
    pointer-events: none;
}
.catalog-hero-main,
.catalog-hero-actions { position: relative; z-index: 1; }
.catalog-hero-kicker {
    display: inline-flex;
    align-items: center;
    margin-bottom: .35rem;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #856404;
}
.catalog-hero h2 { margin: 0 0 .35rem; font-size: 1.45rem; }
.catalog-hero-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.catalog-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-end;
    gap: .85rem 2rem;
    position: relative;
    z-index: 5;
}
.catalog-toolbar-with-search {
    margin-bottom: 0;
}
.catalog-toolbar-search {
    width: 100%;
    min-width: 0;
    margin: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: .55rem;
    flex-wrap: nowrap;
    max-width: 760px;
}
.catalog-toolbar-search label {
    min-width: 135px;
}
.catalog-toolbar-search .catalog-search-field {
    flex: 0 1 280px;
    width: 280px;
    max-width: 280px;
    min-width: 220px;
}
.catalog-toolbar-search button,
.catalog-toolbar-search > .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}
.catalog-toolbar-search .catalog-search-submit,
.catalog-toolbar-search .catalog-search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: .45rem .8rem;
    border-radius: .45rem;
    border: 1px solid transparent;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 .25rem .75rem rgba(0,0,0,.06);
}
.catalog-toolbar-search .catalog-search-submit {
    color: #fff;
    background: var(--adcrm-primary);
    border-color: var(--adcrm-primary);
}
.catalog-toolbar-search .catalog-search-submit:hover {
    color: #fff;
    background: var(--adcrm-primary-dark);
    border-color: var(--adcrm-primary-dark);
}
.catalog-toolbar-search .catalog-search-clear {
    color: #495057;
    background: #fff;
    border-color: var(--adcrm-border);
}
.catalog-toolbar-search .catalog-search-clear:hover {
    color: #212529;
    background: #f8f9fa;
    border-color: #ced4da;
}
.catalog-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.catalog-toolbar-actions .btn,
.catalog-toolbar-actions summary.btn {
    white-space: nowrap;
}
.catalog-dropdown {
    position: relative;
}
.catalog-dropdown summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}
.catalog-dropdown summary::-webkit-details-marker { display: none; }
.catalog-dropdown summary::after {
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-left: .35rem;
    font-size: .75rem;
}
.catalog-dropdown[open] summary::after { content: "\f106"; }
.catalog-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + .5rem);
    z-index: 50;
    min-width: 280px;
    max-height: min(420px, 70vh);
    overflow: auto;
    padding: .45rem;
    border: 1px solid #e2e8f0;
    border-radius: .75rem;
    background: #fff;
    box-shadow: 0 .75rem 2rem rgba(15, 23, 42, .14);
}
.catalog-dropdown-menu hr {
    margin: .4rem 0;
    border: 0;
    border-top: 1px solid #edf0f4;
}
.catalog-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .55rem .65rem;
    border-radius: .55rem;
    color: #334155;
    font-weight: 700;
}
.catalog-dropdown-item:hover,
.catalog-dropdown-item.active {
    background: #f0f7ff;
    color: #0056b3;
    text-decoration: none;
}
.catalog-dropdown-item small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 .4rem;
    border-radius: 999px;
    background: #e9ecef;
    color: #495057;
    font-size: .72rem;
}
.catalog-dropdown-add {
    color: #007bff;
}
.catalog-group-pills {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
}
.catalog-group-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .5rem .75rem;
    border-radius: 999px;
    border: 1px solid #e3e8ef;
    background: #fff;
    color: #334155;
    font-weight: 700;
    box-shadow: 0 .15rem .45rem rgba(15, 23, 42, .04);
}
.catalog-group-pill:hover,
.catalog-group-pill.active {
    text-decoration: none;
    border-color: #007bff;
    color: #0056b3;
    background: #f0f7ff;
}
.catalog-group-pill small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 .35rem;
    border-radius: 999px;
    background: #e9ecef;
    color: #495057;
}
.catalog-strip-grid,
.catalog-group-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}
.catalog-card.offer-card { border-top: 3px solid #fd7e14; }
.catalog-product-photo.compact { height: 118px; }
.product-mini-badges { display: inline-flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.offer-until { color: #8a4b00; font-weight: 700; }
.price-chips.single { grid-template-columns: 1fr; }
.catalog-group-card {
    border: 1px solid #e7ebf1;
    border-radius: .75rem;
    padding: 1rem;
    background: #fff;
    box-shadow: 0 .35rem 1rem rgba(15, 23, 42, .055);
}
.catalog-group-card.is-inactive { opacity: .7; }
.catalog-group-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .85rem; }
.catalog-group-icon {
    width: 42px;
    height: 42px;
    border-radius: .75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef6ff;
    color: #007bff;
}
.catalog-group-card h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.catalog-group-meta {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    color: #6c757d;
    font-size: .85rem;
    margin-top: .75rem;
}
.catalog-add-product-form label { min-width: min(520px, 100%); }
.mt-sm { margin-top: .75rem; }
.danger-soft-card { border-left: 4px solid #dc3545; }
.block { display: block; }

@media (max-width: 1199.98px) {
    .catalog-strip-grid,
    .catalog-group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
    .catalog-toolbar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .catalog-toolbar-search {
        flex-wrap: wrap;
        max-width: 100%;
    }
    .catalog-toolbar-search label,
    .catalog-toolbar-search .catalog-search-field {
        min-width: min(100%, 220px);
    }
    .catalog-toolbar-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
        white-space: normal;
    }
}
@media (max-width: 767.98px) {
    .catalog-hero { align-items: flex-start; flex-direction: column; }
    .catalog-hero-actions { justify-content: flex-start; }
    .catalog-toolbar-search label,
    .catalog-toolbar-search .catalog-search-field {
        min-width: 100%;
        width: 100%;
        max-width: 100%;
    }
    .catalog-toolbar-search button,
    .catalog-toolbar-search > .btn { flex: 1 1 auto; }
    .catalog-toolbar-actions { width: 100%; }
    .catalog-dropdown-menu { left: 0; right: auto; min-width: min(86vw, 320px); }
    .catalog-strip-grid,
    .catalog-group-grid { grid-template-columns: 1fr; }
}

/* Step 51: catàleg tipus quadrícula de supermercat amb flip al clic */
.catalog-supermarket-grid,
.catalog-grid,
.catalog-strip-grid.catalog-supermarket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: .85rem;
}
.catalog-tile {
    aspect-ratio: 1 / 1;
    min-height: 280px;
    perspective: 1000px;
    cursor: pointer;
    outline: none;
}
.catalog-tile-compact {
    aspect-ratio: 1 / 1;
}
.catalog-tile-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    transition: transform .48s ease;
    transform-style: preserve-3d;
}
.catalog-tile.is-flipped .catalog-tile-inner {
    transform: rotateY(180deg);
}
.catalog-tile-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid #e5eaf1;
    border-radius: .85rem;
    background: #fff;
    box-shadow: 0 .35rem 1rem rgba(15, 23, 42, .07);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
}
.catalog-tile:hover .catalog-tile-face,
.catalog-tile:focus .catalog-tile-face,
.catalog-tile:focus-visible .catalog-tile-face {
    border-color: #007bff;
    box-shadow: 0 .5rem 1.25rem rgba(0, 123, 255, .14);
}
.catalog-tile.is-offer .catalog-tile-face {
    border-top: 3px solid #fd7e14;
}
.catalog-tile.is-featured .catalog-tile-face {
    border-bottom: 3px solid #ffc107;
}
.catalog-tile-front {
    align-items: center;
    justify-content: space-between;
    padding: .85rem;
}
.catalog-front-photo {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: .7rem;
    background: linear-gradient(135deg, #f8f9fb, #eef2f7);
    border: 1px solid #eef1f5;
    overflow: hidden;
}
.catalog-front-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: .15rem;
}
.catalog-front-photo span {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    background: #fff;
    box-shadow: 0 .35rem .9rem rgba(15, 23, 42, .08);
}
.catalog-tile-front h3 {
    width: 100%;
    margin: .55rem 0 0;
    min-height: 2.5em;
    color: #212529;
    font-size: 1.05rem;
    line-height: 1.2;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.catalog-tile-back {
    transform: rotateY(180deg);
    padding: .9rem;
    gap: .65rem;
}
.catalog-back-scroll {
    min-height: 0;
    overflow: auto;
    padding-right: .1rem;
}
.catalog-tile-back h3 {
    margin: 0 0 .45rem;
    font-size: 1rem;
    line-height: 1.22;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.catalog-meta-list {
    display: grid;
    gap: .35rem;
    margin: 0 0 .55rem;
}
.catalog-meta-list div {
    display: grid;
    gap: .1rem;
}
.catalog-meta-list dt {
    color: #6c757d;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.catalog-meta-list dd {
    margin: 0;
    color: #212529;
    font-size: .8rem;
    line-height: 1.2;
}
.catalog-tariff-title {
    margin-bottom: .35rem;
    color: #495057;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.catalog-tariff-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem;
}
.catalog-tariff-grid span {
    border: 1px solid #edf0f4;
    border-radius: .45rem;
    background: #f8f9fb;
    padding: .35rem .4rem;
}
.catalog-tariff-grid small {
    display: block;
    color: #6c757d;
    font-size: .66rem;
    font-weight: 800;
}
.catalog-tariff-grid strong {
    display: block;
    color: #212529;
    font-size: .78rem;
    white-space: nowrap;
}
.catalog-back-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .35rem;
    margin-top: auto;
}
.catalog-back-actions .btn {
    white-space: nowrap;
    text-align: center;
}
@media (min-width: 1400px) {
    .catalog-supermarket-grid,
    .catalog-grid,
    .catalog-strip-grid.catalog-supermarket-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}
@media (max-width: 767.98px) {
    .catalog-supermarket-grid,
    .catalog-grid,
    .catalog-strip-grid.catalog-supermarket-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 420px) {
    .catalog-supermarket-grid,
    .catalog-grid,
    .catalog-strip-grid.catalog-supermarket-grid {
        grid-template-columns: 1fr 1fr;
        gap: .65rem;
    }
    .catalog-tile-front,
    .catalog-tile-back {
        padding: .6rem;
    }
}

/* Millora procés de compra: layout 2/3 + 1/3, calendari entrega i targetes sense flip */
.order-create-shell { overflow: visible; }
.order-form {
    height: calc(100vh - 205px);
    min-height: 680px;
}
.order-workspace {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(330px, 1fr);
    gap: 1rem;
    height: 100%;
    min-height: 0;
}
.order-left-pane,
.order-right-pane {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: .25rem;
}
.order-right-pane {
    padding: .85rem;
    border: 1px solid var(--adcrm-alert-border);
    border-radius: .85rem;
    background: var(--adcrm-alert-soft);
}
.order-right-pane .order-cart-card {
    background: transparent;
    box-shadow: none;
    border-top: 3px solid var(--adcrm-warning);
}
.order-left-pane > .card,
.order-left-pane > .order-client-box { margin-bottom: 1rem; }
.order-client-box-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.order-delivery-pill {
    display: grid;
    gap: .25rem;
    justify-items: end;
    min-width: 190px;
}
.order-delivery-pill span,
.order-cart-delivery span {
    color: #6c757d;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.order-delivery-pill strong,
.order-cart-delivery strong { color: #212529; font-size: .9rem; }
.order-product-section { padding: 1rem; }
.order-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: .75rem;
}
.order-product-tile.quick-product {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 178px;
    margin: 0;
    padding: .7rem;
    border: 1px solid #e5eaf1;
    border-radius: .85rem;
    background: #fff;
    box-shadow: 0 .35rem 1rem rgba(15, 23, 42, .07);
    cursor: pointer;
    overflow: hidden;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.order-product-tile.quick-product:hover,
.order-product-tile.quick-product:focus-visible {
    border-color: #007bff;
    box-shadow: 0 .5rem 1.25rem rgba(0, 123, 255, .14);
    transform: translateY(-1px);
}
.order-product-tile.is-offer { border-top: 3px solid #fd7e14; }
.order-product-tile.is-featured { border-bottom: 3px solid #ffc107; }
.order-product-tile.is-selected {
    border-color: #28a745 !important;
    box-shadow: 0 .5rem 1.25rem rgba(40, 167, 69, .18) !important;
}
.order-product-tile.is-selected::after {
    content: "\f00c";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    top: .45rem;
    right: .45rem;
    width: 1.55rem;
    height: 1.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #28a745;
    color: #fff;
    font-size: .72rem;
    box-shadow: 0 .25rem .7rem rgba(40, 167, 69, .3);
}
.order-product-photo {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: .7rem;
    background: linear-gradient(135deg, #f8f9fb, #eef2f7);
    border: 1px solid #eef1f5;
    overflow: hidden;
}
.order-product-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: .15rem;
}
.order-product-photo > span,
.order-line-photo > span {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    background: #fff;
    box-shadow: 0 .35rem .9rem rgba(15, 23, 42, .08);
}
.order-product-info {
    display: grid;
    gap: .15rem;
    text-align: center;
}
.order-product-info em {
    justify-self: center;
    padding: .08rem .45rem;
    border-radius: 999px;
    background: #f1f3f5;
    color: #495057;
    font-size: .65rem;
    font-style: normal;
    font-weight: 800;
    text-transform: uppercase;
}
.order-product-info strong {
    color: #212529;
    font-size: .88rem;
    line-height: 1.15;
    min-height: 2.25em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.order-product-info small {
    color: #007bff;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.15;
}
.order-product-info .muted-line {
    color: #6c757d;
    font-size: .68rem;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.order-search-tools {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(220px, .55fr);
    gap: .75rem;
    align-items: end;
    margin-bottom: .65rem;
}
.order-search-box {
    display: grid;
    gap: .35rem;
    margin-bottom: 0;
}
.order-search-box input,
.order-search-box select { width: 100%; }
.order-search-help { margin-bottom: .75rem; }
.order-cart-card {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: .8rem;
    padding: 1rem;
}
.order-cart-header { align-items: flex-start; }
.order-cart-delivery {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .65rem .75rem;
    border: 1px solid #d8e9ff;
    border-radius: .65rem;
    background: #f4f9ff;
}
.order-lines-list {
    display: grid;
    gap: .75rem;
}
.order-line-card {
    border: 1px solid #dfe5ec;
    border-left: 4px solid #007bff;
    border-radius: .85rem;
    background: #fff;
    padding: .75rem;
    box-shadow: 0 .25rem .85rem rgba(15, 23, 42, .06);
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.order-line-card.is-updated {
    border-color: #28a745;
    box-shadow: 0 .45rem 1.15rem rgba(40, 167, 69, .18);
    transform: translateY(-1px);
}
.order-line-top {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: .65rem;
    margin-bottom: .65rem;
}
.order-line-photo {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: .7rem;
    background: linear-gradient(135deg, #f8f9fb, #eef2f7);
    border: 1px solid #eef1f5;
    overflow: hidden;
}
.order-line-photo img { width: 100%; height: 100%; object-fit: contain; }
.order-line-title { min-width: 0; display: grid; gap: .1rem; }
.order-line-title strong {
    color: #212529;
    font-size: .92rem;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.order-line-title small {
    color: #6c757d;
    font-size: .72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.order-line-fields {
    display: grid;
    grid-template-columns: .72fr .72fr minmax(105px, 1fr);
    gap: .5rem;
    align-items: end;
}
.order-line-fields label {
    display: grid;
    gap: .25rem;
    color: #6c757d;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.order-line-brand-wrap { grid-column: auto; }
.order-line-fields input,
.order-line-fields select { min-width: 0; width: 100%; }
.order-observations { display: grid; gap: .35rem; margin-top: auto; }
.order-actions-row { margin-top: .25rem; }
.order-actions-row .btn { flex: 1 1 auto; text-align: center; }
.order-product-fly-clone {
    position: fixed !important;
    z-index: 5000;
    pointer-events: none;
    margin: 0 !important;
    opacity: .9;
    transition: transform .48s ease, opacity .48s ease;
}
.delivery-modal {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.delivery-modal.is-open { display: flex; }
.delivery-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(2px);
}
.delivery-modal-card {
    position: relative;
    width: min(520px, 96vw);
    max-height: min(92vh, 720px);
    overflow: auto;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 1.25rem 3rem rgba(15, 23, 42, .25);
    padding: 1.1rem;
}
.delivery-calendar-toolbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .75rem;
    margin: 1rem 0 .75rem;
}
.delivery-calendar-toolbar strong { text-align: center; text-transform: capitalize; }
.delivery-calendar-weekdays,
.delivery-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .35rem;
}
.delivery-calendar-weekdays { margin-bottom: .35rem; }
.delivery-calendar-weekdays span {
    color: #6c757d;
    font-size: .72rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}
.delivery-calendar-spacer { min-height: 42px; }
.delivery-calendar-day {
    min-height: 42px;
    border: 1px solid #dfe5ec;
    border-radius: .6rem;
    background: #fff;
    color: #212529;
    font-weight: 800;
    transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}
.delivery-calendar-day:not(:disabled):hover {
    border-color: #007bff;
    background: #f4f9ff;
    transform: translateY(-1px);
}
.delivery-calendar-day:disabled {
    cursor: not-allowed;
    color: #adb5bd;
    background: #f1f3f5;
    text-decoration: line-through;
}
.delivery-calendar-day.is-selected {
    border-color: #007bff;
    background: #007bff;
    color: #fff;
}
.delivery-calendar-day.is-today:not(.is-selected) { border-color: #ffc107; }
@media (max-width: 991.98px) {
    .order-form { height: auto; min-height: 0; }
    .order-search-tools { grid-template-columns: 1fr; }
    .order-workspace { grid-template-columns: 1fr; height: auto; }
    .order-left-pane { overflow: visible; padding-right: 0; }
    .order-right-pane { overflow: visible; padding: .75rem; }
    .order-cart-card { min-height: 0; }
}
@media (max-width: 575.98px) {
    .order-client-box-compact { align-items: flex-start; flex-direction: column; }
    .order-delivery-pill { justify-items: start; width: 100%; }
    .order-products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
    .order-product-tile.quick-product { min-height: 160px; padding: .6rem; }
    .order-search-tools { grid-template-columns: 1fr; }
    .order-line-fields { grid-template-columns: 1fr; }
    .delivery-modal-card { padding: .9rem; }
    .delivery-calendar-day,
    .delivery-calendar-spacer { min-height: 38px; }
}

/* Revisió final de comanda abans de formalitzar */
.order-review-shell {
    padding: 1rem;
}
.order-review-main-header {
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}
.order-review-total-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 130px;
    padding: .55rem .85rem;
    border-radius: 999px;
    background: #e8f5e9;
    color: #155724;
    font-weight: 900;
    box-shadow: 0 .35rem .9rem rgba(21, 87, 36, .08);
}
.order-review-table-wrap {
    overflow-x: auto;
    border: 1px solid #e5eaf1;
    border-radius: .85rem;
    background: #fff;
    box-shadow: 0 .35rem 1rem rgba(15, 23, 42, .05);
}
.order-review-table {
    min-width: 1120px;
    margin-bottom: 0;
}
.order-review-table thead th {
    border-top: 0;
    background: #f8f9fb;
    color: #495057;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    vertical-align: middle;
}
.order-review-table td {
    vertical-align: top;
}
.order-review-col-photo {
    width: 76px;
}
.order-review-photo-cell {
    width: 76px;
}
.order-review-photo {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .7rem;
    border: 1px solid #eef1f5;
    background: linear-gradient(135deg, #f8f9fb, #eef2f7);
    overflow: hidden;
}
.order-review-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: .15rem;
}
.order-review-photo > span {
    color: #6c757d;
    font-size: 1.05rem;
}
.order-review-product-cell strong {
    display: block;
    color: #212529;
    line-height: 1.18;
}
.order-review-product-cell small,
.order-review-price-cell small {
    display: block;
    color: #6c757d;
    font-size: .75rem;
}
.order-review-col-small {
    width: 115px;
}
.order-review-col-brand {
    width: 165px;
}
.order-review-col-price {
    width: 125px;
}
.order-review-brand-cell {
    min-width: 150px;
    color: #495057;
    font-weight: 700;
}
.order-review-price-cell strong {
    color: #007bff;
    white-space: nowrap;
}
.order-review-table input,
.order-review-table select,
.order-review-table textarea,
.order-review-observations textarea {
    width: 100%;
    min-width: 0;
}
.order-review-table textarea {
    min-height: 46px;
    resize: vertical;
}
.order-review-observations {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
    margin-top: 1rem;
}
.order-review-observations label {
    display: grid;
    gap: .35rem;
    padding: .85rem;
    border: 1px solid #e5eaf1;
    border-radius: .85rem;
    background: #fdfefe;
}
.order-review-observations span {
    color: #495057;
    font-size: .75rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.order-review-actions {
    justify-content: flex-end;
    margin-top: 1rem;
}
.order-review-actions .btn {
    min-width: 170px;
    text-align: center;
}
@media (max-width: 991.98px) {
    .order-review-observations {
        grid-template-columns: 1fr;
    }
    .order-review-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }
    .order-review-actions .btn {
        width: 100%;
    }
}

/* Step 48: articles sense foto amb pujada directa per drag & drop */
.product-missing-intro .action-row {
    justify-content: flex-end;
}
.small-stat {
    font-size: .8rem !important;
    line-height: 1.25;
    word-break: break-word;
}
.product-missing-filters {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) minmax(180px, 1fr) minmax(150px, .8fr) auto;
    gap: .75rem;
    align-items: end;
}
.product-missing-filters label {
    margin-bottom: 0;
}
.product-missing-filter-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
    justify-content: flex-end;
}
.missing-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}
.missing-product-card {
    border: 1px solid #e5e9ef;
    border-radius: .75rem;
    background: #fff;
    padding: .8rem;
    box-shadow: 0 .25rem .75rem rgba(15, 23, 42, .04);
    display: grid;
    gap: .75rem;
}
.missing-product-info {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: .7rem;
    align-items: center;
}
.missing-product-placeholder {
    width: 54px;
    height: 54px;
    border-radius: .6rem;
    border: 1px solid #e9edf2;
    background: #f8f9fb;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.missing-product-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
}
.missing-product-title-row strong {
    display: block;
    min-width: 0;
    line-height: 1.25;
}
.missing-product-upload-form {
    display: grid;
    gap: .65rem;
}
.missing-product-dropzone {
    min-height: 156px;
    border: 2px dashed #cfd8e3;
    border-radius: .8rem;
    background: linear-gradient(135deg, #f8f9fb, #eef3f8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .85rem;
    text-align: center;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease;
    margin-bottom: 0;
    overflow: hidden;
}
.missing-product-dropzone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.missing-product-dropzone.is-dragover {
    border-color: #007bff;
    background: #edf6ff;
    box-shadow: 0 0 0 .18rem rgba(0, 123, 255, .12);
    transform: translateY(-1px);
}
.dropzone-idle {
    display: grid;
    gap: .25rem;
    color: #495057;
}
.dropzone-idle i {
    font-size: 1.8rem;
    color: #007bff;
}
.dropzone-idle small,
.dropzone-preview small {
    color: #6c757d;
}
.dropzone-preview {
    width: 100%;
    display: grid;
    gap: .45rem;
    align-items: center;
    justify-items: center;
}
.dropzone-preview img {
    max-width: 100%;
    width: 100%;
    height: 118px;
    object-fit: contain;
    border-radius: .55rem;
    background: repeating-conic-gradient(#f8f9fb 0% 25%, #eef1f5 0% 50%) 50% / 18px 18px;
    border: 1px solid #e7ebf1;
}
.missing-product-upload-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
}
@media (max-width: 991.98px) {
    .product-missing-filters {
        grid-template-columns: 1fr 1fr;
    }
    .product-missing-filter-actions {
        justify-content: flex-start;
    }
}
@media (max-width: 767.98px) {
    .product-missing-filters,
    .missing-product-grid {
        grid-template-columns: 1fr;
    }
    .missing-product-upload-actions,
    .product-missing-intro .action-row {
        justify-content: stretch;
        flex-direction: column;
    }
    .missing-product-upload-actions .btn,
    .product-missing-intro .action-row .btn {
        width: 100%;
    }
}

/* Entrada de comandes per teclat */
.order-client-main-info {
    min-width: 0;
}
.order-keyboard-entry-box {
    display: grid;
    gap: .25rem;
    justify-items: center;
    min-width: 180px;
}
.order-keyboard-entry-box span {
    color: #6c757d;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.order-keyboard-entry-box small {
    color: #6c757d;
    font-size: .72rem;
}
.order-keyboard-modal {
    position: fixed;
    inset: 0;
    z-index: 4200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.order-keyboard-modal.is-open { display: flex; }
.order-keyboard-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(2px);
}
.order-keyboard-modal-card {
    position: relative;
    width: min(1120px, 98vw);
    max-height: min(92vh, 760px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: .9rem;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 1.25rem 3rem rgba(15, 23, 42, .28);
    padding: 1.1rem;
}
.order-keyboard-modal-header { align-items: flex-start; }
.order-keyboard-table-wrap {
    overflow: auto;
    border: 1px solid #e5eaf1;
    border-radius: .85rem;
    background: #fff;
}
.order-keyboard-table {
    width: 100%;
    min-width: 1120px;
    border-collapse: collapse;
}
.order-keyboard-table th,
.order-keyboard-table td {
    padding: .55rem;
    border-bottom: 1px solid #edf1f5;
    vertical-align: middle;
}
.order-keyboard-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8f9fb;
    color: #495057;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-align: left;
    text-transform: uppercase;
}
.order-keyboard-table tr.is-resolved td { background: #fbfefc; }
.order-keyboard-table tr.has-error td { background: #fff5f5; }
.order-keyboard-table input,
.order-keyboard-table select {
    width: 100%;
    min-width: 0;
}
.order-keyboard-code { width: 130px; }
.order-keyboard-name { min-width: 270px; }
.order-keyboard-unit-qty { width: 70px; }
.order-keyboard-stock { width: 95px; }
.order-keyboard-pvp { width: 115px; }
.order-keyboard-margin { width: 90px; }
.order-keyboard-comment { min-width: 220px; }
.order-keyboard-table input.is-below-minimum-margin { color: #b42318; font-weight: 800; }
.order-keyboard-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.order-keyboard-modal-footer .actions-row { margin-top: 0; }
@media (max-width: 575.98px) {
    .order-keyboard-entry-box { justify-items: start; width: 100%; }
    .order-keyboard-modal-card { padding: .85rem; }
    .order-keyboard-modal-footer { align-items: stretch; flex-direction: column; }
}

.order-review-col-actions,
.order-review-actions-cell {
    width: 72px;
    text-align: center;
    white-space: nowrap;
}

.order-review-actions-cell .btn {
    min-width: 42px;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
}


/* Avisos dashboard amb columna d'icona */
.adcrm-alert-row {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
}
.adcrm-alert-icon-col {
    flex: 0 0 34px;
    display: flex;
    justify-content: center;
    padding-top: .1rem;
}
.adcrm-alert-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    background: #fff3cd;
    color: #856404;
}
.adcrm-alert-icon-activity {
    background: #d1ecf1;
    color: #0c5460;
}
.adcrm-alert-content {
    min-width: 0;
    flex: 1 1 auto;
}
.adcrm-top-icon-link {
    position: relative;
}
.adcrm-top-badge {
    top: 3px !important;
    right: 5px !important;
}

/* Dashboard recent alerts */
.adcrm-alert-row {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
}

.adcrm-alert-icon-col {
    flex: 0 0 32px;
    width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(0, 0, 0, .04);
    font-size: 1rem;
}

.adcrm-alert-content-col {
    flex: 1 1 auto;
    min-width: 0;
}

.adcrm-dashboard-alert-item.adcrm-alert-type-agenda {
    background: #eef7ff;
}
.adcrm-dashboard-alert-item.adcrm-alert-type-agenda:hover,
.adcrm-dashboard-alert-item.adcrm-alert-type-agenda:focus {
    background: #e3f1ff;
}

/* Client access: pending order in left sidebar */
@keyframes adcrm-sidebar-order-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .45; }
}
.adcrm-sidebar-order-processing {
    animation: adcrm-sidebar-order-pulse 1.1s ease-in-out infinite;
}

.adcrm-dashboard-alert-item.adcrm-alert-type-logistics_incident,
.adcrm-dashboard-alert-item.adcrm-alert-type-logistics_not_delivered {
    background: #fff5f5;
}
.adcrm-dashboard-alert-item.adcrm-alert-type-logistics_incident:hover,
.adcrm-dashboard-alert-item.adcrm-alert-type-logistics_incident:focus,
.adcrm-dashboard-alert-item.adcrm-alert-type-logistics_not_delivered:hover,
.adcrm-dashboard-alert-item.adcrm-alert-type-logistics_not_delivered:focus {
    background: #ffe8e8;
}
.adcrm-delivery-incident-details dd {
    margin-bottom: .45rem;
}
.adcrm-delivery-incident-note {
    white-space: normal;
}

/* STEP 46 - Clients potencials / pipeline comercial */
.prospects-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(210px, 1fr));
    gap: .85rem;
    overflow-x: auto;
    padding-bottom: .3rem;
}
.prospects-stage {
    min-width: 210px;
    background: #f7f8fa;
    border: 1px solid #e2e6ea;
    border-radius: 14px;
    padding: .75rem;
}
.prospects-stage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .65rem;
}
.prospect-mini-card {
    display: block;
    background: #fff;
    border: 1px solid #e4e7eb;
    border-radius: 12px;
    padding: .7rem;
    margin-bottom: .55rem;
    color: inherit;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.prospect-mini-card:hover,
.prospect-mini-card:focus {
    color: inherit;
    text-decoration: none;
    border-color: #9ab7d5;
    box-shadow: 0 3px 10px rgba(0,0,0,.08);
}
.prospect-mini-card strong,
.prospect-mini-card small,
.prospect-mini-meta {
    display: block;
}
.prospect-mini-card strong {
    line-height: 1.2;
    margin-bottom: .2rem;
}
.prospect-mini-meta,
.prospects-stage-empty,
.prospects-stage-more {
    font-size: .78rem;
    color: #6c757d;
}
.prospects-stage-empty,
.prospects-stage-more {
    padding: .55rem;
    text-align: center;
}
.prospect-status-main {
    font-size: .9rem;
    padding: .45rem .7rem;
    border-radius: 999px;
}
.prospect-detail-grid .card p:last-child {
    margin-bottom: 0;
}
.prospect-timeline {
    display: flex;
    flex-direction: column;
    gap: .9rem;
}
.prospect-timeline-item {
    display: flex;
    gap: .75rem;
}
.prospect-timeline-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e9f2ff;
    color: #1f5f99;
    flex: 0 0 34px;
}
.prospect-timeline-body {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid #e6e9ed;
    border-radius: 12px;
    padding: .8rem;
    background: #fff;
}
.prospect-timeline-body p {
    margin: .5rem 0 0;
}
.inline-form {
    display: inline-block;
    margin: 0;
}
.badge-orange {
    background: #fd7e14;
    color: #fff;
}
.grid.four-cols {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid.three-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1199.98px) {
    .prospects-board { grid-template-columns: repeat(5, 230px); }
    .grid.four-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .grid.three-cols,
    .grid.four-cols { grid-template-columns: 1fr; }
    .prospect-timeline-item { gap: .5rem; }
    .prospect-timeline-icon { display: none; }
}

.adcrm-kpi-goal-number {
    font-size: 1.45rem;
    line-height: 1.15;
    word-break: keep-all;
}

.adcrm-kpi-row .small-box p small {
    opacity: .92;
    margin-top: .15rem;
}


/* Pas 43: ajust responsive del menú superior per tablets tipus Windows Surface.
   En PC (>1200px) no canvia res; en tablet es compacta i el bloc central fa scroll horitzontal. */
@media (max-width: 1199.98px), (max-width: 1460px) and (any-pointer: coarse) {
    .adcrm-adminlte-custom .main-header.adcrm-topbar-light {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        overflow: visible;
        position: relative;
        z-index: 1200;
        padding-left: .35rem;
        padding-right: .35rem;
    }
    .adcrm-adminlte-custom .main-header.adcrm-topbar-light > .navbar-nav:first-child {
        flex: 0 0 auto;
        margin-right: .25rem !important;
    }
    .adcrm-adminlte-custom .adcrm-top-icon-menu {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        gap: .08rem;
        padding: .12rem 0;
    }
    .adcrm-adminlte-custom .adcrm-top-icon-menu::-webkit-scrollbar {
        height: 6px;
    }
    .adcrm-adminlte-custom .adcrm-user-menu {
        flex: 0 0 auto;
        margin-left: .35rem !important;
        white-space: nowrap;
        position: relative;
        z-index: 1210;
    }
    .adcrm-adminlte-custom .adcrm-user-menu .user-menu,
    .adcrm-adminlte-custom .adcrm-user-menu .dropdown {
        position: relative;
        z-index: 1215;
    }
    .adcrm-adminlte-custom .adcrm-user-menu .dropdown-menu {
        z-index: 1220;
    }
    .adcrm-adminlte-custom .adcrm-top-item,
    .adcrm-adminlte-custom .adcrm-user-menu > .nav-item {
        flex: 0 0 auto;
    }
    .adcrm-adminlte-custom .adcrm-top-separator {
        display: none;
    }
    .adcrm-adminlte-custom .adcrm-top-icon-link,
    .adcrm-adminlte-custom .adcrm-top-icon-link:hover,
    .adcrm-adminlte-custom .adcrm-top-icon-link:focus,
    .adcrm-adminlte-custom .adcrm-hover-dropdown:hover > .adcrm-top-icon-link,
    .adcrm-adminlte-custom .adcrm-top-icon-link.active {
        width: 44px;
        min-width: 44px;
        max-width: 44px;
        height: 42px;
        padding: 0 !important;
        justify-content: center;
    }
    .adcrm-adminlte-custom .adcrm-user-menu .adcrm-top-icon-link,
    .adcrm-adminlte-custom .adcrm-user-menu .adcrm-top-icon-link:hover,
    .adcrm-adminlte-custom .adcrm-user-menu .adcrm-top-icon-link:focus,
    .adcrm-adminlte-custom .adcrm-user-menu .adcrm-top-icon-link.active {
        width: 40px;
        min-width: 40px;
        max-width: 40px;
    }
    .adcrm-adminlte-custom .adcrm-top-icon-link i {
        margin: 0 auto;
        font-size: 1.12rem;
    }
    .adcrm-adminlte-custom .adcrm-top-icon-link span:not(.badge) {
        display: none;
        opacity: 0;
        max-width: 0;
        margin-left: 0;
    }
    .adcrm-adminlte-custom .adcrm-top-badge {
        top: 0;
        right: 0;
    }
}

/* PWA offline orders */
.offline-order-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
}
.offline-order-stats .stat-card {
    min-height: 96px;
    margin-bottom: 0;
}
.offline-order-stats .stat-card small {
    display: block;
    margin-bottom: .45rem;
    color: #6c757d;
    font-weight: 600;
}
.offline-order-grid {
    align-items: start;
}
.offline-order-card {
    overflow: visible;
}
.offline-results.compact {
    max-height: 320px;
    overflow: auto;
}
.offline-selectable,
.offline-product-pick {
    width: 100%;
    border: 0;
    text-align: left;
    background: #fff;
}
.offline-selectable:hover,
.offline-selectable:focus {
    background: #f5f7fb;
    cursor: pointer;
}
.offline-product-pick {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.offline-selected-box {
    margin-top: .75rem;
    border: 1px solid rgba(52, 58, 64, .15);
    border-radius: 14px;
    padding: .85rem;
    background: #f8fafc;
}
.offline-client-delivery-row {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(220px, .65fr);
    gap: .75rem;
    align-items: stretch;
}
.offline-client-delivery-row .offline-selected-box {
    margin-top: 0;
    height: 100%;
}
.offline-delivery-box {
    border: 1px solid rgba(52, 58, 64, .15);
    border-radius: 14px;
    padding: .85rem;
    background: #fff;
    display: flex;
    align-items: center;
}
.offline-delivery-box label {
    display: block;
    width: 100%;
    margin: 0;
    font-weight: 600;
    color: #343a40;
}
.offline-delivery-box .form-control {
    margin-top: .35rem;
    width: 100%;
}
.offline-selected-box small,
.offline-selected-box span,
.offline-queue-item small,
.offline-cart-table small {
    display: block;
    color: #6c757d;
}
.offline-cart-table-wrap {
    overflow-x: auto;
}
.offline-cart-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}
.offline-cart-table th,
.offline-cart-table td {
    border-bottom: 1px solid rgba(52, 58, 64, .08);
    padding: .55rem;
    vertical-align: middle;
}
.offline-cart-table tfoot td {
    background: #f8fafc;
}
.offline-cart-table input,
.offline-cart-table select {
    min-width: 90px;
}
.offline-order-queue {
    display: grid;
    gap: .65rem;
}
.offline-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid rgba(52, 58, 64, .12);
    border-radius: 14px;
    padding: .8rem;
    background: #fff;
}
.offline-queue-item.is-error {
    border-color: rgba(220, 53, 69, .35);
}
.offline-queue-item.is-sent {
    opacity: .78;
}
.offline-error-text {
    display: block;
    color: #c82333;
    font-size: .84rem;
    margin-top: .25rem;
}
@media (max-width: 991.98px) {
    .offline-order-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 575.98px) {
    .offline-order-stats {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 767.98px) {
    .offline-client-delivery-row {
        grid-template-columns: 1fr;
    }
    .offline-queue-item,
    .offline-product-pick {
        align-items: stretch;
        flex-direction: column;
    }
}
