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

:root {
    --bg: #f8f9fa;
    --panel: #ffffff;
    --text: #181716;
    --muted: #6c757d;
    --line: #dee2e6;
    --primary: #1f1f1f;
    --primary-hover: #000000;
    --danger: #b42318;
    --success: #067647;
    --soft: #f1f3f5;
    --radius: 28px;
    --shadow: 0 20px 55px rgba(33, 37, 41, .07);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}
/* Patch - prevent accidental text highlighting across the UI */
*,
*::before,
*::after {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}



b,
strong {
    font-weight: 600;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

p {
    color: var(--muted);
    line-height: 1.65;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    background: #fff;
    border-radius: 18px;
    padding: 15px 16px;
    outline: none;
    color: var(--text);
}

input::placeholder,
textarea::placeholder,
.form-control::placeholder {
    color: #adb5bd;
    opacity: 1;
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder,
.form-control::-webkit-input-placeholder {
    color: #adb5bd;
    opacity: 1;
}

input::-moz-placeholder,
textarea::-moz-placeholder,
.form-control::-moz-placeholder {
    color: #adb5bd;
    opacity: 1;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #adb5bd;
    box-shadow: 0 0 0 4px rgba(33, 37, 41, .06);
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: #343a40;
}

hr {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--line);
    margin: 12px 0;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.login-card {
    width: min(1050px, 100%);
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 28px;
    align-items: center;
}

.login-copy {
    padding: 32px;
}

.login-copy h1 {
    font-size: clamp(2.2rem, 6vw, 4.6rem);
    line-height: .98;
    letter-spacing: -.06em;
    margin: 28px 0 18px;
}

.login-copy p {
    font-size: 1.08rem;
    max-width: 560px;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px;
    background: rgba(255, 255, 255, .72);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
}


.sidebar-main {
    min-width: 0;
}

.sidebar-account {
    border: 0;
    background: rgb(246, 247, 248);
    overflow: hidden;
    margin: -1.5rem;
    padding: 10px 1.5rem 8px 1.5rem;
}

.sidebar-account-row {
    display: flex;
    width: 100%;
    border-top: 1px solid var(--line);
}

.sidebar-account-row:first-child {
    border-top: 0;
}

.sidebar-account-row:hover {
    background: var(--soft);
}

.sidebar-identity {
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px;
}

.sidebar-link {
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 14px;
    font-weight: 500;
}

.sidebar-avatar,
.profile-photo-preview {
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
    flex: 0 0 auto;
}

.sidebar-avatar {
    width: 46px;
    height: 46px;
    border-radius: 17px;
}

.sidebar-avatar img,
.profile-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user-text {
    display: block;
    min-width: 0;
}

.sidebar-user-text strong,
.sidebar-user-text small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-text strong {
    font-size: .95rem;
}

.sidebar-user-text small {
    color: var(--muted);
    margin-top: 2px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    margin-bottom: 34px;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
}

.brand-mark.large {
    width: 62px;
    height: 62px;
    border-radius: 22px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-menu a,
.nav-menu .sidebar-collapse-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    color: #393633;
    font-weight: 500;
}

.menu-icon {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    color: #343a40;
}

.menu-icon svg {
    display: block;
    width: 20px;
    height: 20px;
}

.nav-menu a:hover,
.nav-menu .sidebar-collapse-toggle:hover {
    background: var(--soft);
}

.main-area {
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 28px 36px 12px;
}

.topbar h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    letter-spacing: -.05em;
    line-height: 1;
}

.eyebrow {
    margin-bottom: 8px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 800;
    font-size: .74rem;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 10px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
}

.user-pill span {
    font-weight: 800;
}

.user-pill small {
    color: var(--muted);
}

.user-pill a {
    padding: 9px 12px;
    border-radius: 999px;
    background: var(--soft);
    font-weight: 800;
}

.content {
    padding: 29px 36px 24px;
}

.card,
.hero-card,
.stat-card,
.quick-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 34px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
}

.hero-card h2 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.05;
    letter-spacing: -.05em;
    max-width: 780px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stats-grid.stats-grid-five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stat-card {
    padding: 24px;
}

.stat-card span {
    color: var(--muted);
    font-weight: 700;
}

.stat-card strong {
    display: block;
    font-size: 2.3rem;
    letter-spacing: -.04em;
    margin-top: 12px;
}



.dashboard-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, .9fr);
    gap: 24px;
    align-items: stretch;
    margin-bottom: 24px;
}

.dashboard-summary-grid .weekly-orders-chart-card {
    margin-bottom: 0;
    min-height: 100%;
}

.dashboard-status-column {
    min-width: 0;
    display: flex;
}

.dashboard-summary-grid .dashboard-status-grid {
    width: 100%;
    margin-bottom: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-summary-grid .stat-card {
    min-height: 168px;
}

.weekly-orders-chart-card {
    margin-bottom: 24px;
    padding: 24px;
    background: #050505;
    border-color: #050505;
    color: #fff;
    overflow: hidden;
}

.weekly-orders-chart-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 20px;
}

.weekly-orders-chart-heading .eyebrow {
    color: rgba(255, 255, 255, .56);
}

.weekly-orders-chart-heading h3 {
    margin: 0;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.03em;
}

.weekly-orders-chart-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}


.dashboard-chart-period-form {
    margin: 0;
}

.dashboard-chart-period-select {
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background-color: rgba(255, 255, 255, .12);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 14px 14px;
    color: #fff;
    padding: 0 42px 0 16px;
    font-size: .9rem;
    font-weight: 700;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.dashboard-chart-period-select option {
    color: var(--text);
    background: #fff;
}

.dashboard-chart-period-select:focus {
    border-color: rgba(255, 255, 255, .48);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .12);
}

.weekly-orders-bars-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.weekly-orders-bars-scroll::-webkit-scrollbar {
    height: 6px;
}

.weekly-orders-bars-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, .22);
}

.weekly-orders-bars {
    display: grid;
    grid-template-columns: repeat(var(--weekly-orders-count, 15), minmax(24px, 1fr));
    gap: 8px;
    align-items: end;
    min-width: calc(var(--weekly-orders-count, 15) * 32px);
}

.weekly-orders-bar-item {
    position: relative;
    min-width: 0;
}

.weekly-orders-bar-track {
    position: relative;
    height: 170px;
    display: flex;
    align-items: flex-end;
    border-radius: 18px;
    background: rgba(255, 255, 255, .08);
    overflow: hidden;
}

.weekly-orders-bar {
    position: relative;
    display: block;
    width: 100%;
    min-height: 2px;
    border-radius: 18px 18px 0 0;
    background: #fff;
}

.weekly-orders-bar-item:hover .weekly-orders-bar-track,
.weekly-orders-bar-item:focus-within .weekly-orders-bar-track {
    background: rgba(255, 255, 255, .18);
}

.weekly-orders-tooltip {
    position: absolute;
    left: 50%;
    bottom: 42px;
    z-index: 3;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 96px;
    padding: 9px 12px;
    border-radius: 14px;
    background: #fff;
    color: #050505;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 6px);
}

.weekly-orders-bar-item:hover .weekly-orders-tooltip,
.weekly-orders-bar-item:focus-within .weekly-orders-tooltip {
    opacity: 1;
    transform: translate(-50%, 0);
}

.weekly-orders-tooltip strong {
    color: #050505;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
}

.weekly-orders-tooltip small {
    margin-top: 5px;
    color: #6b7280;
    font-size: .68rem;
    font-weight: 500;
    line-height: 1.1;
    white-space: nowrap;
}

.weekly-orders-bar-item > small {
    display: block;
    margin-top: 10px;
    color: rgba(255, 255, 255, .68);
    font-size: .68rem;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .dashboard-summary-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-summary-grid .stat-card {
        min-height: auto;
    }
}

@media (max-width: 720px) {
    .weekly-orders-chart-card {
        padding: 20px;
    }

    .weekly-orders-chart-heading {
        flex-direction: column;
    }

    .weekly-orders-chart-actions {
        width: 100%;
        justify-content: space-between;
    }

    .dashboard-chart-period-select {
        max-width: 160px;
    }

    .dashboard-summary-grid .dashboard-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .weekly-orders-bars {
        gap: 7px;
        min-width: calc(var(--weekly-orders-count, 15) * 30px);
    }

    .weekly-orders-bar-track {
        height: 130px;
        border-radius: 14px;
    }

    .weekly-orders-bar {
        border-radius: 14px 14px 0 0;
    }

    .weekly-orders-bar-item > small {
        font-size: .62rem;
    }

    .weekly-orders-tooltip {
        min-width: 86px;
        padding: 8px 10px;
        bottom: 36px;
    }
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.quick-card {
    display: block;
    padding: 28px;
    transition: transform .18s ease, box-shadow .18s ease;
}

.quick-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 65px rgba(33, 37, 41, .1);
}

.page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.page-actions h2 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    letter-spacing: -.04em;
    margin-bottom: 6px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    min-height: 48px;
    padding: 0 1.4rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-light {
    background: var(--soft);
    color: var(--text);
}

.btn-danger {
    background: #fff1f0;
    color: var(--danger);
}

.alert {
    position: relative;
    padding: 14px 54px 14px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
    font-weight: 600;
    line-height: 1.45;
}

.alert-text {
    display: block;
}

.alert-close {
    position: absolute;
    top: 50%;
    right: 16px;
    width: 30px;
    height: 30px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: currentColor;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    font-weight: 800;
    opacity: .62;
    transition: background .18s ease, opacity .18s ease;
}

.alert-close:hover,
.alert-close:focus {
    background: rgba(0, 0, 0, .06);
    opacity: 1;
    outline: none;
}

.login-card .alert {
    margin: 0 0 18px;
}

.alert-success {
    border-color: #b7e4cf;
    color: var(--success);
    background: #ecfdf3;
}

.alert-danger {
    border-color: #fecdca;
    color: var(--danger);
    background: #fff1f0;
}

.form-card {
    padding: 28px;
}

.form-card.wide {
  max-width: 1280px;
}

.form-card h2 {
    font-size: 2rem;
    letter-spacing: -.04em;
}

.form-card label:not(:first-child) {
    margin-top: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.switch-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

.switch-row input {
    width: 20px;
    height: 20px;
}

.hint-box {
    margin-top: 18px;
    border-radius: 20px;
    background: var(--soft);
    padding: 16px;
    color: var(--muted);
    line-height: 1.7;
}

.table-card {
    overflow: scroll;
}

.responsive-table {
    width: 100%;
    border-collapse: collapse;
}

.responsive-table th,
.responsive-table td {
    padding: 18px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.responsive-table th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
}

.responsive-table small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.table-actions form {
    margin: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border-radius: 999px;
    padding: 0 12px;
    font-weight: 800;
    font-size: .82rem;
}

.badge-success {
    background: #ecfdf3;
    color: var(--success);
}

.badge-muted {
    background: var(--soft);
    color: var(--muted);
}

.badge-soft {
    background: #f2f4f7;
    color: #344054;
}

.badge-status-pending {
    background: #f8f9fa;
    color: #495057;
}

.badge-status-processing {
    background: #fff7ed;
    color: #937605;
}

.badge-status-ready {
    background: #ecfdf3;
    color: #027a48;
}

.badge-status-shipped {
    background: #eff6ff;
    color: #1d4ed8;
}

.badge-status-received {
    background: #dbe9f2;
    color: #082c80;
}

.empty-cell {
    text-align: center !important;
    color: var(--muted);
    padding: 34px !important;
}

.items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 28px 0 12px;
}

.items-header h3 {
    margin-bottom: 4px;
}

.order-items {
    display: grid;
    gap: 10px;
    margin-bottom: 22px;
}

.order-row {
    display: grid;
    grid-template-columns: 2fr .7fr 1.3fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid var(--line);
    border-radius: 22px;
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .sidebar-account {
        margin-top: 4px;
    }

    .nav-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 6px;
    }

    .nav-menu hr {
        display: none;
    }

    .topbar,
    .page-actions,
    .hero-card,
    .items-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .content {
        padding: 24px 20px 48px;
    }

    .alert {
        margin-left: 20px;
        margin-right: 20px;
    }

    .stats-grid,
    .grid-2,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        grid-template-columns: 1fr;
    }

    .login-copy {
        padding: 0;
    }

    .order-row,
    .profile-summary {
        grid-template-columns: 1fr;
    }

    .profile-photo-preview {
        width: 126px;
        height: 126px;
        border-radius: 34px;
    }
}

@media (max-width: 720px) {
    .auth-page {
        padding: 18px;
    }

    .user-pill {
        width: 100%;
        justify-content: space-between;
    }

    .hero-card,
    .form-card,
    .quick-card,
    .stat-card {
        padding: 22px;
        border-radius: 24px;
    }

    .responsive-table,
    .responsive-table thead,
    .responsive-table tbody,
    .responsive-table th,
    .responsive-table td,
    .responsive-table tr {
        display: block;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tr {
        padding: 16px;
        border-bottom: 1px solid var(--line);
    }

    .responsive-table td {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        border-bottom: 0;
        padding: 9px 0;
    }

    .responsive-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 800;
    }

    .table-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
        padding-top: 12px !important;
    }

    .table-actions::before {
        display: none;
    }
}

.order-form {
    display: grid;
    gap: 18px;
}

.quote-form {
    display: grid;
    gap: 18px;
}

.order-section {
    max-width: 1120px;
}

.section-heading,
.section-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.section-heading {
    margin-bottom: 22px;
}

.section-heading.with-action {
    align-items: center;
    justify-content: space-between;
}

.section-heading h3 {
    font-size: 1.45rem;
    letter-spacing: -.03em;
    margin-bottom: 4px;
}

.section-heading p {
    margin-bottom: 0;
}

.section-number {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
}

.autocomplete-wrap {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 30;
    margin-top: 8px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.autocomplete-item {
    width: 100%;
    display: block;
    text-align: left;
    padding: 12px;
    border: 0;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
}

.autocomplete-item:hover {
    background: var(--soft);
}

.autocomplete-item strong,
.autocomplete-item small {
    display: block;
}

.autocomplete-item small {
    margin-top: 4px;
    color: var(--muted);
}

.toggle-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    background: #f8f9fa;
    border-radius: 22px;
    margin-bottom: 18px;
    cursor: pointer;
}

.toggle-card strong,
.toggle-card small {
    display: block;
}

.toggle-card small {
    margin-top: 4px;
    color: var(--muted);
    font-weight: 500;
}

.toggle-card input {
    position: relative;
    width: 54px;
    min-width: 54px;
    height: 30px;
    padding: 0;
    appearance: none;
    border-radius: 999px;
    background: #e9ecef;
    border: 1px solid #ced4da;
    cursor: pointer;
    transition: background .18s ease;
}

.toggle-card input::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
    transition: transform .18s ease;
}

.toggle-card input:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.toggle-card input:checked::after {
    transform: translateX(24px);
}

/* Patch - delivery toggle: switch on the left, text next to it */
.delivery-toggle-card {
    justify-content: flex-start;
    align-items: flex-start;
    gap: 12px;
}

.delivery-toggle-card input {
    margin-top: 2px;
}

.delivery-toggle-card span {
    min-width: 0;
}

.delivery-panel {
    margin-bottom: 18px;
}

.is-hidden {
    display: none !important;
}

.inline-warning {
    margin: 10px 0 1rem;
    padding: 12px 14px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 16px;
    color: #9a3412;
    font-weight: 700;
}

.submit-bar {
    max-width: 1120px;
    display: flex;
    justify-content: flex-start;
    padding-bottom: 10px;
}

@media (max-width: 980px) {
    .section-heading.with-action,
    .section-title-wrap,
    .section-heading {
        align-items: flex-start;
    }

    .section-heading.with-action {
        flex-direction: column;
    }

    .submit-bar {
        justify-content: flex-start;
    }

    .submit-bar .btn {
        width: auto;
        max-width: 100%;
    }
}

/* Select: sposta la freccia più all'interno e lascia più margine a destra */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 58px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 22px) 50%;
    background-size: 14px 14px;
}


.profile-form {
    display: grid;
    gap: 20px;
}

.profile-card {
    margin-bottom: 0;
}

.profile-summary {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 18px;
    align-items: start;
}

.profile-photo-box {
    display: grid;
    gap: 12px;
    justify-items: start;
}

.profile-photo-label {
    position: relative;
    display: inline-block;
    margin: 0;
    cursor: pointer;
}

.profile-photo-preview {
    width: 140px;
    height: 140px;
    border-radius: 38px;
    font-size: 2.3rem;
    box-shadow: 0 18px 45px rgba(33, 37, 41, .12);
}

.camera-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    background: var(--primary);
    border: 3px solid #fff;
    box-shadow: 0 10px 24px rgba(33, 37, 41, .18);
}

.profile-photo-label:hover .camera-badge {
    background: var(--primary-hover);
}

.profile-photo-box small {
    color: var(--muted);
    line-height: 1.5;
}

.profile-meta-card {
    display: block;
    width: 100%;
    padding: 0;
}

.profile-meta-card input:disabled {
    color: var(--muted);
    background: #f8f9fa;
    opacity: 1;
}

.profile-meta-grid {
    margin-top: 0;
    width: 100%;
    align-items: start;
}

.profile-meta-grid label {
    margin-bottom: 8px;
}

.profile-errors {
    max-width: 980px;
    margin-left: 0;
    margin-right: 0;
}

@media (max-width: 980px) {
    .profile-summary {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .profile-photo-preview {
        width: 126px;
        height: 126px;
        border-radius: 34px;
    }
}


.field-full {
    grid-column: 1 / -1;
}

/* Ordini: dettagli in popup nascosta finché non si clicca su #ID */
.orders-table th:first-child,
.orders-table td:first-child {
    width: 88px;
}

.order-id-button {
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 800;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.order-id-button:hover,
.order-id-button:focus {
    color: var(--primary-hover);
    outline: none;
}

.is-cancelled-row {
    opacity: .72;
}

.badge-danger {
    background: #fff1f0;
    color: var(--danger);
}

body.modal-open {
    overflow: hidden;
}

.order-modal[hidden] {
    display: none !important;
}

.order-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    padding: 24px;
}

.order-modal.is-open {
    display: grid;
    place-items: center;
}

.order-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .42);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.order-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 30px;
    box-shadow: 0 30px 90px rgba(17, 24, 39, .22);
    padding: 28px;
}

.order-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: #f8f9fa;
    color: var(--text);
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.order-modal-close:hover,
.order-modal-close:focus {
    background: #e9ecef;
    outline: none;
}

.order-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-right: 44px;
    margin-bottom: 22px;
}

.order-modal-header h3 {
    font-size: clamp(1.7rem, 4vw, 2.35rem);
    letter-spacing: -.04em;
    margin-bottom: 6px;
}

.order-modal-header p,
.order-detail-box p,
.order-detail-section p,
.order-log-item p {
    margin-bottom: 0;
}

.order-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.order-detail-box,
.order-detail-section {
    border: 1px solid var(--line);
    background: #f8f9fa;
    border-radius: 24px;
    padding: 18px;
}

.order-detail-box h4,
.order-detail-section h4 {
    margin-bottom: 12px;
    font-size: 1rem;
}

.order-detail-section {
    margin-top: 14px;
}

.order-detail-items {
    display: grid;
    gap: 10px;
}

.order-detail-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.order-detail-item:last-child {
    border-bottom: 0;
}

.order-detail-item small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.order-modal-total {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 1.08rem;
}

.order-log-list {
    display: grid;
    gap: 12px;
}

.order-log-item {
    display: grid;
    gap: 8px;
    margin: 0 0 10px;
    padding: 14px;
    border-radius: 18px;
    background: #f5f5f9;
    border: 1px solid var(--line);
}

.order-log-item small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.order-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.muted-text {
    color: var(--muted);
}

@media (max-width: 720px) {
    .order-modal {
        padding: 12px;
    }

    .order-modal-dialog {
        max-height: calc(100vh - 24px);
        border-radius: 24px;
        padding: 22px;
    }

    .order-modal-header,
    .order-detail-grid,
    .order-detail-item,
    .order-modal-actions {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }

    .order-modal-actions .btn {
        width: 100%;
    }
}

/* Bootstrap 5.3 compatibility layer */
.btn {
    border-radius: 999px !important;
    min-height: 48px;
    line-height: 48px;
    padding: 0 2rem;
    font-size: 1rem;
    font-weight: 700;
}

.btn-close {
    margin-top: 4px;
    font-size: 10px;
}

hr,
.dropdown-divider {
    opacity: 1 !important;
    color: #eaeaea;
    border-color: #eaeaea;
}

.form-control,
.form-select {
    width: 100%;
    border: 1px solid var(--line);
    background-color: #fff;
    border-radius: 18px;
    padding: 15px 16px;
    min-height: 54px;
    outline: none;
    color: var(--text);
    box-shadow: none;
}

.form-control:focus,
.form-select:focus {
    border-color: #adb5bd;
    box-shadow: 0 0 0 4px rgba(33, 37, 41, .06);
}

.form-select {
    padding-right: 58px;
    background-position: calc(100% - 22px) 50%;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    border-color: #adb5bd;
    box-shadow: 0 0 0 4px rgba(33, 37, 41, .06);
}

.modal-content {
    border: 1px solid var(--line);
    border-radius: 30px;
    box-shadow: 0 30px 90px rgba(17, 24, 39, .22);
}

.modal-header,
.modal-footer {
    border-color: var(--line);
}

.modal-header {
    align-items: flex-start;
    padding: 24px 26px 18px;
}

.modal-header h3 {
    margin-bottom: 6px;
    letter-spacing: -.035em;
}

.modal-body {
    padding: 22px 26px;
}

.modal-footer {
    padding: 18px 26px 24px;
}

/* Order product picker */
.selected-order-items {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.product-add-card {
    width: 100%;
    min-height: 180px;
    padding: 2rem;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    border: 1.5px dashed #ced4da;
    border-radius: 28px;
    background: #f8f9fa;
    color: var(--text);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.product-add-card:hover,
.product-add-card:focus {
    border-color: #868e96;
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 18px 42px rgba(33, 37, 41, .08);
    outline: none;
}

.product-add-icon {
    width: 64px;
    height: 64px;
    display: inline-grid;
    border-radius: 22px;
    background: var(--primary);
    color: #fff;
    font-size: 2.8rem;
    font-weight: 500;
    line-height: 58px;
}

.product-add-card strong,
.product-add-card small {
    display: block;
    text-align: center;
}

.product-add-card small {
    width: 130px;
    color: var(--muted);
    line-height: 1.35;
}

.selected-product-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: #fff;
}

.selected-product-card h4 {
    margin-bottom: 4px;
    font-size: 1.1rem;
}

.selected-product-card p,
.selected-product-card small {
    margin: 0;
    color: var(--muted);
}

.selected-product-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}


/* Patch 034 - card prodotto aggiunto all'ordine */
.selected-product-heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .45rem;
    margin-bottom: 6px;
}

.selected-product-heading h4 {
    margin: 0;
    color: var(--text);
}

.selected-product-quantity {
    color: var(--muted);
    font-size: .98rem;
    font-weight: 500;
}

.selected-product-total {
    margin: 0;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 700;
}

.variation-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.variation-pill-list span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f1f3f5;
    color: #495057;
    font-size: .82rem;
    font-weight: 700;
}

.product-picker-modal .modal-title {
    font-size: 1.65rem;
}

.product-picker-grid {
    display: grid;
    gap: 10px;
    max-height: 460px;
    overflow: auto;
    padding: 12px 2px 2px;
}

.product-picker-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.product-picker-card:hover,
.product-picker-card.is-selected {
    border-color: #adb5bd;
    background: #f8f9fa;
}

.product-picker-card strong,
.product-picker-card small {
    display: block;
}

.product-picker-card small {
    margin-top: 4px;
    color: var(--muted);
    font-weight: 600;
}

.product-picker-card b {
    flex: 0 0 auto;
    font-size: .92rem;
}


.product-config-panel {
    display: grid;
    gap: 18px;
}

.product-config-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #f8f9fa;
}

.product-config-heading h4 {
    margin-bottom: 4px;
}

.product-config-heading p {
    margin-bottom: 0;
}

.product-modal-variations {
    display: grid;
    gap: 14px;
}

.product-variation-field {
  display: grid;
  gap: 0;
  margin-bottom: 1rem;
}

.product-variation-field .product-select-options {
  margin-top: .0;
}

.product-variation-field .is-invalid,
#product-modal-quantity.is-invalid {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 4px rgba(180, 35, 24, .08) !important;
}

/* Patch - controllo quantità ordine con pulsanti +/- */
.quantity-stepper {
    display: grid;
    grid-template-columns: 48px minmax(72px, 1fr) 48px;
    align-items: stretch;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
}

.quantity-stepper-btn {
    border: 0;
    background: #f8f9fa;
    color: var(--text);
    font-size: 1.35rem;
    font-weight: 700;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.quantity-stepper-btn:hover {
    background: #eef0f2;
}

.quantity-stepper-btn:active {
    background: #e5e7eb;
}

.quantity-stepper-input {
    border: 0 !important;
    border-left: 1px solid var(--line) !important;
    border-right: 1px solid var(--line) !important;
    border-radius: 0 !important;
    text-align: center;
    font-weight: 700;
    background: #fff !important;
    cursor: default;
    user-select: none;
}

.quantity-stepper-input:focus {
    box-shadow: none !important;
}

.quantity-stepper:has(.quantity-stepper-input.is-invalid) {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 4px rgba(180, 35, 24, .08) !important;
}

/* Admin product variations */
.product-variations-section {
    display: grid;
    gap: 14px;
}

.product-variations-list {
    display: grid;
    gap: 12px;
}

.variation-admin-row {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #f8f9fa;
}

.variation-required-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    min-height: 54px;
}

.variation-required-check .form-check-input {
    width: 20px;
    height: 20px;
    margin: 0;
}

.variation-empty-hint {
    padding: 16px;
    border: 1px dashed #ced4da;
    border-radius: 20px;
    background: #fff;
    margin-bottom: 0;
}

@media (max-width: 720px) {
    .product-add-card {
        width: 100%;
        min-height: 150px;
    }

    .selected-product-card,
    .product-config-heading {
        grid-template-columns: 1fr;
    }

    .selected-product-actions {
        justify-content: flex-start;
    }

    .selected-product-actions .btn {
        flex: 1 1 auto;
    }

    .modal-dialog {
        margin: 12px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
}


/* Product images */
.product-image-admin-row {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #f8f9fa;
}

.product-image-upload {
    position: relative;
    flex: 0 0 auto;
    width: 132px;
    height: 132px;
    margin: 0;
    border-radius: 26px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    border: 1px solid #dee2e6;
}

.product-image-upload img,
.product-table-thumb,
.product-picker-thumb,
.product-config-image,
.selected-product-thumb,
.order-detail-product-thumb {
    object-fit: cover;
    background: #f8f9fa;
}

.product-image-upload img {
    width: 100%;
    height: 100%;
    display: block;
}

.product-image-camera {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #212529;
    color: #fff;
    box-shadow: 0 10px 24px rgba(33, 37, 41, .18);
}

.product-table-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-table-thumb {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    border: 1px solid #dee2e6;
}

.product-picker-card {
    justify-content: flex-start;
}

.product-picker-card span {
    flex: 1 1 auto;
}

.product-picker-thumb {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border-radius: 18px;
    border: 1px solid #dee2e6;
}

.product-config-heading {
    align-items: center;
}

.product-config-image {
    width: 82px;
    height: 82px;
    flex: 0 0 82px;
    border-radius: 22px;
    border: 1px solid #dee2e6;
}

.selected-product-card {
    grid-template-columns: 170px minmax(0, 1fr) auto;
}

.selected-product-thumb {
    width: 170px;
    height: auto;
    border-radius: 20px;
    border: 1px solid #dee2e6;
}

.order-detail-item {
    grid-template-columns: 120px minmax(0, 1fr) auto;
}

.order-detail-product-thumb {
    width: 120px;
    height: 120px;
    border-radius: 18px;
}

.order-detail-product-name {
    display: block;
}

.order-detail-product-qty {
    color: var(--muted);
    font-weight: 500;
    margin-left: 4px;
    font-size: 13px;
}

.order-detail-product-price {
    white-space: nowrap;
}

@media (max-width: 700px) {
    .product-image-admin-row {
        align-items: flex-start;
    }

    .product-image-upload {
        width: 104px;
        height: 104px;
        border-radius: 22px;
    }

    .selected-product-card {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .selected-product-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .order-detail-item {
        grid-template-columns: 60px minmax(0, 1fr) auto;
    }

    .order-detail-product-thumb {
        width: 60px;
        height: 60px;
    }
}

/* Patch 020: popup scelta prodotto ordine */
.product-picker-modal .modal-body {
    display: grid;
    gap: 22px;
}

.product-picker-search-panel {
    display: grid;
    gap: 8px;
}

.product-picker-search-input {
    min-height: 52px;
}

.form-hint {
    color: var(--muted);
    font-size: .88rem;
    font-weight: 500;
}

.product-picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    max-height: 310px;
    padding-top: 8px;
}

.product-picker-no-results {
    grid-column: 1 / -1;
    padding: 16px;
    border: 1px dashed #ced4da;
    border-radius: 18px;
    background: #f8f9fa;
}

.product-config-panel[hidden] {
    display: none !important;
}

.product-config-panel {
    padding-top: 4px;
    border-top: 1px solid #dee2e6;
}

.product-detail-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid #dee2e6;
    border-radius: 24px;
    background: #f8f9fa;
}

.product-detail-body h4 {
    margin: 2px 0 4px;
    font-size: 1.2rem;
}

.product-detail-body p {
    margin: 0;
    color: var(--muted);
    font-weight: 500;
}

.product-detail-category {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #dee2e6;
    color: #495057;
    font-size: .78rem;
    font-weight: 700;
}

.product-final-fields {
    margin-top: 0;
}

@media (max-width: 700px) {
    .product-picker-grid {
        grid-template-columns: 1fr;
        max-height: 280px;
    }

    .product-detail-card {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .product-detail-card .badge {
        grid-column: 1 / -1;
        justify-self: flex-start;
    }

    .product-config-image {
        width: 72px;
        height: 72px;
        flex-basis: 72px;
    }
}


/* Patch 021: autocomplete prodotti ordine dopo 3 caratteri */
#product-picker-list[hidden] {
    display: none !important;
}

#product-picker-list.product-picker-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: 320px;
    overflow: auto;
    padding-top: 8px;
}

.product-picker-card {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    justify-content: initial;
    gap: 12px;
    padding: 10px;
    border-radius: 18px;
}

.product-picker-thumb {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    object-fit: cover;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.product-picker-info {
    min-width: 0;
}

.product-picker-info strong {
    display: block;
    color: var(--text);
    font-size: .98rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-picker-info small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 500;
}

/* Patch 022: product picker quadrato, ricerca con X e dettagli più distanziati */
.product-detail-card {
    margin-top: 1.5rem;
}

.product-picker-search-wrap {
    position: relative;
}

.product-picker-search-wrap .product-picker-search-input {
    padding-right: 52px;
}

.product-picker-search-input::-webkit-search-decoration,
.product-picker-search-input::-webkit-search-cancel-button,
.product-picker-search-input::-webkit-search-results-button,
.product-picker-search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
}

.product-picker-clear {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: #e9ecef;
    color: #495057;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.product-picker-clear:hover,
.product-picker-clear:focus {
    background: #dee2e6;
    color: #212529;
    outline: none;
}

.product-picker-clear[hidden] {
    display: none !important;
}

#product-picker-list.product-picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.product-picker-card {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    text-align: center;
}

.product-picker-card .product-picker-thumb {
    width: 82px;
    height: 82px;
    flex: 0 0 auto;
    border-radius: 20px;
}

.product-picker-card .product-picker-info {
    width: 100%;
    display: grid;
    gap: 4px;
    justify-items: center;
}

.product-picker-card .product-picker-info strong,
.product-picker-card .product-picker-info small {
    width: 100%;
    text-align: center;
}

@media (max-width: 700px) {
    #product-picker-list.product-picker-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-picker-card {
        min-height: 168px;
    }

    .product-picker-card .product-picker-thumb {
        width: 72px;
        height: 72px;
    }
}

/* Patch 024 - admin product variation options */
.variation-main-row {
    align-items: end;
}

.variation-options-block {
  margin-top: 1rem;
  background: #fbfbfb;
  padding: 1rem;
    padding-right: 1rem;
  padding-right: 1rem;
  border-radius: 20px;
}

.variation-options-block.is-hidden {
    display: none !important;
}

.variation-options-block.is-collapsed {
    display: none !important;
}

.admin-variation-options-toggle {
    margin-top: 1rem;
}

.admin-variation-options-toggle.is-hidden {
    display: none !important;
}

.variation-options-list {
    display: grid;
    gap: .75rem;
}

.variation-option-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, 160px) 48px 48px;
    gap: .75rem;
    align-items: end;
    padding-left: 1rem;
}

.btn-icon {
    width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.btn-link-danger {
    width: auto;
    min-height: auto;
    line-height: 1.2;
    padding: .65rem 0 0;
    border: 0;
    background: transparent;
    color: var(--danger);
    font-weight: 500;
    text-decoration: none;
}

.btn-link-danger:hover {
    text-decoration: underline;
}


.variant-admin-form .variation-admin-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.variant-admin-form .variation-admin-actions .product-variation-options-toggle {
    margin-top: 0;
}

.variant-admin-form .variation-admin-actions .remove-variant-group-item {
    margin-left: auto;
    white-space: nowrap;
}

.product-variation-options-toggle {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    width: max-content;
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 0;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
}

.product-variation-options-toggle:hover,
.product-variation-options-toggle:focus {
    color: var(--dark);
}

.product-variation-options-toggle-icon {
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
}

.product-variation-options-toggle.is-expanded .product-variation-options-toggle-icon {
    transform: rotate(45deg);
}

.product-option-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem 1.25rem;
}

.product-option-list[hidden],
.product-select-options[hidden],
.js-product-option-list[hidden] {
    display: none !important;
}

.product-select-options {
    margin-top: .65rem;
}

.product-option-choice {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .8rem .9rem .8rem 1rem;
    padding-left: 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    font-weight: normal;
    font-size: 14px;
}

.product-option-choice span {
    font-weight: normal;
    font-size: 14px;
}

.product-option-choice input {
    margin: 0;
}

.product-option-choice.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(180, 35, 24, .08);
}

@media (max-width: 900px) {
    .product-option-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .product-option-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .variation-option-row {
        grid-template-columns: 1fr 1fr 44px 44px;
        gap: .6rem;
    }

    .variation-option-row > div:first-child {
        grid-column: 1 / -1;
    }

    .btn-icon {
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
    }
}

/* Patch 034 - dimensioni checkbox/radio senza rompere gli switch Bootstrap */
.form-check:not(.form-switch) .form-check-input,
.product-option-choice input[type="checkbox"],
.product-option-choice input[type="radio"],
.variation-required-check .form-check-input {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    flex: 0 0 20px;
    padding: 0;
}

.form-switch .form-check-input {
    width: 2em;
    min-width: 2em;
    height: 1em;
    min-height: 1em;
    flex: 0 0 auto;
    padding: 0;
}

\.product-option-text {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .35rem;
    font-weight: normal;
    font-size: 14px;
}

.product-option-price {
    font-size: 70%;
    font-weight: 500;
    color: var(--muted);
}

.product-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.product-modal-total {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .55rem .9rem;
    margin-right: auto;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 500;
}

.product-modal-total[hidden] {
    display: none !important;
}

.product-modal-total strong {
    color: var(--text);
    font-weight: 700;
}

.product-picker-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    margin-left: auto;
}

@media (max-width: 720px) {
    .product-picker-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .product-modal-total,
    .product-picker-footer-actions {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .product-picker-footer-actions .btn {
        flex: 1 1 auto;
    }
}

/* Patch 027: nella footer della popup prodotto mostra solo il totale finale */
.product-modal-total-simple {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-right: auto;
    color: var(--text);
}

.product-modal-total-simple strong {
    font-size: 2rem;
    font-weight: 800;
}

.product-final-fields textarea {
    min-height: 96px;
    resize: vertical;
}

/* Patch 031 - variazioni obbligatorie: niente alert rosso, solo label evidenziata */
.product-variation-field.is-missing > .form-label {
    color: var(--danger);
    font-weight: 700;
}

/* Patch 033 - badge obbligatorio sulle variazioni mancanti */
.product-variation-label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

.required-variation-badge {
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1;
    padding: .38rem .55rem;
}

.required-variation-badge[hidden] {
    display: none !important;
}

.product-variation-field.is-missing > .product-variation-label {
    color: var(--danger);
    font-weight: 700;
}

/* Patch 035 - varianti nella card ordine e popup dettaglio costi */
.selected-product-variations {
    margin-top: .65rem;
}

.btn-link-detail {
    display: inline-flex;
    align-items: center;
    width: auto;
    min-height: auto;
    line-height: 1.2;
    margin-top: .75rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #212529;
    font-size: .92rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.btn-link-detail:hover {
    color: var(--primary);
}

.selected-product-detail-head {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.selected-product-detail-img {
    width: 116px;
    height: 116px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: #f8f9fa;
}

.selected-product-detail-head h4 {
    margin: 0 0 .4rem;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -.03em;
}

.selected-product-detail-head h4 span {
    color: var(--muted);
    font-size: 1rem;
    font-weight: 500;
}

.selected-product-detail-head p {
    margin: .15rem 0;
    color: var(--muted);
}

.selected-product-detail-head p strong {
    color: var(--text);
}

.selected-product-costs {
    display: grid;
    gap: .75rem;
}

.selected-product-cost-row,
.selected-product-cost-subrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.selected-product-cost-row {
    min-height: 46px;
    padding: .75rem 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.selected-product-cost-row.is-total {
    border-color: #212529;
    background: #f8f9fa;
    font-weight: 800;
}

.selected-product-cost-row.is-total strong {
    font-size: 1.25rem;
}

.selected-product-cost-group {
    display: grid;
    gap: .45rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.selected-product-cost-group h6 {
    margin: 0;
    font-size: .95rem;
    font-weight: 700;
}

.selected-product-cost-subrow {
    color: var(--muted);
    font-size: .95rem;
}

.selected-product-cost-subrow strong {
    color: var(--text);
    font-weight: 700;
}

.selected-product-detail-empty {
    padding: 1rem;
    border: 1px dashed var(--line);
    border-radius: 18px;
    color: var(--muted);
    background: #f8f9fa;
}

.selected-product-detail-notes {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 18px;
    background: #f8f9fa;
}

.selected-product-detail-notes strong {
    display: block;
    margin-bottom: .35rem;
}

.selected-product-detail-notes p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

@media (max-width: 700px) {
    .selected-product-detail-head {
        grid-template-columns: 82px minmax(0, 1fr);
    }

    .selected-product-detail-img {
        width: 82px;
        height: 82px;
        border-radius: 20px;
    }

    .selected-product-detail-head h4 {
        font-size: 1.25rem;
    }
}

/* Patch 039 - sezione Varianti riutilizzabili */
.variation-template-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
}

.variant-options-preview {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.variant-options-preview span,
.variant-options-preview small {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: .3rem .6rem;
    border-radius: 999px;
    background: #f8f9fa;
    border: 1px solid var(--line);
    font-size: .85rem;
    font-weight: 500;
    color: var(--text);
}

.variant-options-preview small {
    color: var(--muted);
}

.variant-admin-form .variation-admin-row {
    background: #fff;
}

@media (max-width: 720px) {
    .variation-template-picker {
        grid-template-columns: 1fr;
    }

    .variation-template-picker .btn {
        width: 100%;
    }
}

/* Patch 040 - gruppi varianti riutilizzabili */
.product-variant-groups-section {
    gap: 1rem;
}

.product-variant-groups-list {
    display: grid;
    gap: .8rem;
}

.product-variant-group-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px 48px;
    gap: .75rem;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
}

.product-variant-group-row.is-dragging {
    cursor: grabbing;
    box-shadow: 0 22px 50px rgba(15, 23, 42, .16);
}

.product-variant-group-row-placeholder {
    min-height: 80px;
    border: 1px dashed var(--line);
    border-radius: 22px;
    background: var(--soft);
}

body.is-product-variant-group-dragging,
body.is-product-variant-group-dragging * {
    cursor: grabbing !important;
    user-select: none;
}

.product-variant-drag-handle {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border: 0;
    border-radius: 50%;
    background: var(--soft);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    line-height: 1;
    touch-action: none;
}

.product-variant-drag-handle:active {
    cursor: grabbing;
}

.product-variant-drag-handle:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.product-variant-drag-handle:focus-visible {
    outline: 3px solid rgba(17, 24, 39, .14);
    outline-offset: 2px;
}

.variant-admin-form .section-heading {
    margin-bottom: .25rem;
}

.variant-admin-form .variation-admin-row {
    background: #fff;
}

#app-confirm-action-modal .modal-content {
    border: 0;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

#app-confirm-action-modal .modal-title {
    font-weight: 800;
}

@media (max-width: 720px) {
    .product-variant-group-row {
        grid-template-columns: 44px 1fr 44px 44px;
        gap: .6rem;
    }

    .product-variant-group-row > div:first-of-type {
        grid-column: 1 / -1;
    }

    .product-variant-drag-handle {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
}

/* Patch 041 - ordini: personale, azioni a icona e statistiche */
.action-icon-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px !important;
    line-height: 1 !important;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.action-icon-button svg {
    width: 20px;
    height: 20px;
}

.action-icon-button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.statistics-filter-card,
.statistics-chart-card,
.statistics-table-card {
    margin-bottom: 1.5rem;
}

.statistics-form {
    display: grid;
    gap: 1.5rem;
}

.statistics-statuses {
    display: grid;
    gap: .75rem;
}

.statistics-statuses-title {
    font-weight: 800;
    color: var(--text);
}

.statistics-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: .75rem;
}

.status-check-card {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-height: 56px;
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    cursor: pointer;
    font-weight: 700;
}

.status-check-card input {
    margin: 0;
}

.statistics-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.statistics-card-heading h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
}

.statistics-card-heading p {
    margin: .25rem 0 0;
    color: var(--muted);
}

.statistics-chart-wrap {
    width: 100%;
    min-height: 320px;
}

.statistics-chart-wrap canvas {
    width: 100% !important;
}

@media (max-width: 720px) {
    .statistics-card-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .statistics-chart-wrap {
        min-height: 260px;
    }
}


/* Patch 042 - padding statistiche e checkbox coerenti */
.statistics-filter-card,
.statistics-chart-card {
    padding: 1.5rem;
}

.statistics-table-card .statistics-card-heading {
    padding: 1.5rem 1.5rem 0;
}

.statistics-table-card .responsive-table {
    margin-top: .5rem;
}

.status-check-card .form-check-input,
.statistics-status-grid input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    flex: 0 0 20px;
    padding: 0;
    margin: 0;
}

.status-check-card .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.status-check-card .form-check-input:focus {
    border-color: #adb5bd;
    box-shadow: 0 0 0 4px rgba(33, 37, 41, .06);
}

@media (max-width: 720px) {
    .statistics-filter-card,
    .statistics-chart-card {
        padding: 1.15rem;
    }

    .statistics-table-card .statistics-card-heading {
        padding: 1.15rem 1.15rem 0;
    }
}

/* Patch 043 - tabella ordini: azioni allineate come celle normali */
.responsive-table td.table-actions {
    display: table-cell;
    vertical-align: middle;
}

.table-actions-inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-height: 48px;
}

.table-actions-inner form {
    margin: 0;
}

@media (max-width: 720px) {
    .responsive-table td.table-actions {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding-top: 12px !important;
    }

    .table-actions-inner {
        justify-content: flex-start;
        flex-wrap: wrap;
        min-height: 0;
    }
}


/* Patch 045 - prodotti ordine: azioni a icona e card aggiungi larga */
.selected-product-actions .action-icon-button {
    flex: 0 0 44px;
}

.selected-product-actions .action-icon-button svg {
    width: 20px;
    height: 20px;
}

/* Patch 049 - variazioni ordine: mostra solo il valore con peso 500 */
.selected-product-variations span,
.order-modal .variation-pill-list span {
    font-weight: 500;
}

.selected-product-variations strong,
.order-modal .variation-pill-list strong {
    display: none;
}


/* Patch 050 - popup Dettaglio prodotto scorrevole */
.selected-product-detail-modal .modal-dialog {
    max-height: calc(100vh - 2rem);
}

.selected-product-detail-modal .modal-content {
    max-height: calc(100vh - 2rem);
    overflow: hidden;
}

.selected-product-detail-modal .modal-body {
    max-height: calc(100vh - 12rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 1.75rem;
}

@media (max-width: 700px) {
    .selected-product-detail-modal .modal-dialog {
        max-height: calc(100dvh - 1rem);
        margin: .5rem;
    }

    .selected-product-detail-modal .modal-content {
        max-height: calc(100dvh - 1rem);
    }

    .selected-product-detail-modal .modal-body {
        max-height: calc(100dvh - 9rem);
        padding-right: 1.25rem;
    }
}

/* Roles and permissions */
.role-form .permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.permission-group-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 1.25rem;
    padding: 1.25rem;
}

.permission-group-header h4 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 800;
    color: #171717;
}

.permission-check-list {
    display: grid;
    gap: .8rem;
}

.permission-check {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin: 0;
    padding: .85rem;
    background: #fff;
    border: 1px solid #eef0f2;
    border-radius: 1rem;
}

.permission-check .form-check-input {
    margin: .1rem 0 0;
}

.permission-check .form-check-label {
    display: grid;
    gap: .1rem;
    color: #171717;
}

.permission-check .form-check-label strong {
    font-size: .95rem;
    font-weight: 700;
}

.permission-check .form-check-label small {
    color: #8a8f98;
    font-size: .78rem;
    font-weight: 500;
}

/* Patch 055 - Login: spaziatura pulsante accesso */
.auth-page .login-card .form-card .btn[type="submit"] {
    width: 100%;
    margin-top: 1.25rem;
}

.auth-page .login-card .form-card input[name="password"] {
    margin-bottom: 0;
}


/* Patch 056/059 - ruolo a piena larghezza e pulsante salva ruolo */
.form-card.wide.role-form-wide {
    max-width: none;
    width: 100%;
}

.role-form > button[type="submit"] {
    width: 180px;
    max-width: 100%;
}


/* Patch 058 - tabella ordini: personale con foto e azioni allineate */
.responsive-table th.table-actions-heading {
    text-align: right;
}

.table-personnel {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.table-personnel-avatar {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--primary);
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1;
}

.table-personnel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 720px) {
    .table-personnel {
        justify-content: flex-end;
        text-align: right;
    }
}

/* Patch 059 - profilo: la foto si cambia cliccando sulla preview */
.profile-photo-button {
    display: none !important;
}

/* Patch 060 - tabelle admin uniformi e azioni a icona */
.admin-table-card {
    padding: 0;
}

.admin-table-card .responsive-table,
.admin-table-card .table {
    width: 100%;
    margin-bottom: 0;
}

.admin-table-card .table {
    border-collapse: collapse;
}

.admin-table-card .table > :not(caption) > * > * {
    padding: 18px;
    border-bottom: 1px solid var(--line);
    background: transparent;
    box-shadow: none;
    vertical-align: middle;
}

.admin-table-card .table thead th,
.admin-table-card .responsive-table thead th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    font-weight: 800;
}

.admin-table-card .table tbody tr:last-child > *,
.admin-table-card .responsive-table tbody tr:last-child > * {
    border-bottom: 0;
}

.admin-table-card .table-actions-heading {
    text-align: right;
}

.admin-table-card .table-actions-inner {
    justify-content: flex-end;
}

.admin-table-card .table-actions-inner form {
    margin: 0;
}

@media (max-width: 720px) {
    .admin-table-card .table-actions-heading {
        text-align: left;
    }

    .admin-table-card .table-actions-inner {
        justify-content: flex-start;
    }
}


/* Patch 062 - ruolo sotto il nome nella colonna Personale */
.table-personnel-text {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.table-personnel-text strong {
    color: var(--text);
    line-height: 1.15;
}

.table-personnel-text small {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 500;
    line-height: 1.15;
}

@media (max-width: 720px) {
    .table-personnel-text {
        align-items: flex-end;
    }
}


/* Patch 063: storico ordine e popup validazione ordine */
.order-log-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

.order-log-user-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    color: #374151;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
}

.order-validation-modal .modal-header {
    align-items: flex-start;
}

.order-validation-modal .modal-title {
    margin: 0 0 .25rem;
    font-weight: 800;
}

.order-validation-list {
    display: grid;
    gap: .55rem;
    margin: 0;
    padding-left: 1.25rem;
}

.order-validation-list li {
    font-weight: 600;
    color: #111827;
}


/* Patch 064: selected product image and orders autocomplete */
@media (max-width: 575.98px) {
    .selected-product-card {
        grid-template-columns: 1fr;
    }

    .selected-product-thumb {
        width: 100%;
        height: auto;
    }
}

/* Patch 066: stato ordine dentro l'intestazione della sezione Ordine */
.order-status-heading-box {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    min-width: 230px;
    padding: .75rem;
    background: #f8f9fa;
    border: 1px solid var(--line);
    border-radius: 18px;
}

.order-status-heading-select {
    min-width: 200px;
    margin: 0;
    background-color: #fff;
    font-weight: 700;
}

.order-status-heading-select:disabled,
.order-status-heading-select.is-permission-locked {
    opacity: 1;
    color: #6c757d;
    background-color: #fff;
}

.order-status-heading-select.is-permission-locked {
    cursor: not-allowed;
}

@media (max-width: 980px) {
    .order-status-heading-box {
        width: 100%;
        justify-content: stretch;
    }

    .order-status-heading-select {
        width: 100%;
        min-width: 0;
    }
}


/* Patch 067: mobile app bar and offcanvas sidebar */
.mobile-app-bar,
.mobile-menu-backdrop,
.mobile-menu-close-button {
    display: none;
}

.mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--text);
    font-weight: 900;
}

.mobile-brand span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-menu-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 48px;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 12px 32px rgba(33, 37, 41, .08);
}

.mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform .18s ease, opacity .18s ease;
}

body.is-mobile-menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

body.is-mobile-menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
}

body.is-mobile-menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 980px) {
    body.is-mobile-menu-open {
        overflow: hidden;
    }

    .mobile-app-bar {
        position: sticky;
        top: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        min-width: 0;
        padding: 14px 18px;
        background: rgba(255, 255, 255, .88);
        border-bottom: 1px solid var(--line);
        backdrop-filter: blur(16px);
    
    z-index: 100;
}

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1050;
        width: min(86vw, 340px);
        max-width: 340px;
        height: 100dvh;
        max-height: 100dvh;
        padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
        border-right: 1px solid var(--line);
        border-bottom: 0;
        background: rgba(255, 255, 255, .96);
        box-shadow: 30px 0 80px rgba(17, 24, 39, .18);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 16px;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-105%);
        transition: transform .22s ease;
    }

    body.is-mobile-menu-open .sidebar {
        transform: translateX(0);
    }

    .sidebar .brand {
        margin-bottom: 22px;
        padding-right: 54px;
    }

    .mobile-menu-close-button {
        position: absolute;
        top: 18px;
        right: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: #fff;
        color: var(--text);
    }

    .mobile-menu-close-button svg {
        width: 21px;
        height: 21px;
    }

    .sidebar-main {
        width: 100%;
        flex: 0 0 auto;
        min-height: auto;
    }

    .nav-menu {
        flex-direction: column;
        overflow: visible;
        padding-bottom: 0;
        gap: 8px;
    }

    .nav-menu a {
        width: 100%;
        min-height: 52px;
        padding: 14px 16px;
        border-radius: 18px;
        background: transparent;
    }

    .nav-menu a:active {
        background: var(--soft);
    }

    .nav-menu hr {
        display: block;
        width: 100%;
        margin: 8px 0;
    }

    .sidebar-account {
        width: 100%;
        flex: 0 0 auto;
        margin-top: 18px;
        margin-bottom: env(safe-area-inset-bottom);
    }

    .mobile-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1045;
        width: 100%;
        height: 100%;
        border: 0;
        background: rgba(17, 24, 39, .36);
        opacity: 0;
        pointer-events: none;
        transition: opacity .22s ease;
    }

    body.is-mobile-menu-open .mobile-menu-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .main-area {
        min-width: 0;
    }
}

@media (max-width: 575.98px) {
    .mobile-app-bar {
        padding: 12px 14px;
    }

    .mobile-brand .brand-mark {
        width: 40px;
        height: 40px;
        border-radius: 15px;
    }

    .mobile-menu-toggle {
        width: 46px;
        height: 46px;
        border-radius: 17px;
    }

    .sidebar {
        width: min(90vw, 326px);
        padding: 16px;
    }
}

/* Patch 069: Bar dashboard orders and customer autocomplete loading feedback */
.dashboard-orders-card {
    margin-top: 1.5rem;
}

.dashboard-orders-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 1.5rem 0;
}

.dashboard-orders-heading h3 {
    margin: 0 0 .35rem;
    font-size: 1.35rem;
    font-weight: 800;
}

.dashboard-orders-heading p:last-child {
    margin-bottom: 0;
    color: var(--muted);
}

.dashboard-orders-table {
    margin-top: 1rem;
}

.customer-autocomplete-field {
    position: relative;
}

.customer-autocomplete-field .form-control {
    padding-right: 3rem;
}

.customer-autocomplete-spinner {
    position: absolute;
    top: 50%;
    right: 1rem;
    width: 1.1rem;
    height: 1.1rem;
    margin-top: -.55rem;
    border: 2px solid #dee2e6;
    border-top-color: var(--text);
    border-radius: 50%;
    animation: customerAutocompleteSpin .65s linear infinite;
    pointer-events: none;
}

.autocomplete-state {
    padding: .85rem .9rem;
    color: var(--muted);
    font-weight: 500;
}

.autocomplete-state.is-error {
    color: #dc3545;
}

@keyframes customerAutocompleteSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 767.98px) {
    .dashboard-orders-heading {
        align-items: stretch;
        flex-direction: column;
        padding: 1.25rem 1.25rem 0;
    }

    .dashboard-orders-heading .btn {
        width: 100%;
    }
}

/* Patch 073: Courier dashboard */
.courier-hero-card .btn {
    white-space: nowrap;
}

.courier-orders-card {
    margin-top: 1.5rem;
}

.courier-orders-table td small a {
    color: inherit;
    font-weight: 700;
    text-decoration: none;
}

.courier-orders-table td small a:hover {
    text-decoration: underline;
}

@media (max-width: 767.98px) {
    .courier-hero-card {
        align-items: stretch;
    }

    .courier-hero-card .btn {
        width: 100%;
    }
}

/* Patch 074: Courier dashboard counters and delivery workflow */
.courier-stats-grid .courier-status-card small {
    display: block;
    margin-top: .4rem;
    color: var(--muted);
    font-weight: 500;
}

.courier-page-actions {
    align-items: flex-end;
}

.courier-delivery-card {
    overflow: visible;
}

.courier-delivery-table td small,
.courier-orders-table td small {
    display: block;
    margin-top: .25rem;
    color: var(--muted);
    font-weight: 500;
}

.courier-delivery-table td small a,
.courier-orders-table td small a {
    color: inherit;
    font-weight: 700;
    text-decoration: none;
}

.courier-delivery-table td small a:hover,
.courier-orders-table td small a:hover {
    text-decoration: underline;
}

.courier-delivery-actions {
    min-width: 260px;
}

.courier-actions-inner {
    justify-content: flex-end;
    gap: .65rem;
}

.courier-action-button {
    gap: .5rem;
    min-height: 44px;
    line-height: 1;
    padding: 0 1rem;
    white-space: nowrap;
}

.courier-action-button svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
}

.courier-action-button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.courier-order-modal .modal-content {
    border: 0;
    border-radius: 28px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .18);
}

.courier-order-modal .modal-header,
.courier-order-modal .modal-footer {
    border-color: var(--line);
    padding: 1.25rem 1.5rem;
}

.courier-order-modal .modal-body {
    padding: 1.5rem;
}

.courier-modal-summary {
    padding: 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #f8f9fa;
}

.courier-modal-summary p {
    margin: 0;
}

.courier-modal-summary p + p {
    margin-top: .35rem;
    color: var(--muted);
    font-weight: 500;
}

.courier-modal-products {
    display: grid;
    gap: .65rem;
}

.courier-modal-product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.courier-modal-product-row span {
    font-weight: 600;
}

.courier-delivered-message {
    display: grid;
    gap: .25rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 20px;
    background: #dbe9f2;
    color: #082c80;
}

.courier-delivered-message strong {
    font-size: 1.05rem;
}

.courier-delivered-message span {
    font-weight: 500;
}

@media (max-width: 767.98px) {
    .courier-actions-inner {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .courier-action-button {
        justify-content: center;
        width: 100%;
    }

    .courier-delivery-actions {
        min-width: 0;
    }

    .courier-modal-product-row {
        align-items: flex-start;
        flex-direction: column;
        gap: .35rem;
    }
}

/* Patch 080 - checkbox tradizionali nelle form admin */
.switch-row {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    margin-top: 18px;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
}

.form-check.switch-row {
    min-height: auto;
    padding-left: 0;
}

.switch-row input[type="checkbox"] {
    width: 20px;
    min-width: 20px;
    height: 20px;
    min-height: 20px;
    margin: 0;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--line);
    border-radius: 6px;
    background-color: #fff;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 13px 13px;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.switch-row input[type="checkbox"]:checked {
    border-color: var(--primary);
    background-color: var(--primary);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='4 5 13 10'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

.switch-row input[type="checkbox"]::after {
    content: none;
    display: none;
}

.switch-row input[type="checkbox"]:focus {
    outline: none;
    border-color: #adb5bd;
    box-shadow: 0 0 0 4px rgba(33, 37, 41, .06);
}

.switch-row input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.switch-row input[type="checkbox"]:disabled + span,
.switch-row input[type="checkbox"]:disabled + .form-check-label {
    cursor: not-allowed;
    opacity: .65;
}

.switch-row span,
.switch-row .form-check-label {
    line-height: 1.35;
}

/* Patch - checkbox form admin coerenti con angoli arrotondati */
.form-card .form-check:not(.form-switch) .form-check-input[type="checkbox"],
.variant-admin-form .variation-required-check .form-check-input[type="checkbox"] {
    border-radius: 6px;
}

/* Patch 083: collapsible desktop sidebar */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    margin-bottom: 34px;
}

.sidebar-header .brand {
    min-width: 0;
    margin-bottom: 0;
}

.brand-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-collapse-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background .18s ease, color .18s ease;
}

.sidebar-collapse-toggle svg {
    transition: transform .18s ease;
}

.sidebar-collapse-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 981px) {
    .app-shell,
    .sidebar,
    .main-area {
        transition: grid-template-columns .22s ease, padding .22s ease, width .22s ease;
    }

    body.is-sidebar-collapsed .app-shell {
        grid-template-columns: 92px 1fr;
    }

    body.is-sidebar-collapsed .sidebar {
        padding: 22px 14px;
        align-items: center;
        overflow-x: visible;
    }

    body.is-sidebar-collapsed .sidebar-header {
        width: 100%;
        flex-direction: column;
        justify-content: center;
        gap: 12px;
        margin-bottom: 26px;
    }

    body.is-sidebar-collapsed .sidebar-header .brand {
        width: 100%;
        justify-content: center;
        gap: 0;
    }

    body.is-sidebar-collapsed .brand-label,
    body.is-sidebar-collapsed .nav-menu a > span:not(.menu-icon),
    body.is-sidebar-collapsed .sidebar-collapse-label,
    body.is-sidebar-collapsed .sidebar-user-text,
    body.is-sidebar-collapsed .sidebar-link > span:not(.menu-icon) {
        display: none;
    }

    body.is-sidebar-collapsed .sidebar-collapse-toggle svg {
        transform: rotate(180deg);
    }

    body.is-sidebar-collapsed .nav-menu {
        align-items: center;
        gap: 10px;
    }

    body.is-sidebar-collapsed .nav-menu a,
    body.is-sidebar-collapsed .nav-menu .sidebar-collapse-toggle {
        width: 54px;
        min-height: 54px;
        justify-content: center;
        padding: 0;
        border-radius: 18px;
    }

    body.is-sidebar-collapsed .nav-menu hr {
        width: 42px;
        margin: 10px auto;
    }

    body.is-sidebar-collapsed .sidebar-account {
        background: transparent;
        border-radius: 0;
        overflow: visible;
    }

    body.is-sidebar-collapsed .sidebar-account-row {
        border-top: 0;
    }

    body.is-sidebar-collapsed .sidebar-identity,
    body.is-sidebar-collapsed .sidebar-link {
        width: 54px;
        min-height: 54px;
        justify-content: center;
        padding: 0;
        margin: 0 auto 8px;
        border-radius: 18px;
    }

    body.is-sidebar-collapsed .sidebar-identity:hover,
    body.is-sidebar-collapsed .sidebar-link:hover {
        background: var(--soft);
    }

    body.is-sidebar-collapsed .sidebar-avatar {
        width: 42px;
        height: 42px;
        border-radius: 16px;
    }
}

@media (max-width: 980px) {
    .sidebar-header {
        margin-bottom: 22px;
    }

    .sidebar-collapse-toggle {
        display: none;
    }
}

/* Patch - mobile tables: keep columns and allow horizontal scrolling */
@media (max-width: 720px) {
    .table-card {
        overflow: scroll;
        -webkit-overflow-scrolling: touch;
    }

    .table-card .responsive-table,
    .table-card .table {
        display: table;
        width: 100%;
        min-width: 760px;
        margin-bottom: 0;
        white-space: nowrap;
    }

    .table-card .orders-table,
    .table-card .dashboard-orders-table,
    .table-card .courier-delivery-table,
    .table-card .statistics-orders-table {
        min-width: 980px;
    }

    .table-card .responsive-table thead {
        display: table-header-group;
    }

    .table-card .responsive-table tbody {
        display: table-row-group;
    }

    .table-card .responsive-table tr {
        display: table-row;
        padding: 0;
        border-bottom: 0;
    }

    .table-card .responsive-table th,
    .table-card .responsive-table td {
        display: table-cell;
        padding: 18px;
        border-bottom: 1px solid var(--line);
        vertical-align: middle;
    }

    .table-card .responsive-table td::before {
        display: none;
        content: none;
    }

    .table-card .table-actions {
        justify-content: flex-end;
        flex-wrap: nowrap;
        padding-top: 0 !important;
    }

    .table-card .table-personnel {
        justify-content: flex-start;
        text-align: left;
    }
}

/* Patch - mobile table multiline cells aligned right */
@media (max-width: 720px) {
    .table-card .responsive-table th,
    .table-card .responsive-table td {
        text-align: right;
    }

    .table-card .responsive-table td > strong,
    .table-card .responsive-table td > small {
        display: block;
        text-align: right;
    }

    .table-card .responsive-table td > small {
        margin-top: 4px;
    }

    .table-card .table-personnel {
        justify-content: flex-end;
        text-align: right;
    }

    .table-card .table-personnel-text {
        align-items: flex-end;
    }

    .table-card .table-actions,
    .table-card .table-actions-inner {
        justify-content: flex-end;
    }
}


/* Patch - mobile sidebar full width with account section pinned at bottom */
@media (max-width: 980px) {
    .sidebar {
        right: 0;
        width: 100vw;
        max-width: none;
        height: 100dvh;
        max-height: 100dvh;
        padding: 16px 16px calc(10px + env(safe-area-inset-bottom));
        gap: 0;
        overflow: hidden;
    }

    .sidebar-main {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .sidebar-header {
        flex: 0 0 auto;
    }

    .nav-menu {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 18px;
    }

    .sidebar-account {
        flex: 0 0 auto;
        width: calc(100% + 32px);
        margin: auto -16px 0 -16px;
        padding: 10px 16px calc(8px + env(safe-area-inset-bottom));
        border-radius: 0;
    }

    .mobile-menu-backdrop {
        display: none !important;
    }
}

@media (max-width: 575.98px) {
    .sidebar {
        width: 100vw;
        max-width: none;
        padding: 16px 16px calc(10px + env(safe-area-inset-bottom));
    }
}

/* Patch - Bar Manager dashboard mobile stats and order preview action */
.order-detail-icon-heading {
    width: 1%;
}

@media (max-width: 720px) {
    .stats-grid.stats-grid-five {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-grid.stats-grid-five .stat-card {
        min-width: 0;
    }
}

/* Patch - footer globale, recupero password e mostra password login */
.app-footer {
    margin-top: 2rem;
    padding: 1.25rem 0 0;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 500;
    text-align: center;
}

.app-footer a {
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

.auth-page {
    align-content: center;
    gap: 1.25rem;
}

.auth-footer {
    width: min(1050px, 100%);
    margin-top: 0;
}

.login-password-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 8px;
}

.login-password-label-row label {
    margin: 0;
}

.login-forgot-password-link,
.auth-secondary-action a {
    color: var(--muted);
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
}

.login-forgot-password-link:hover,
.auth-secondary-action a:hover {
    color: var(--text);
    text-decoration: underline;
}

.password-input-wrap {
    position: relative;
}

.password-input-wrap input {
    padding-right: 3.35rem;
}

.password-visibility-toggle {
    position: absolute;
    top: 50%;
    right: .85rem;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    cursor: pointer;
}

.password-visibility-toggle:hover,
.password-visibility-toggle:focus {
    color: var(--text);
    background: #f1f3f5;
}

.password-visibility-toggle svg {
    width: 21px;
    height: 21px;
}

.password-visibility-toggle .icon-eye-closed {
    display: none;
}

.password-visibility-toggle.is-visible .icon-eye-open {
    display: none;
}

.password-visibility-toggle.is-visible .icon-eye-closed {
    display: block;
}

.auth-secondary-action {
    margin-top: 1rem;
    text-align: center;
}

.password-recovery-card .form-card .btn[type="submit"] {
    width: 100%;
    margin-top: 1.25rem;
}

@media (max-width: 720px) {
    .auth-page {
        align-content: start;
    }

    .login-password-label-row {
        align-items: flex-start;
    }
}


/* Patch - copyright sempre in basso alla pagina */
.main-area {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.content {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.app-footer {
    margin-top: auto;
    padding-top: 2rem;
    padding-bottom: 0;
    flex-shrink: 0;
}

.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.auth-page > :not(.auth-footer) {
    margin-top: auto;
    margin-bottom: auto;
}

.auth-footer {
    width: min(1050px, 100%);
    margin-top: 0;
    padding-top: 1rem;
}

@media (max-width: 720px) {
    .auth-page {
        align-items: stretch;
    }

    .auth-footer {
        width: 100%;
    }
}

/* Patch - paginazione tabelle ultimi ordini dashboard */
.dashboard-table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem 0;
}

.dashboard-table-page-size,
.dashboard-table-page-nav {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 600;
    white-space: nowrap;
}

.dashboard-table-page-size .form-select {
    width: auto;
    min-width: 86px;
    min-height: 42px;
    padding: .45rem 2.2rem .45rem .85rem;
    border-radius: 14px;
    font-weight: 700;
}

.dashboard-table-page-summary,
.dashboard-table-page-current {
    color: var(--muted);
    font-weight: 600;
}

.dashboard-page-button {
    width: 42px;
    height: 42px;
    min-height: 42px;
    line-height: 1;
    padding: 0;
    border-radius: 14px;
}

.dashboard-page-button svg {
    width: 19px;
    height: 19px;
}

.dashboard-page-button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

@media (max-width: 720px) {
    .dashboard-table-pagination {
        align-items: center;
        justify-content: flex-start;
        padding: 1rem 1.25rem 0;
        min-width: 980px;
    }

    .dashboard-table-page-size,
    .dashboard-table-page-nav {
        justify-content: flex-start;
        width: auto;
        text-align: left;
    }
}

/* Patch stabilizzazione pagina Ordini: filtri, toolbar, paginazione e azioni Bar */
.order-filter-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.order-filter-form {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr)) auto;
    gap: 1rem;
    align-items: end;
}

.order-filter-field {
    min-width: 0;
}

.order-filter-field-grow {
    min-width: 220px;
}

.order-filter-actions {
    display: flex;
    gap: .65rem;
    align-items: center;
    justify-content: flex-end;
}

.orders-list-card {
    margin-top: 1.5rem;
}

.orders-table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.5rem 0;
}

.courier-delivery-card .orders-table-toolbar {
    padding: 1.5rem 1.5rem 0;
}

.orders-table-toolbar h3 {
    margin: 0;
    font-weight: 700;
}

.orders-table-toolbar p {
    margin: .25rem 0 0;
    color: var(--muted);
    font-weight: 600;
}

.orders-table-page-size-form {
    margin: 0;
}

.orders-table-page-size {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 600;
    white-space: nowrap;
}

.orders-table-page-size .form-select {
    width: auto;
    min-width: 86px;
    min-height: 42px;
    padding: .45rem 2.2rem .45rem .85rem;
    border-radius: 14px;
    font-weight: 700;
}

.orders-sort-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: inherit;
    text-decoration: none;
    font-weight: 800;
}

.orders-sort-link:hover {
    color: var(--primary);
}

.orders-sort-link span {
    color: var(--muted);
    font-size: .82rem;
}

.orders-list-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
    margin-top: 1rem;
}

.orders-list-page-nav {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 600;
    white-space: nowrap;
}

.orders-page-button {
    width: 42px;
    height: 42px;
    min-height: 42px;
    line-height: 1;
    padding: 0;
    border-radius: 14px;
}

.orders-page-button svg {
    width: 19px;
    height: 19px;
}

.orders-page-button.disabled {
    opacity: .45;
    pointer-events: none;
}

.table-personnel-in-actions {
    justify-content: flex-end;
    min-width: 190px;
}

.table-personnel-in-actions .table-personnel-text {
    text-align: left;
}

@media (max-width: 1180px) {
    .order-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .order-filter-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .order-filter-card {
        padding: 1.25rem;
    }

    .order-filter-form {
        grid-template-columns: 1fr;
    }

    .order-filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .orders-table-toolbar {
        align-items: center;
        justify-content: flex-start;
        padding: 1.25rem 1.25rem 0;
        min-width: 980px;
    }

    .courier-delivery-card .orders-table-toolbar {
        padding: 1.25rem 1.25rem 0;
    }

    .orders-list-pagination {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: .25rem;
    }
}



/* Patch: dashboard Pasticceria con riquadri stato cliccabili */
.stat-card.stat-card-with-action {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    min-height: 180px;
}

.stat-card.stat-card-with-action strong {
    margin-top: .25rem;
}

.stat-card-action {
    margin-top: auto;
    width: 100%;
    justify-content: center;
}

@media (max-width: 720px) {
    .stat-card.stat-card-with-action {
        min-height: 160px;
    }
}

/* Order detail page */
.order-detail-page-actions {
    align-items: flex-start;
    gap: 1rem;
}

.page-actions-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
    flex-wrap: wrap;
}

.order-detail-status-card {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.order-detail-status-card > div:first-child {
    flex: 0 1 420px;
    max-width: 420px;
}

.order-detail-status-card h3,
.order-detail-page-box h3,
.order-detail-page-section h3,
.order-detail-page-item h4 {
    margin: 0;
    font-weight: 700;
}

.order-detail-status-card p,
.order-detail-page-box p,
.order-detail-page-section p,
.order-detail-page-item p {
    margin-bottom: 0;
}

.order-status-update-form {
    min-width: min(100%, 420px);
}

.order-status-update-control {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.order-status-update-control .form-select {
    min-width: 210px;
}

.order-detail-page-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.order-detail-page-box,
.order-detail-page-section {
    padding: 1.5rem;
}

.order-detail-page-section {
    margin-top: 1.5rem;
}

.order-detail-personnel {
    justify-content: flex-start;
    margin-top: .75rem;
}

.order-detail-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.order-detail-page-total {
    font-size: 1.4rem;
    font-weight: 700;
    white-space: nowrap;
    background: var(--soft);
    padding: 5px 16px;
    border-radius: 20px;
}

.order-detail-page-items {
    display: grid;
    gap: 1rem;
}

.order-detail-page-item {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
}

.order-detail-page-item-main {
    min-width: 0;
}

.order-detail-page-variations {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .75rem;
}

.order-detail-page-variations span {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .6rem;
    border-radius: 999px;
    background: #f8f9fa;
    border: 1px solid var(--line);
    font-weight: 500;
}

.order-detail-page-variations small {
    color: var(--muted);
    font-weight: 600;
}

.order-detail-item-note {
    margin-top: .75rem;
    color: var(--muted);
    font-weight: 500;
}

.order-log-list-page {
    margin-top: 0;
}

@media (max-width: 980px) {
    .order-detail-section-heading,
    .order-detail-page-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .page-actions-group,
    .order-status-update-control {
        justify-content: flex-start;
    }

    .order-detail-page-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .order-detail-status-card,
    .order-detail-page-box,
    .order-detail-page-section {
        padding: 1.25rem;
    }

    .order-detail-status-card {
        align-items: stretch;
        flex-direction: column;
    }

    .order-detail-status-card > div:first-child {
        max-width: none;
    }

    .order-status-update-control {
        align-items: stretch;
        flex-direction: column;
    }

    .order-status-update-control .form-select {
        min-width: 0;
        width: 100%;
    }

    .order-detail-page-item {
        grid-template-columns: 60px minmax(0, 1fr);
        align-items: flex-start;
    }

    .order-detail-page-item .order-detail-product-price {
        grid-column: 2;
        justify-self: flex-start;
    }
}


/* Patch - varianti con label affiancata e stampa ordine */
.variation-pill-list span,
.order-detail-page-variations span {
    gap: 4px;
}

.variation-pill-label,
.selected-product-variations strong.variation-pill-label,
.order-modal .variation-pill-list strong.variation-pill-label,
.order-detail-page-variations strong.variation-pill-label {
    display: inline;
    color: var(--text);
    font-weight: 700;
}

.variation-pill-value {
    color: inherit;
    font-weight: 500;
    border: 0 !important;
}

.order-print-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@media print {
    .sidebar,
    .mobile-app-bar,
    .page-actions-group,
    .order-detail-status-card,
    .app-footer {
        display: none !important;
    }

    .content {
        padding: 0 !important;
    }

    .main {
        margin: 0 !important;
    }

    .card {
        box-shadow: none !important;
        break-inside: avoid;
    }
}


/* Patch - stampa ordine pulita */
.print-order-status {
    display: none;
}

@media print {
    @page {
        size: A4;
        margin: 14mm;
    }

    html,
    body {
        background: #fff !important;
        color: #111827 !important;
        font-family: Inter, Arial, sans-serif !important;
        font-size: 11pt !important;
        line-height: 1.35 !important;
    }

    * {
        box-shadow: none !important;
        text-shadow: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    a,
    a:visited {
        color: inherit !important;
        text-decoration: none !important;
    }

    a[href]::after {
        content: "" !important;
    }

    .sidebar,
    .mobile-app-bar,
    .app-footer,
    .page-actions-group,
    .order-detail-status-card,
    .order-print-button,
    .order-status-update-form,
    .btn,
    .modal,
    .modal-backdrop {
        display: none !important;
    }

    .main,
    .content {
        width: 100% !important;
        max-width: none !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    .page-actions.order-detail-page-actions {
        display: block !important;
        padding: 0 0 12px !important;
        margin: 0 0 14px !important;
        border-bottom: 2px solid #111827 !important;
    }

    .print-order-title-row {
        display: flex !important;
        align-items: flex-end !important;
        justify-content: space-between !important;
        gap: 12px !important;
        margin: 0 0 6px !important;
    }

    .order-detail-page-actions .eyebrow {
        margin: 0 0 4px !important;
        color: #6b7280 !important;
        font-size: 8.5pt !important;
        font-weight: 700 !important;
        letter-spacing: .08em !important;
        text-transform: uppercase !important;
    }

    .order-detail-page-actions h2 {
        margin: 0 !important;
        color: #111827 !important;
        font-size: 25pt !important;
        font-weight: 800 !important;
        line-height: 1 !important;
    }

    .order-detail-page-actions p {
        margin: 0 !important;
        color: #4b5563 !important;
        font-size: 10pt !important;
        font-weight: 500 !important;
    }

    .print-order-status {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 6px 10px !important;
        border: 1px solid #111827 !important;
        border-radius: 999px !important;
        color: #111827 !important;
        background: #f5f5f9 !important;
        font-size: 9pt !important;
        font-weight: 800 !important;
        white-space: nowrap !important;
    }

    .order-detail-page-grid {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 10px !important;
        margin: 0 0 12px !important;
    }

    .card,
    .order-detail-page-box,
    .order-detail-page-section {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 10px !important;
        background: #fff !important;
        padding: 11px 12px !important;
    }

    .order-detail-page-box h3,
    .order-detail-page-section h3,
    .order-detail-page-item h4 {
        margin: 0 0 6px !important;
        color: #111827 !important;
        font-size: 11pt !important;
        font-weight: 800 !important;
        line-height: 1.2 !important;
    }

    .order-detail-page-box p,
    .order-detail-page-section p,
    .order-detail-page-item p,
    .muted-text {
        margin: 0 0 3px !important;
        color: #4b5563 !important;
        font-size: 9.5pt !important;
        font-weight: 500 !important;
    }

    .order-detail-personnel {
        margin-top: 6px !important;
    }

    .table-personnel-avatar {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        font-size: 9pt !important;
    }

    .table-personnel-text strong,
    .table-personnel-text small {
        color: #111827 !important;
    }

    .order-detail-page-section {
        margin-top: 10px !important;
    }

    .order-detail-section-heading {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        margin: 0 0 10px !important;
        padding-bottom: 8px !important;
        border-bottom: 1px solid #e5e7eb !important;
    }

    .order-detail-section-heading > div {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    .order-detail-section-heading .eyebrow {
        margin: 0 0 3px !important;
        color: #6b7280 !important;
        font-size: 8pt !important;
        font-weight: 800 !important;
        letter-spacing: .08em !important;
        text-transform: uppercase !important;
    }

    .order-detail-page-total {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 6px 10px !important;
        border-radius: 8px !important;
        background: #111827 !important;
        color: #fff !important;
        font-size: 13pt !important;
        font-weight: 800 !important;
        white-space: nowrap !important;
    }

    .order-detail-page-items {
        display: grid !important;
        gap: 8px !important;
    }

    .order-detail-page-item {
        display: grid !important;
        grid-template-columns: 52px minmax(0, 1fr) auto !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 8px !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 10px !important;
        background: #f8f9fa !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    .order-detail-product-thumb {
        width: 52px !important;
        height: 52px !important;
        object-fit: cover !important;
        border-radius: 8px !important;
        border: 1px solid #e5e7eb !important;
        background: #fff !important;
    }

    .order-detail-product-qty {
        color: #6b7280 !important;
        font-size: 9pt !important;
        font-weight: 600 !important;
    }

    .order-detail-product-price {
        align-self: center !important;
        color: #111827 !important;
        font-size: 11pt !important;
        font-weight: 800 !important;
        white-space: nowrap !important;
    }

    .order-detail-page-variations {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        margin-top: 5px !important;
    }

    .order-detail-page-variations span {
        padding: 3px 6px !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 999px !important;
        background: #fff !important;
        color: #111827 !important;
        font-size: 8.5pt !important;
        font-weight: 500 !important;
    }

    .variation-pill-label,
    .order-detail-page-variations strong.variation-pill-label {
        color: #111827 !important;
        font-weight: 800 !important;
    }

    .variation-pill-value {
        border: 0 !important;
        font-weight: 500 !important;
    }

    .order-detail-item-note {
        margin-top: 5px !important;
        color: #6b7280 !important;
        font-size: 9pt !important;
        font-style: italic !important;
    }

    .order-log-list,
    .order-log-list-page {
        display: grid !important;
        gap: 6px !important;
        margin-top: 0 !important;
    }

    .order-log-item {
        margin: 0 !important;
        padding: 8px 10px !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 8px !important;
        background: #f5f5f9 !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    .order-log-heading {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        margin-bottom: 2px !important;
    }

    .order-log-heading strong,
    .order-log-item small,
    .order-log-item p {
        color: #111827 !important;
        font-size: 8.8pt !important;
    }

    .order-log-user-badge {
        border: 1px solid #d1d5db !important;
        background: #fff !important;
        color: #111827 !important;
        font-size: 8pt !important;
    }

    .badge {
        border: 1px solid #d1d5db !important;
        background: #fff !important;
        color: #111827 !important;
    }
}

/* Patch - messaggi vuoti coerenti anche nelle tabelle Bootstrap */
.admin-table-card .table .empty-cell,
.admin-table-card .responsive-table .empty-cell {
    color: var(--muted) !important;
}

/* Patch - visualizzazione prezzo moltiplicatore varianti */
.product-option-text-split {
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
}

.product-option-text-split .product-option-price {
    margin-left: auto;
    white-space: nowrap;
}

.product-option-price-inline {
    font-size: 70%;
    font-weight: 500;
    color: var(--muted);
}


/* Patch - upload foto nelle varianti prodotto */
.variation-option-row {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 210px) minmax(120px, 160px) 48px 48px;
}

.variation-file-existing {
    display: block;
    margin-top: .35rem;
}

.variation-file-link {
    color: var(--text);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.selected-product-file-inputs {
    display: none !important;
}

@media (max-width: 720px) {
    .variation-option-row {
        grid-template-columns: 1fr 1fr 44px 44px;
    }

    .variation-option-row > div:nth-child(2),
    .variation-option-row > div:nth-child(3) {
        grid-column: span 1;
    }
}

/* Patch - preview upload file/foto nelle varianti ordine */
.variation-file-preview {
    margin-top: .7rem;
}

.variation-file-preview:empty {
    display: none;
}

.variation-file-preview-card,
.variation-file-chip {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    max-width: 100%;
    color: var(--text);
    text-decoration: none;
}

.variation-file-preview-card {
    padding: .7rem .85rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8f9fa;
}

.variation-file-preview-card:hover,
.variation-file-chip:hover {
    color: var(--text);
    text-decoration: none;
}

.variation-file-preview-card img {
    width: 78px;
    height: 78px;
    border-radius: 14px;
    object-fit: cover;
    background: #fff;
    border: 1px solid var(--line);
}

.variation-file-preview-icon,
.variation-file-chip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
}

.variation-file-preview-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
}

.variation-file-preview-icon svg {
    width: 28px;
    height: 28px;
}

.variation-file-preview-name {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 600;
}

.variation-file-chip {
    padding: .2rem .35rem .2rem .2rem;
    border-radius: 999px;
    background: #f8f9fa;
}

.variation-file-chip img {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid var(--line);
    background: #fff;
}

.variation-file-chip-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
}

.variation-file-chip-icon svg {
    width: 20px;
    height: 20px;
}

.selected-product-file-cost-subrow {
    align-items: flex-start;
}

.selected-product-file-cost-subrow .variation-file-preview-card {
    flex: 1 1 auto;
}

@media (max-width: 720px) {
    .variation-file-preview-card {
        width: 100%;
    }

    .variation-file-preview-card img {
        width: 64px;
        height: 64px;
    }
}

/* Patch - rimozione upload variante e nome file compatto */
.variation-file-preview-row {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-top: .7rem;
}

.variation-file-preview-row .variation-file-preview {
    margin-top: 0;
}

.variation-file-preview-row .variation-file-preview:empty + .variation-file-remove-icon {
    display: none;
}

.variation-file-remove-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    padding: 0;
    border: 1px solid #f1c7c7;
    border-radius: 999px;
    background: #fff5f5;
    color: #b02a37;
    transition: none;
}

.variation-file-remove-icon:hover,
.variation-file-remove-icon:focus-visible {
    border-color: #b02a37;
    background: #b02a37 !important;
    color: #fff;
    transform: none;
}

.variation-file-remove-icon svg {
    width: 20px;
    height: 20px;
}

.variation-file-preview-name,
.variation-file-chip span:last-child {
    display: inline-block;
    max-width: 30ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .82rem;
    line-height: 1.25;
}

.variation-file-preview-name {
    font-weight: 600;
}

@media (max-width: 720px) {
    .variation-file-preview-row {
        align-items: flex-start;
    }

    .variation-file-remove-icon {
        flex-basis: 50px;
        width: 50px;
        height: 50px;
    }
}

/* Patch - mostra anteprima upload varianti anche nel riepilogo prodotto */
.selected-product-variation-file {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}

.selected-product-variations .variation-file-preview-card {
    padding: .3rem .45rem .3rem .3rem;
    border-radius: 999px;
    background: #f8f9fa;
}

.selected-product-variations .variation-file-preview-card img {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    object-fit: cover;
}

.selected-product-variations .variation-file-preview-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
}

.selected-product-variations .variation-file-preview-icon svg {
    width: 20px;
    height: 20px;
}


/* Patch - nasconde nome file nei dettagli ordine, lasciando solo anteprima */
.variation-file-chip.is-preview-only,
.variation-file-preview-card.is-preview-only {
    gap: 0;
    padding-right: .2rem;
}

.variation-file-preview-card.is-preview-only {
    width: auto;
}

.selected-product-file-cost-subrow .variation-file-preview-card.is-preview-only {
    flex: 0 0 auto;
}

/* Patch - stato ordine dettaglio in 2 colonne */
.order-detail-status-card {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    align-items: start;
    justify-content: start;
    column-gap: 2rem;
    row-gap: 1rem;
}

.order-detail-status-card > div:first-child {
    display: block;
    max-width: none;
    min-width: 0;
}

.order-detail-status-card > div:first-child .eyebrow,
.order-detail-status-card > div:first-child h3,
.order-status-update-form .form-label {
    margin: 0;
}

.order-detail-status-card > div:first-child .eyebrow,
.order-status-update-form .form-label {
    min-height: 18px;
    line-height: 1.2;
}

.order-detail-status-card > div:first-child h3 {
    margin-top: .35rem;
    white-space: nowrap;
}

.order-detail-status-card > div:first-child p:not(.eyebrow) {
    display: none;
}

.order-status-update-form {
    display: block;
    min-width: 0;
    margin: 0;
}

.order-status-update-form .form-label {
    display: block;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.order-status-update-control {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: nowrap;
    margin-top: .35rem;
}

.order-status-update-control .form-select {
    width: auto;
    min-width: 220px;
}

@media (max-width: 720px) {
    .order-detail-status-card {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 1rem;
    }

    .order-detail-status-card > div:first-child h3 {
        white-space: normal;
    }

    .order-status-update-form,
    .order-status-update-control,
    .order-status-update-control .form-select,
    .order-status-update-control .btn {
        width: 100%;
    }

    .order-status-update-control {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Patch - spaziatura min/max scelta multipla nei gruppi varianti */
.variant-admin-form .variation-admin-row .variation-checkbox-limits {
    margin-top: 1rem;
}

@media (max-width: 575.98px) {
    .variant-admin-form .variation-admin-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .variant-admin-form .variation-admin-actions .remove-variant-group-item {
        width: 100%;
    }
}

/* Preventivi: stato allineato a sinistra senza label */
.quote-status-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: .75rem;
    margin: -.35rem 0 1.25rem;
    flex-wrap: wrap;
}

.quote-status-toolbar .order-status-heading-select {
    min-width: 220px;
}

.quote-status-detail-wrap {
    display: flex;
    justify-content: flex-start;
}

.quote-status-update-control {
  margin-top: 1rem;
}

@media (max-width: 575.98px) {
    .quote-status-toolbar,
    .quote-status-toolbar .order-status-heading-select,
    .quote-status-toolbar .btn {
        width: 100%;
    }
}

.quote-items-table {
    display: grid;
    gap: .75rem;
}

.quote-item-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 110px 130px 120px 112px;
    align-items: center;
    gap: .75rem;
    padding: .9rem;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
}

.quote-item-row-heading {
    padding: 0 .9rem;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.quote-item-description textarea {
    min-height: 52px;
    resize: vertical;
}

.quote-item-total {
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.quote-item-actions {
    display: flex;
    justify-content: flex-end;
    gap: .45rem;
}

.quote-total-box {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--soft);
    border-radius: 24px;
    font-weight: 700;
}

.quote-total-box strong {
    font-size: 1.45rem;
}

.quote-detail-items {
    display: grid;
    gap: .75rem;
}

.quote-detail-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
}

.quote-detail-item h4 {
    margin: 0 0 .35rem;
    font-size: 1rem;
    font-weight: 700;
}

.quote-detail-item p {
    margin: 0;
    color: var(--muted);
    font-size: .92rem;
}

@media (max-width: 980px) {
    .quote-item-row,
    .quote-item-row-heading {
        grid-template-columns: 1fr;
    }

    .quote-item-row-heading {
        display: none;
    }

    .quote-item-total {
        text-align: left;
    }

    .quote-item-actions {
        justify-content: flex-start;
    }

    .quote-total-box {
        justify-content: space-between;
    }
}

.quote-detail-delivery-summary {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.quote-detail-delivery-summary h4 {
    margin: 0 0 .5rem;
    font-size: .95rem;
    font-weight: 700;
}

.quote-detail-delivery-summary p {
    margin: 0 0 .35rem;
}

.quote-detail-delivery-summary p:last-child {
    margin-bottom: 0;
}

/* Patch - auth inputs: bordo più leggero su login e recupero password */
.auth-page .login-card .form-card input {
    border: 1px solid #e5e7eb;
    box-shadow: none;
}

.auth-page .login-card .form-card input:focus {
    border-color: #cfd4da;
    box-shadow: 0 0 0 4px rgba(33, 37, 41, .045);
}


/* Patch - login: ricordami su questo pc */
.remember-login-check {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    width: auto;
    margin-top: 1rem;
    margin-bottom: 0;
    color: #343a40;
    font-size: .94rem;
    font-weight: 600;
    cursor: pointer;
}

.form-card label.remember-login-check:not(:first-child) {
    margin-top: 1rem;
    padding: 0;
    font-size: 14px;
    text-transform: lowercase;
}

.remember-login-check .form-check-input {
    margin: 0;
    cursor: pointer;
}

.remember-login-check .form-check-label {
    margin: 0;
    cursor: pointer;
    line-height: 1.35;
}


/* Patch 031: categorie nella popup scelta prodotto ordine */
.product-picker-category-panel {
    display: grid;
    gap: 12px;
    margin-top: 8px;
}


.product-picker-category-panel[hidden] {
    display: none !important;
}

#product-picker-list.product-picker-grid:not([hidden]) {
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 22px;
    background: #fff;
}

.product-picker-browse-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.product-picker-browse-head strong {
    display: block;
    color: var(--text);
    font-size: .98rem;
    font-weight: 700;
}

.product-picker-browse-head small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 500;
}

.product-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.product-category-card {
    width: 100%;
    min-height: 148px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border: 1px solid #dee2e6;
    border-radius: 22px;
    background: #fff;
    color: var(--text);
    text-align: center;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.product-category-card:hover,
.product-category-card:focus,
.product-category-card.is-active {
    border-color: #212529;
    background: #f8f9fa;
    transform: translateY(-1px);
    outline: none;
}

.product-category-thumb-wrap {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: #f8f9fa;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.product-category-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-category-title {
    width: 100%;
    display: block;
    color: var(--text);
    font-size: .96rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-category-card small {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 500;
}

.product-category-empty {
    grid-column: 1 / -1;
    padding: 16px;
    border: 1px dashed #ced4da;
    border-radius: 18px;
    background: #f8f9fa;
}

.product-picker-active-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    margin-top: 10px;
    border: 1px solid #dee2e6;
    border-radius: 18px;
    background: #f8f9fa;
}

.product-picker-active-category[hidden] {
    display: none !important;
}

.product-picker-active-category strong,
.product-picker-active-category small {
    display: block;
}

.product-picker-active-category strong {
    color: var(--text);
    font-size: .96rem;
    font-weight: 700;
}

.product-picker-active-category small {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 500;
}

.product-category-back {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid #dee2e6;
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-size: .86rem;
    font-weight: 700;
    cursor: pointer;
}

.product-category-back:hover,
.product-category-back:focus {
    border-color: #212529;
    outline: none;
}

@media (max-width: 700px) {
    .product-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-picker-active-category {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Patch 032: fix dimensione immagini categorie popup prodotto ordine */
#product-picker-category-list .product-category-card {
    overflow: hidden;
}

#product-picker-category-list .product-category-card .product-category-thumb-wrap {
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    max-width: 64px !important;
    flex: 0 0 64px !important;
    display: grid !important;
    place-items: center !important;
    overflow: hidden !important;
}

#product-picker-category-list .product-category-card .product-category-thumb-wrap > img,
#product-picker-category-list .product-category-card img.product-category-thumb,
#product-picker-category-list .product-category-card img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    display: block !important;
    object-fit: cover !important;
}

#product-picker-list.product-picker-grid .product-picker-card img.product-picker-thumb {
    width: 82px !important;
    height: 82px !important;
    max-width: 82px !important;
    max-height: 82px !important;
    display: block !important;
    object-fit: cover !important;
}

@media (max-width: 700px) {
    #product-picker-list.product-picker-grid .product-picker-card img.product-picker-thumb {
        width: 72px !important;
        height: 72px !important;
        max-width: 72px !important;
        max-height: 72px !important;
    }
}
