:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --panel-elevated: #f8fafc;
    --input-bg: #ffffff;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --text: #0f172a;
    --text-secondary: #334155;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --accent: #10b981;
    --accent-dark: #059669;
    --brand-dark: #0f172a;
    --brand-deep: #090d16;
    --brand-blue-soft: #eff6ff;
    --brand-yellow: #f59e0b;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #4f46e5;
    --status: #e0f2fe;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius: 10px;
    --radius-lg: 12px;
    --radius-pill: 999px;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-soft: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13.5px;
    line-height: 1.5;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* ==========================================================================
   1. APP SHELL, SIDEBAR & TOPBAR
   ========================================================================== */
.app-shell {
    display: grid;
    grid-template-columns: 256px minmax(0, 1fr);
    min-height: 100vh;
}

.app-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 16px 12px;
    background: linear-gradient(180deg, var(--brand-dark) 0%, var(--brand-deep) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    z-index: 20;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 6px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 12px;
}

.sidebar-backdrop {
    display: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
    font-weight: 800;
}

.sidebar .brand {
    color: #ffffff;
}

.brand span {
    display: grid;
    line-height: 1.15;
}

.brand strong {
    font-size: 15px;
    letter-spacing: -0.02em;
}

.brand small {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 2px;
}

.sidebar .brand small {
    color: #94a3b8;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: contain;
    background: #07090e;
    padding: 2px;
    border: 1px solid rgba(34, 211, 238, 0.28);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
    padding-bottom: 20px;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-title {
    padding: 0 10px 6px;
    color: #64748b;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 7px 11px;
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s ease;
    position: relative;
}

.side-nav a svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: #94a3b8;
    transition: color 0.15s ease;
}

.side-nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.side-nav a:hover svg {
    color: #ffffff;
}

.side-nav a.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.24) 0%, rgba(37, 99, 235, 0.08) 100%);
    color: #ffffff;
    font-weight: 700;
    box-shadow: inset 3px 0 0 #3b82f6;
}

.side-nav a.active svg {
    color: #60a5fa;
}

.side-nav .nav-badge {
    margin-left: auto;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.side-nav .nav-badge.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.sidebar-footer {
    margin-top: auto;
    padding: 12px 10px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #64748b;
    font-size: 11.5px;
}

/* Topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 62px;
    padding: 0 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-title {
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.015em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-search {
    flex: 1 1 360px;
    max-width: 480px;
    margin: 0 12px;
}

.topbar-search form {
    margin: 0;
    position: relative;
    display: flex;
    align-items: center;
}

.topbar-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--muted);
    pointer-events: none;
    z-index: 2;
}

.topbar-search input[type="search"] {
    width: 100%;
    height: 38px;
    min-height: 38px;
    padding: 0 16px 0 40px !important;
    border: 1px solid var(--line-strong);
    border-radius: 999px !important;
    background: var(--panel-soft);
    font-size: 13px;
    color: var(--text);
    transition: all 0.15s ease;
}

.topbar-search input[type="search"]:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.topbar-quick-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-quick-actions .quick-btn {
    height: 36px;
    padding: 0 13px;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: 8px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav a,
.nav-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav a.active,
.nav a:hover,
.nav-button:hover {
    background: var(--panel-soft);
    border-color: var(--line);
    color: var(--primary);
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.menu-toggle,
.menu-close {
    display: none;
}

/* ==========================================================================
   2. CONTEXTUAL MODULE SUB-NAVIGATION (.subnav)
   ========================================================================== */
.subnav-bar {
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    padding: 6px 28px;
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* ELIMINATES HORIZONTAL SCROLL */
    gap: 4px 6px;
    min-height: 46px;
}

.subnav-bar a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.subnav-bar a:hover {
    color: var(--text);
    background: #f1f5f9;
}

.subnav-bar a.active {
    color: var(--primary);
    background: #eef2ff;
    font-weight: 700;
}

/* Streamlined Inventory KPI Bar */
.inventory-kpi-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.kpi-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 12.5px;
}

.kpi-label {
    color: var(--muted);
    font-weight: 500;
}

.kpi-val {
    color: var(--text);
    font-weight: 800;
}

.kpi-warning {
    background: #fef2f2;
    border-color: #fecaca;
}
.kpi-warning .kpi-val {
    color: var(--danger);
}

.kpi-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.kpi-success .kpi-val {
    color: #16a34a;
}

/* ==========================================================================
   3. PAGE CONTAINER, TYPOGRAPHY & BUTTONS
   ========================================================================== */
.page {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px 28px 48px;
    flex: 1;
}

.page-title {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

h1 {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.2;
    color: var(--text);
}

h2 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.3;
    color: var(--text);
}

h3 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

p {
    margin: 0 0 10px;
}

.page-title p,
.muted {
    color: var(--muted);
    font-size: 13.5px;
    margin: 0;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.section-head h2,
.section-head p {
    margin: 0;
}

.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 7px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text-secondary);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.button:hover,
button.button:hover {
    border-color: #94a3b8;
    background: var(--panel-soft);
    color: var(--text);
    box-shadow: var(--shadow-soft);
}

.button.primary {
    border-color: var(--primary);
    background: linear-gradient(180deg, #3b82f6 0%, var(--primary) 100%);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.3);
}

.button.primary:hover {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-dark);
    color: #ffffff;
}

.button.secondary {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: var(--primary-dark);
}

.button.secondary:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.button.success {
    border-color: var(--accent);
    background: linear-gradient(180deg, #10b981 0%, var(--accent-dark) 100%);
    color: #ffffff;
}

.button.warning {
    border-color: #fcd34d;
    background: #fffbeb;
    color: #b45309;
}

.button.danger {
    border-color: #fecaca;
    background: #fef2f2;
    color: var(--danger);
}

.button.danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.button-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.link-button {
    padding: 4px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--primary);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}

.link-button:hover {
    background: var(--panel-soft);
}

.danger-text {
    color: var(--danger) !important;
}

/* ==========================================================================
   4. KPI BENTO CARDS (.metric-grid, .compact-metrics, .repair-kpi-row, .pos-summary)
   ========================================================================== */
.metric-grid,
.compact-metrics,
.repair-kpi-row,
.pos-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin: 0 0 20px;
}

.metric-grid article,
.compact-metrics article,
.repair-kpi-row article,
.pos-summary article {
    position: relative;
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.metric-grid article:hover,
.compact-metrics article:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.metric-grid article::before,
.compact-metrics article::before,
.repair-kpi-row article::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--primary);
}

.metric-grid article:nth-child(2)::before,
.compact-metrics article:nth-child(2)::before,
.repair-kpi-row article:nth-child(2)::before {
    background: var(--accent);
}

.metric-grid article:nth-child(3)::before,
.compact-metrics article:nth-child(3)::before,
.repair-kpi-row article:nth-child(3)::before {
    background: var(--brand-yellow);
}

.metric-grid article:nth-child(4)::before,
.compact-metrics article:nth-child(4)::before,
.repair-kpi-row article:nth-child(4)::before {
    background: #6366f1;
}

.metric-grid article:nth-child(5)::before,
.compact-metrics article:nth-child(5)::before,
.repair-kpi-row article:nth-child(5)::before {
    background: var(--danger);
}

.metric-grid span,
.compact-metrics span,
.repair-kpi-row span,
.pos-summary span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.metric-grid strong,
.compact-metrics strong,
.repair-kpi-row strong,
.pos-summary strong {
    display: block;
    margin-top: 6px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.metric-grid p,
.compact-metrics p,
.repair-kpi-row p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

/* ==========================================================================
   5. CARDS, PANELS & MODERNIZED FIELDSETS
   ========================================================================== */
.panel {
    min-width: 0;
    margin: 0;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

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

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

/* Transform native <fieldset> + <legend> into sleek SaaS Section Cards */
fieldset {
    position: relative;
    min-width: 0;
    margin: 0;
    padding: 58px 20px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

fieldset > legend {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 13px 20px;
    margin: 0;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

fieldset > .table-wrap,
fieldset > .pos-summary,
fieldset > .metric-grid,
fieldset > .compact-details,
fieldset > .suggestion-strip,
fieldset > .notice,
fieldset > .button-row,
fieldset > .section-head,
fieldset > .detail-grid {
    grid-column: 1 / -1;
    width: 100%;
}

.dense-fieldset {
    gap: 12px;
    padding: 52px 18px 18px;
}

.span-2 {
    grid-column: 1 / -1 !important;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    align-items: center;
    padding-top: 6px;
}

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

.top-gap {
    margin-top: 18px;
}

/* ==========================================================================
   6. FORMS, INPUTS, SELECTS & FILTERS
   ========================================================================== */
label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 700;
}

input:where(:not([type="checkbox"]):not([type="radio"])),
select,
textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    font-size: 13.5px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:where(:not([type="checkbox"]):not([type="radio"])):hover,
select:hover,
textarea:hover {
    border-color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: var(--danger);
    background: #fef2f2;
}

input[type="checkbox"],
input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0 7px 0 0;
    vertical-align: -3px;
    accent-color: var(--primary);
    cursor: pointer;
}

label span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

.field-help,
.field-error {
    display: block;
    font-size: 12px;
    line-height: 1.35;
}

.field-help {
    color: var(--muted);
    font-weight: 500;
}

.field-error {
    color: var(--danger);
    font-weight: 700;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 16px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

.filters label {
    flex: 1 1 145px;
    min-width: 120px;
}

.filters label.span-2 {
    flex: 2.6 1 300px;
}

.filters label:has(input[type="checkbox"]) {
    flex: 0 0 auto;
    min-width: 0;
    padding-bottom: 9px;
}

.filters .button {
    width: auto;
    min-width: 88px;
    height: 40px;
}

.compact-details {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-soft);
    overflow: hidden;
}

.compact-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 8px 14px;
    color: var(--primary-dark);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    background: #eff6ff;
}

.compact-details summary::-webkit-details-marker {
    display: none;
}

.compact-details summary::after {
    content: "+ Espandi";
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #bfdbfe;
    color: var(--primary);
}

.compact-details[open] summary::after {
    content: "Chiudi";
}

.compact-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    padding: 14px;
    background: #ffffff;
    border-top: 1px solid var(--line);
}

/* ==========================================================================
   7. SAAS DATA TABLES & OPERATIONAL MASTER-DETAIL
   ========================================================================== */
.table-wrap,
.operational-table {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

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

th,
td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    vertical-align: middle;
    font-size: 13px;
}

/* Allow descriptions and text cells to wrap gracefully without blowing up table width */
td:not(.actions):not(.right):not(.nowrap) {
    white-space: normal;
    max-width: 320px;
    word-break: break-word;
}

th,
td.actions,
td.right,
td.nowrap {
    white-space: nowrap;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
}

td code,
.table-wrap code {
    padding: 2px 6px;
    border-radius: 5px;
    background: #f1f5f9;
    color: #334155;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}

tbody tr {
    transition: background-color 0.1s ease;
}

tbody tr:hover,
tbody tr[data-inspector-row]:hover {
    background: #f8fafc;
}

tbody tr[data-inspector-row] {
    cursor: pointer;
}

tbody tr.is-selected,
tbody tr[data-inspector-row].is-selected {
    background: #eff6ff !important;
    box-shadow: inset 3px 0 0 var(--primary);
}

tr:last-child td {
    border-bottom: 0;
}

.right {
    text-align: right;
}

.actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
}

.actions .button,
.actions button.button {
    min-height: 30px;
    padding: 4px 10px;
    font-size: 12px;
}

.empty {
    padding: 36px 16px !important;
    color: var(--muted);
    text-align: center;
    font-size: 14px;
}

/* Operational Grid & Inspector Drawer */
.operational-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}

.operational-grid.is-empty {
    grid-template-columns: 1fr;
}

.operational-grid.is-empty .operational-inspector {
    display: none !important;
}

.operational-inspector {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.inspector-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 12px 0;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
}

.inspector-tabs > * {
    padding: 8px 12px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: var(--muted);
    border-radius: 6px 6px 0 0;
    transition: all 0.15s ease;
}

.inspector-tabs > *:hover {
    color: var(--primary);
}

.inspector-tabs > *.active {
    background: #ffffff;
    color: var(--primary);
    font-weight: 800;
    border-bottom-color: var(--primary);
}

.inspector-fields {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 0;
    padding: 12px 16px;
    margin: 0;
}

.inspector-fields dt,
.inspector-fields dd {
    min-height: 30px;
    padding: 6px 4px;
    border-bottom: 1px solid #f1f5f9;
    overflow-wrap: anywhere;
    margin: 0;
}

.inspector-fields dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.inspector-fields dd {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.inspector-edit,
.inspector-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: #f8fafc;
    margin: 0;
}

.operational-commandbar {
    display: none !important;
}

/* ==========================================================================
   8. SEMANTIC STATUS BADGES, ROLES & CHIPS
   ========================================================================== */
.status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.2;
}

.status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status.sent,
.status.completed,
.status.available,
.status.accepted,
.status.done {
    background: #dcfce7;
    color: #15803d;
}

.status.draft,
.status.testing,
.status.reserved,
.status.scheduled {
    background: #fef3c7;
    color: #b45309;
}

.status.rejected,
.status.expired,
.status.scrapped,
.status.cancelled {
    background: #fee2e2;
    color: #b91c1c;
}

.role {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.role.admin { background: #dbeafe; color: #1e40af; }
.role.super_admin { background: #0f172a; color: #ffffff; }
.role.staff { background: #dcfce7; color: #166534; }
.role.technician { background: #ffedd5; color: #9a3412; }
.role.cashier { background: #ccfbf1; color: #115e59; }
.role.warehouse { background: #ede9fe; color: #5b21b6; }

/* ==========================================================================
   9. INTERACTIVE TABS & REPAIR WORKSPACE
   ========================================================================== */
.tabs {
    position: sticky;
    top: 62px;
    z-index: 10;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0 0 18px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.tabs a,
.tabs button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 14px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tabs a:hover,
.tabs button:hover {
    background: var(--panel-soft);
    color: var(--text);
}

.tabs a.active,
.tabs button.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.tab-panel {
    scroll-margin-top: 124px;
}

.repair-command {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: start;
    margin-bottom: 18px;
    padding: 22px 24px;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
    box-shadow: var(--shadow-soft);
}

.eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.repair-command-main h1 {
    font-size: 28px;
}

.repair-command-main p {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
}

.repair-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.repair-badges span:not(.status) {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.repair-command-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 620px;
}

.repair-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.repair-primary,
.repair-aside {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.repair-notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.repair-notes-grid section {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-soft);
}

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

.repair-timeline {
    display: grid;
    gap: 12px;
}

.repair-timeline-item {
    position: relative;
    display: grid;
    gap: 2px;
    padding-left: 18px;
}

.repair-timeline-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px #dbeafe;
}

/* ==========================================================================
   10. KANBAN, STEPPER, SUGGESTION CHIPS, CATALOGS & AUTH
   ========================================================================== */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 16px;
    align-items: start;
}

.kanban-column {
    background: #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 320px;
}

.kanban-column h2 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #334155;
    margin: 0;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow-xs);
    display: grid;
    gap: 8px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.kanban-card.is-overdue {
    border-left: 4px solid var(--danger);
}

.label-code {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 5px;
    background: #f1f5f9;
    color: #334155;
    font-family: ui-monospace, monospace;
    font-size: 11px;
    font-weight: 700;
}

.suggestion-strip {
    display: grid;
    gap: 10px;
    margin: 0 0 14px;
    padding: 14px 16px;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    background: #eff6ff;
}

.suggestion-strip > strong {
    color: #1e3a8a;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.suggestion-strip > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 5px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #ffffff;
    color: var(--primary-dark);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.suggestion-chip:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.auth-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.auth-steps li {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #ffffff;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 700;
    text-align: center;
    transition: all 0.15s ease;
}

.auth-steps li.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.auth-steps li.done {
    border-color: #86efac;
    background: #f0fdf4;
    color: #15803d;
}

.js .auth-step {
    display: none;
}

.js .auth-step.active {
    display: block;
}

dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px 12px;
    margin: 0;
}

dt {
    color: var(--muted);
    font-weight: 600;
    font-size: 12.5px;
}

dd {
    margin: 0;
    font-weight: 600;
    color: var(--text);
}

.notice {
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid #86efac;
    border-radius: var(--radius);
    background: #f0fdf4;
    color: #166534;
    font-weight: 700;
    box-shadow: var(--shadow-xs);
}

.notice.soft {
    border-color: var(--line);
    background: #f8fafc;
    color: var(--text-secondary);
}

.notice.error {
    border-color: #fca5a5;
    background: #fef2f2;
    color: var(--danger);
}

.preline {
    white-space: pre-line;
}

/* Catalog Accordion */
.catalog-accordion {
    display: grid;
    gap: 12px;
}

.catalog-panel {
    padding: 0;
    overflow: hidden;
}

.catalog-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
    background: #f8fafc;
}

.catalog-panel summary::-webkit-details-marker {
    display: none;
}

.catalog-panel-body {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--line);
}

.catalog-inline-form {
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-soft);
}

.inline-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
}

/* Auth Stage */
.public-topbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    background: var(--brand-dark);
}

.public-topbar .brand,
.public-topbar .nav a {
    color: #ffffff;
}

.auth-stage {
    display: grid;
    grid-template-columns: minmax(300px, 420px) minmax(0, 520px);
    gap: 28px;
    align-items: stretch;
    justify-content: center;
    margin: 40px auto;
}

.auth-hero {
    position: relative;
    min-height: 440px;
    overflow: hidden;
    padding: 32px;
    border-radius: var(--radius-lg);
    background: var(--brand-dark) url("../img/avino-repair-dark.png") center/cover no-repeat;
    color: #ffffff;
    box-shadow: var(--shadow);
}

.auth-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(9, 13, 22, 0.95));
}

.auth-hero > * {
    position: relative;
    z-index: 1;
}

.auth-hero img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 80px;
    border-radius: 10px;
    background: #ffffff;
    padding: 5px;
}

.auth-hero h2 {
    color: #ffffff;
    font-size: 26px;
    line-height: 1.2;
    margin-bottom: 12px;
}

.auth-box {
    width: 100%;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.auth-box form {
    display: grid;
    gap: 14px;
}

.auth-box-wide {
    max-width: 720px;
}

.logo-preview {
    display: block;
    max-width: 180px;
    max-height: 90px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 8px;
}

/* Pagination */
nav[role="navigation"] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    margin-top: 12px;
    font-size: 12.5px;
    color: var(--muted);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

nav[role="navigation"] a,
nav[role="navigation"] span[aria-current="page"] span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    font-weight: 700;
}

nav[role="navigation"] span[aria-current="page"] span {
    background: var(--primary);
    color: #ffffff;
}

/* ==========================================================================
   11. RESPONSIVE & PRINT RULES
   ========================================================================== */
@media (max-width: 1024px) {
    .operational-inspector { display: none !important; }
    .operational-grid,
    .repair-workspace,
    .appointment-split-layout { grid-template-columns: 1fr !important; }
}

@media (max-width: 820px) {
    .app-shell { display: block; }
    body.menu-open { overflow: hidden; }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 40;
        width: min(86vw, 300px);
        transform: translateX(-104%);
        transition: transform 0.2s ease;
    }
    body.menu-open .sidebar { transform: translateX(0); }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 35;
        display: block;
        pointer-events: none;
        background: rgba(15, 23, 42, 0.5);
        opacity: 0;
        transition: opacity 0.2s ease;
    }
    body.menu-open .sidebar-backdrop {
        pointer-events: auto;
        opacity: 1;
    }
    .menu-toggle, .menu-close { display: inline-flex; }
    .topbar { padding: 10px 16px; }
    .topbar-left { flex: 1; min-width: 0; }
    .topbar-title { font-size: 14px; white-space: normal; line-height: 1.25; overflow: visible; }
    .topbar-search, .topbar-quick-actions { display: none !important; }
    .subnav-bar {
        padding: 6px 14px;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 6px;
    }
    .subnav-bar::-webkit-scrollbar { display: none; }
    .subnav-bar a { font-size: 12px; padding: 5px 10px; flex-shrink: 0; }
    .page { padding: 16px 14px 36px; }
    .form-grid,
    fieldset,
    .detail-grid,
    .repair-section-grid,
    .auth-stage { grid-template-columns: 1fr !important; }
    .repair-command { grid-template-columns: 1fr; }
}

/* ==========================================================================
   PRINT PREVIEW & A4 DOCUMENT SYSTEM (REPAIRS, ESTIMATES, BILLING)
   ========================================================================== */

/* Universal Logo Constraint: Prevents native giant logo rendering */
.print-logo {
    max-width: 160px !important;
    max-height: 52px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin-bottom: 6px;
}

/* Screen Preview Mode */
body.print-page {
    background-color: #eef2f6 !important;
}

body.print-page .app-main {
    padding: 16px 20px 48px !important;
    max-width: 100% !important;
}

.print-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 210mm;
    margin: 0 auto 18px;
    padding: 10px 18px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.print-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.print-toolbar-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #475569;
}

.print-toolbar-badge {
    background: #e2e8f0;
    color: #1e293b;
    font-weight: 700;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.04em;
}

/* A4 Sheet Container (Screen & Base) */
.print-sheet {
    width: 210mm;
    min-height: 297mm;
    max-width: 100%;
    margin: 0 auto 28px;
    padding: 11mm 13mm;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
    border: 1px solid #cbd5e1;
    box-sizing: border-box;
    color: #0f172a;
    font-size: 10.5px;
    line-height: 1.4;
}

/* Header Legacy Support */
.print-sheet header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0f172a;
}

/* New Modern Header */
.print-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0f172a;
    margin-bottom: 12px;
}

.print-sheet-header .company-col {
    flex: 1;
}

.print-sheet-header .company-name {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin: 2px 0 3px;
}

.print-sheet-header .company-meta {
    font-size: 9.5px;
    color: #475569;
    line-height: 1.4;
}

.print-sheet-header .doc-col {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.print-doc-badge {
    display: inline-block;
    background: #0f172a;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 4px;
}

.print-sheet-code {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.05em;
}

.print-qr-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.print-qr-wrap .qr-code {
    width: 60px;
    height: 60px;
    border: 1px solid #cbd5e1;
    padding: 2px;
    border-radius: 4px;
    background: #ffffff;
}

.print-qr-wrap .qr-desc {
    font-size: 8.5px;
    color: #64748b;
    text-align: right;
    line-height: 1.25;
    max-width: 90px;
}

/* Grid Legacy & Modern */
.print-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
    margin-bottom: 10px;
}

.print-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.print-card {
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #f8fafc;
    overflow: hidden;
}

.print-card-head {
    background: #e2e8f0;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1e293b;
    border-bottom: 1px solid #cbd5e1;
}

.print-card-body {
    padding: 6px 8px;
    font-size: 9.5px;
    line-height: 1.45;
}

.print-prop-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
}

.print-prop-label {
    color: #64748b;
    font-weight: 500;
    min-width: 80px;
}

.print-prop-value {
    color: #0f172a;
    font-weight: 600;
    text-align: right;
}

/* Section Box */
.print-section {
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
}

.print-section-head {
    background: #f1f5f9;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1e293b;
    border-bottom: 1px solid #cbd5e1;
}

.print-section-body {
    padding: 6px 8px;
    font-size: 9.5px;
    line-height: 1.4;
}

.print-box-highlight {
    background: #f8fafc;
    border-left: 3px solid #2563eb;
    padding: 5px 8px;
    border-radius: 0 4px 4px 0;
    margin-bottom: 5px;
}

.print-checklist-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}

.print-checklist-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 4px 6px;
}

/* Parts Table */
.print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
    font-size: 9.5px;
}

.print-table th {
    background: #f1f5f9;
    color: #1e293b;
    font-weight: 700;
    text-align: left;
    padding: 4px 6px;
    border-bottom: 1.5px solid #cbd5e1;
    text-transform: uppercase;
    font-size: 9px;
}

.print-table td {
    padding: 4px 6px;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
}

/* Financial Strip */
.print-financial-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.print-financial-box {
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 5px 8px;
    background: #f8fafc;
    text-align: center;
}

.print-financial-box.highlight {
    background: #eff6ff;
    border-color: #93c5fd;
}

.print-financial-label {
    font-size: 8.5px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.print-financial-value {
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
}

.print-financial-box.highlight .print-financial-value {
    color: #1d4ed8;
}

/* Legal Conditions (GDPR, Custodia, Garanzia) */
.print-legal-box {
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 5px 8px;
    background: #fcfcfc;
    margin-bottom: 10px;
}

.print-legal-title {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #334155;
    margin-bottom: 3px;
}

.print-legal-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 8px;
    line-height: 1.35;
    color: #64748b;
}

.print-legal-item strong {
    color: #334155;
}

/* Signatures */
.print-signatures-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 8px;
    page-break-inside: avoid;
}

.print-sig-frame {
    border: 1px dashed #94a3b8;
    border-radius: 5px;
    padding: 6px 8px;
    background: #fcfcfc;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.print-sig-label {
    font-size: 8.5px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 2px;
}

.print-sig-sub {
    font-size: 7.5px;
    color: #64748b;
    margin-bottom: 4px;
    line-height: 1.25;
}

.print-sig-line {
    border-top: 1px solid #334155;
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    font-size: 8px;
    color: #475569;
    padding-top: 2px;
}

.print-sig-img {
    max-height: 34px;
    max-width: 150px;
    object-fit: contain;
    margin: 2px 0;
}

/* Footer / Notice */
.print-sheet-footer {
    margin-top: 6px;
    text-align: center;
    font-size: 8px;
    color: #94a3b8;
    border-top: 1px solid #e2e8f0;
    padding-top: 3px;
}

/* Print Output Rules */
@media print {
    @page {
        size: A4 portrait;
        margin: 6mm 7mm;
    }

    html, body, body.print-page {
        background: #ffffff !important;
        color: #0f172a !important;
        font-size: 9.5px !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .topbar, .subnav-bar, .sidebar, .sidebar-backdrop, .button, .button-row, .nav, .tabs, .print-toolbar, .operational-inspector, .filters, footer {
        display: none !important;
    }

    .app-shell, .app-main, .page {
        display: block !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }

    .print-sheet {
        width: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        page-break-inside: avoid;
    }

    .print-copy {
        break-before: page !important;
        page-break-before: always !important;
        margin-top: 0 !important;
        padding-top: 4mm !important;
    }
}

/* ==========================================================================
   SMART LAB UI — BASE HELPERS (Replaced Legacy v4.0 / v5 Blocks)
   ========================================================================== */
:root {
    --v5-radius: 12px;
    --v5-field-h: 38px;
    --v5-line: #dbe3ef;
    --v5-ink: #0f172a;
    --v5-muted: #64748b;
    --v5-soft: #f8fafc;
    --v5-focus: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

td, th, .metric-grid strong, .compact-metrics strong, .repair-kpi-row strong, .pos-summary strong, .kpi-val, .month-strip strong, .status, .warranty-badge, .label-code, input[type="number"] {
    font-variant-numeric: tabular-nums;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

input[type="file"] {
    width: 100%;
    padding: 6px;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    background: var(--panel-soft);
    font-size: 12.5px;
    color: var(--muted);
    cursor: pointer;
}
input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 6px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--panel);
    color: var(--text);
    font: 600 12.5px/1 Inter, system-ui, sans-serif;
    cursor: pointer;
}
input[type="file"]:hover { border-color: var(--primary); }

label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}
.filters label:has(> input[type="checkbox"]),
.filters label:has(input[type="checkbox"]) {
    align-self: flex-end;
    min-height: 38px;
    padding-bottom: 0 !important;
    margin: 0;
}
.filters input:where(:not([type="checkbox"]):not([type="radio"])),
.filters select,
.filters .button {
    min-height: 38px;
    height: 38px;
}
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; accent-color: var(--primary); }

.form-grid:not(.compact-form) > .form-actions,
.form-actionbar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(8px);
            backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
}
.compact-form .form-actions {
    position: static;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 4px 0 0;
}

.repair-quick-nav {
    position: sticky;
    top: 0;
    z-index: 15;
    padding: 8px 0;
    background: linear-gradient(var(--bg) 70%, transparent);
}
.repair-quick-nav .button { border-radius: 999px; font-weight: 600; }

/* Collegamenti (v5) */
.integration-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.integration-card { display: flex; flex-direction: column; gap: 12px; }
.integration-card .section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.integration-card h2 { font-size: 16px; margin: 0; }
.integration-fields { display: flex; flex-direction: column; gap: 10px; }

/* Ricerca negli elenchi lunghi */
.select-search { margin-bottom: 6px; }
.select-search-count:empty { display: none; }

/* ===== Vendita al banco: carrello a sinistra, pagamento sempre visibile a destra ===== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.pos-cart { padding: 18px; min-height: 420px; }
.pos-search { position: relative; margin-bottom: 14px; }
.pos-search input { width: 100%; font-size: 16px; font-weight: 600; min-height: 48px; }
.pos-results { position: absolute; z-index: 30; left: 0; right: 0; top: 52px; margin: 0; padding: 4px; list-style: none; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 360px; overflow-y: auto; }
.pos-results li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name price" "meta price"; gap: 2px 12px; padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.pos-results li span { grid-area: name; font-weight: 600; }
.pos-results li small { grid-area: meta; color: var(--muted); }
.pos-results li strong { grid-area: price; align-self: center; font-variant-numeric: tabular-nums; }
.pos-results li.is-active, .pos-results li:hover { background: var(--panel-soft); }
.pos-results li.is-out { opacity: .55; }
.pos-lines { display: flex; flex-direction: column; gap: 8px; }
.pos-empty { margin: 0; padding: 48px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.pos-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 110px 100px 36px; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.pos-line.is-short { border-color: var(--danger); }
.pos-line.is-short small { color: var(--danger); }
.pos-line-name { display: flex; flex-direction: column; min-width: 0; }
.pos-line-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-line-name small { color: var(--muted); }
.pos-qty { display: flex; align-items: center; gap: 4px; }
.pos-qty input { width: 56px; text-align: center; }
.pos-qty-btn, .pos-remove { width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--panel-soft); font-size: 18px; line-height: 1; cursor: pointer; color: var(--text); }
.pos-remove { border-color: transparent; background: transparent; color: var(--muted); font-size: 22px; }
.pos-remove:hover { color: var(--danger); }
.pos-price input { width: 100%; text-align: right; }
.pos-line-total { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos-checkout { position: sticky; top: 84px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.pos-total { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius); background: var(--brand-dark, #0f172a); color: #fff; }
.pos-total span { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.pos-total strong { font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pos-total small { opacity: .75; }
.pos-methods { display: flex; flex-direction: column; gap: 6px; }
.pos-methods-title { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.pos-method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pos-method-grid .pos-method { position: relative; display: block; width: 100%; }
.pos-method input { position: absolute; opacity: 0; }
.pos-method span { width: 100%; box-sizing: border-box; display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 6px 8px; text-align: center; font-size: 13px; font-weight: 600; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; background: var(--panel); }
.pos-method input:checked + span { border-color: var(--primary); background: var(--primary); color: #fff; }
.pos-method input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.pos-cash[hidden] { display: none; }
.pos-quick-cash { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pos-change { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--panel-soft); }
.pos-change strong { font-size: 20px; font-variant-numeric: tabular-nums; color: var(--success); }
.pos-change.is-missing strong { color: var(--danger); }
.pos-submit { min-height: 52px; font-size: 16px; }
.pos-submit:disabled { opacity: .5; cursor: not-allowed; }
.pos-paybar { display: none; }
@media (max-width: 1024px) {
    .pos-layout { grid-template-columns: 1fr; }
    .pos-checkout { position: static; }
    .pos-paybar { display: flex; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--panel); border-top: 1px solid var(--line-strong); box-shadow: 0 -4px 16px rgba(15, 23, 42, .08); }
    .pos-paybar div { display: flex; flex-direction: column; }
    .pos-paybar span { font-size: 12px; color: var(--muted); }
    .pos-paybar strong { font-size: 20px; }
    .pos-layout { padding-bottom: 72px; }
}
@media (max-width: 640px) {
    .pos-line { grid-template-columns: minmax(0, 1fr) 36px; grid-template-areas: "name remove" "qty total" "price price"; }
    .pos-line-name { grid-area: name; }
    .pos-remove { grid-area: remove; }
    .pos-qty { grid-area: qty; }
    .pos-line-total { grid-area: total; }
    .pos-price { grid-area: price; display: flex; flex-direction: row; align-items: center; gap: 8px; }
    .pos-price::before { content: "Prezzo €"; font-size: 12px; color: var(--muted); white-space: nowrap; }
}

/* ===== Preventivo da firmare sul telefono ===== */
.sign-page { max-width: 640px; margin: 8px auto 40px; display: flex; flex-direction: column; gap: 14px; }
.sign-head h1 { margin: 2px 0 4px; font-size: 26px; }
.sign-head p { margin: 0; }
.sign-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.sign-card h2 { margin: 0; font-size: 18px; }
.sign-request p { margin: 6px 0 0; }
.sign-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sign-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sign-lines strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sign-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 4px; }
.sign-total strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.sign-terms summary, .sign-reject summary { cursor: pointer; font-weight: 600; }
.sign-pad { display: flex; flex-direction: column; gap: 6px; }
.sign-pad-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.sign-pad canvas { width: 100%; height: 180px; border: 2px dashed var(--line-strong); border-radius: var(--radius); background: #fff; touch-action: none; cursor: crosshair; }
.checkbox-line { flex-direction: row !important; align-items: center; gap: 10px !important; font-size: 14px; color: var(--text); }
.sign-submit { min-height: 52px; font-size: 16px; }
.sign-foot { text-align: center; font-size: 12px; }

.copy-row { display: flex; gap: 8px; flex-wrap: wrap; }
.copy-row input { flex: 1; min-width: 220px; font-family: var(--font-mono); font-size: 13px; }
.sign-image { max-width: 360px; width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.success-text { color: var(--success); font-weight: 600; }

/* ==========================================================================
   AVINO HI-TECH — SMART, SIMPLE & INTUITIVE UI DESIGN SYSTEM (v6.0)
   Risolve tutti i conflitti di layout, tabelle, moduli, paginazione e stampa
   ========================================================================== */

/* 1. IMPOSTAZIONI & FIELDSET: Mai più testo tagliato sotto <legend> */
fieldset.settings-group {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--v5-radius, 12px);
    padding: 54px 18px 18px !important;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    background: var(--panel-soft, #f8fafc);
}
fieldset.settings-group > legend {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 11px 18px;
    font-weight: 700;
    font-size: 13.5px;
    border-bottom: 1px solid var(--line);
    background: var(--panel, #ffffff);
    border-radius: var(--v5-radius, 12px) var(--v5-radius, 12px) 0 0;
}
.settings-group .checkbox-line {
    grid-column: 1 / -1;
}
.booking-days {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    align-items: center;
    padding: 10px 14px;
    background: var(--panel, #ffffff);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.booking-days .checkbox-line {
    grid-column: auto !important;
    width: auto !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center;
    gap: 6px !important;
    font-weight: 600;
    font-size: 13px;
}

/* 2. CAMPI NUMERICI: Allineati a sinistra nei form normali, a destra solo in tabelle/prezzi POS */
input[type="number"] {
    text-align: left;
    font-variant-numeric: tabular-nums;
}
td input[type="number"],
.pos-price input[type="number"],
.pos-qty input[type="number"] {
    text-align: right;
}
.pos-qty input[type="number"] {
    text-align: center;
}

/* 3. INLINE FORMS & CATALOGHI: Righe orizzontali compatte (mai più blocchi verticali da 140px) */
.panel.catalog-panel {
    padding: 0 !important;
    overflow: hidden;
}
.catalog-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 12px 20px !important;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    list-style: none;
    transition: background-color 0.15s ease;
}
.catalog-panel summary::after {
    content: "Apri lista ▾";
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel);
}
.catalog-panel[open] summary::after {
    content: "Chiudi ▴";
    color: var(--primary);
    border-color: rgba(59, 130, 246, 0.35);
}
.inline-form {
    display: flex !important;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 14px;
}
.inline-form > label {
    flex: 1 1 180px;
    min-width: 140px;
    margin: 0;
}
.inline-form > input[type="search"],
.inline-form > input:not([type="hidden"]) {
    flex: 1 1 220px;
    min-width: 160px;
}
.inline-form > .button,
.inline-form > button {
    flex: 0 0 auto;
    height: var(--v5-field-h, 42px);
}
span.inline-form {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.catalog-summary-left {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.catalog-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--primary-light, #e8f0fe);
    color: var(--primary, #1d6bff);
    font-size: 12px;
    font-weight: 700;
}
.catalog-add-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
    background: var(--panel-soft, #f8fafc);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.catalog-add-field {
    flex: 1 1 160px;
    min-width: 135px;
}
.catalog-add-field label {
    margin: 0;
}
.catalog-add-bar > .button {
    height: 40px;
    min-height: 40px;
    padding: 0 18px;
    flex: 0 0 auto;
}
.catalog-table td {
    padding: 8px 12px !important;
    vertical-align: middle;
}
.catalog-row-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    width: 100%;
}
.catalog-row-input {
    flex: 1 1 180px;
    min-width: 130px;
    min-height: 36px !important;
    height: 36px !important;
    padding: 4px 10px !important;
    font-size: 13.5px !important;
    border-radius: 8px !important;
}
.catalog-row-select {
    flex: 0 1 160px;
    min-width: 120px;
    min-height: 36px !important;
    height: 36px !important;
    padding: 4px 8px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
}
.catalog-row-form .button.small {
    min-height: 36px;
    height: 36px;
    padding: 0 14px;
    font-size: 12.5px;
    flex: 0 0 auto;
}

/* 4. PAGINAZIONE ITALIANA NATIVA & PROTEZIONE SVG GIGANTI */
nav[role="navigation"] svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    display: inline-block;
    vertical-align: middle;
}
.rl-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--panel, #ffffff);
    border: 1px solid var(--line);
    border-radius: 12px;
}
.rl-page-info {
    font-size: 13px;
    color: var(--muted);
}
.rl-page-info strong {
    color: var(--text);
    font-weight: 700;
}
.rl-page-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}
.rl-page-btn,
.rl-page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--panel, #ffffff);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}
.rl-page-num {
    padding: 0 8px;
}
.rl-page-btn:hover:not(.is-disabled),
.rl-page-num:hover:not(.is-active) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--panel-soft);
}
.rl-page-num.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}
.rl-page-btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: var(--panel-soft);
}
.rl-page-ellipsis {
    padding: 0 6px;
    color: var(--muted);
    font-weight: 600;
}

/* 5. BARRA FILTRI UNIFICATA (.filters & .filter-bar) */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 16px;
    padding: 16px 18px;
    background: var(--panel, #ffffff);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg, 14px);
}
.filter-bar label {
    flex: 1 1 180px;
    min-width: 140px;
}
.filter-bar .button {
    width: auto;
    min-width: 88px;
    height: var(--v5-field-h, 42px);
}

/* 6. TABELLE & INSPECTOR: Niente più parole spezzate a metà (Ricevut/a, Diagno/si) né righe spezzate su td.actions */
td.actions {
    display: table-cell !important;
    text-align: right;
    vertical-align: middle !important;
    white-space: nowrap !important;
}
td.actions form {
    display: inline-block;
    margin: 0;
}
td:not(.actions):not(.right):not(.nowrap) {
    word-break: normal !important;
    overflow-wrap: break-word;
}
.nowrap,
td.nowrap,
th.nowrap,
.table-wrap td:first-child:not(.actions):not(.right):not(.nowrap),
.table-wrap .status,
.table-wrap .role,
.table-wrap .badge {
    white-space: nowrap !important;
    word-break: normal !important;
}
.operational-grid {
    align-items: start;
    grid-template-columns: minmax(0, 1fr) 320px;
}
.inspector-fields {
    grid-template-columns: 94px minmax(0, 1fr);
}
.inspector-actions .button {
    flex: 1 1 auto;
}

/* 7. SUBNAV BAR: Tab moderne e leggere (niente pillole nere giganti) */
.subnav-bar a {
    white-space: nowrap;
    border-radius: 8px;
    padding: 6px 13px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid transparent;
    transition: all 0.15s ease;
}
.subnav-bar a:hover {
    background: var(--panel-soft);
    color: var(--text);
}
.subnav-bar a.active {
    background: var(--primary-light, #e8f0fe) !important;
    color: var(--primary, #1d6bff) !important;
    border-color: rgba(29, 107, 255, 0.24);
}

/* 8. KPI CARDS CON ACCENTO SEMANTICO */
.metric-grid article.kpi-accent-blue { border-top: 3px solid #2563eb; }
.metric-grid article.kpi-accent-emerald { border-top: 3px solid #10b981; }
.metric-grid article.kpi-accent-indigo { border-top: 3px solid #6366f1; }
.metric-grid article.kpi-accent-amber { border-top: 3px solid #f59e0b; }

/* 9. KANBAN LABORATORIO: Colonne con altezza viewport, scroll interno e codice colore per stato */
.kanban-board {
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: minmax(255px, 1fr);
    gap: 12px;
    overflow-x: auto;
    align-items: stretch;
    padding-bottom: 10px;
}
.kanban-column {
    padding: 12px !important;
    background: var(--panel-soft, #f1f5f9);
    border-top: 3px solid #94a3b8;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 215px);
    min-height: 360px;
    overflow: hidden;
}
.kanban-column-head {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}
.kanban-column-head h2 {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13.5px !important;
    font-weight: 700;
    margin: 0;
}
.kanban-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    display: inline-block;
}
.kanban-column[data-column-state*="ingresso"] { border-top-color: #3b82f6; }
.kanban-column[data-column-state*="ingresso"] .kanban-dot { background: #3b82f6; }
.kanban-column[data-column-state*="lavorazione"] { border-top-color: #6366f1; }
.kanban-column[data-column-state*="lavorazione"] .kanban-dot { background: #6366f1; }
.kanban-column[data-column-state*="attesa"] { border-top-color: #f59e0b; }
.kanban-column[data-column-state*="attesa"] .kanban-dot { background: #f59e0b; }
.kanban-column[data-column-state*="pront"] { border-top-color: #10b981; }
.kanban-column[data-column-state*="pront"] .kanban-dot { background: #10b981; }
.kanban-column[data-column-state*="consegnat"] { border-top-color: #64748b; }
.kanban-column[data-column-state*="consegnat"] .kanban-dot { background: #64748b; }
.kanban-list {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 285px);
    min-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}
.kanban-list::-webkit-scrollbar {
    width: 6px;
}
.kanban-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.45);
    border-radius: 999px;
}
.repair-kanban-card {
    padding: 10px 12px !important;
    gap: 5px !important;
    flex-shrink: 0;
}
.repair-kanban-card .kanban-status-select {
    font-size: 11.5px;
    padding: 4px 8px;
    height: auto;
}

/* 10. AGENDA & APPUNTAMENTI: Form a 2 colonne compatto mai tagliato in basso */
.appointment-split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    gap: 20px;
    align-items: start;
}
.appointment-form-panel {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.appointment-compact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.appointment-compact-grid > * {
    min-width: 0;
    max-width: 100%;
}
.appointment-compact-grid .span-2 {
    grid-column: 1 / -1;
}
.appointment-compact-grid input,
.appointment-compact-grid select,
.appointment-compact-grid textarea,
.appointment-compact-grid .button,
.appointment-compact-grid .btn {
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
    box-sizing: border-box;
}
.appointment-compact-grid input,
.appointment-compact-grid select {
    min-height: 38px !important;
    height: 38px !important;
    font-size: 13px !important;
    padding: 4px 10px !important;
}
.appointment-compact-grid input[type="datetime-local"] {
    font-size: 12px !important;
    padding: 4px 8px !important;
}
.appointment-compact-grid textarea {
    min-height: 58px !important;
    font-size: 13px !important;
}
.appointment-status-select {
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 4px 8px !important;
    min-height: 30px !important;
    height: 30px !important;
    border-radius: 6px !important;
    border: 1px solid var(--line);
    cursor: pointer;
}
.appointment-status-select.is-done { background: #dcfce7; color: #166534; }
.appointment-status-select.is-cancelled { background: #fee2e2; color: #991b1b; }
.appointment-status-select.is-requested { background: #fef3c7; color: #92400e; }
.appointment-status-select.is-scheduled { background: #e0f2fe; color: #0369a1; }
@media (max-width: 1100px) {
    .appointment-split-layout {
        grid-template-columns: 1fr;
    }
}

/* 11. COLLEGAMENTI & INTEGRAZIONI: Card allineate in alto senza buchi bianchi da 600px */
.integration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 18px;
    align-items: start !important;
}
.integration-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.integration-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.integration-fields.is-multi-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px 12px;
}
.integration-fields.is-multi-col .integration-help {
    grid-column: 1 / -1;
    margin: 0;
}
.integration-fields[hidden],
[data-provider-fields][hidden] {
    display: none !important;
}

/* 12. BUONO REGALO / GIFT CARD STAMPABILE */
.gift-voucher-card {
    max-width: 680px;
    margin: 12px auto 28px;
    padding: 24px 28px;
    background: #ffffff !important;
    color: #0f172a !important;
    border: 2px dashed #94a3b8;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
}
.gift-voucher-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1.5px solid #e2e8f0;
}
.gift-voucher-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.gift-voucher-logo {
    max-width: 110px;
    max-height: 44px;
    object-fit: contain;
}
.gift-voucher-eyebrow {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #2563eb;
    text-transform: uppercase;
}
.gift-voucher-shop {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}
.gift-voucher-amount-box {
    text-align: right;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 8px 16px;
    border-radius: 12px;
}
.gift-voucher-amount-label {
    display: block;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #1d4ed8;
}
.gift-voucher-card .gift-amount {
    font-size: 32px;
    font-weight: 800;
    color: #1e3a8a;
    line-height: 1.1;
    margin: 2px 0 0;
}
.gift-voucher-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px 0;
}
.gift-voucher-details {
    flex: 1;
}
.gift-voucher-recipient {
    font-size: 14px;
    margin-bottom: 8px;
    color: #334155;
}
.gift-voucher-recipient strong {
    font-size: 16px;
    color: #0f172a;
}
.gift-voucher-message {
    font-style: italic;
    color: #475569;
    margin: 0 0 12px;
    font-size: 13px;
}
.gift-voucher-code-box {
    display: inline-block;
    padding: 8px 14px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}
.gift-voucher-code-box span {
    display: block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #64748b;
}
.gift-voucher-card .gift-code {
    font-size: 20px;
    letter-spacing: 0.1em;
    font-weight: 800;
    color: #0f172a;
}
.gift-voucher-qr {
    text-align: center;
}
.gift-voucher-qr .qr-code {
    width: 96px;
    height: 96px;
    border: 1px solid #cbd5e1;
    padding: 4px;
    background: #ffffff;
    border-radius: 8px;
}
.gift-voucher-qr small {
    display: block;
    font-size: 10px;
    color: #64748b;
    margin-top: 4px;
}
.gift-voucher-footer {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    font-size: 11px;
    color: #64748b;
}
.mono { font-family: var(--font-mono, ui-monospace, monospace); }
body.print-page .notice {
    display: none !important;
}
.print-sheet .print-table th {
    font-size: 9px !important;
    padding: 5px 8px !important;
    line-height: 1.25 !important;
}
.print-sheet .print-table td {
    font-size: 10px !important;
    padding: 6px 8px !important;
    line-height: 1.35 !important;
}
.print-sheet .print-table td strong {
    font-size: 10.5px !important;
}
.print-sheet .muted {
    font-size: 9.5px !important;
}
@media print {
    .notice, .no-print, .print-toolbar, .sidebar, .topbar, .subnav-bar, .operational-commandbar { display: none !important; }
    .gift-voucher-card { margin: 0 auto; box-shadow: none; }
}

/* ==========================================================================
   13. SMART LAB UI — CORE DESIGN SYSTEM COMPONENTS (BLOCCO 1)
   Toast, Loading Feedback, Kbd Shortcut, Hero Assets, Empty States & Primitives
   ========================================================================== */

/* 13.1 Topbar Search Keyboard Badge (Ctrl K) */
.topbar-search form {
    position: relative;
}
.topbar-search input[type="search"] {
    padding-right: 68px !important;
}
.search-kbd {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    pointer-events: none;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.05);
}
@media (max-width: 768px) {
    .search-kbd { display: none; }
}

/* 13.2 Smart Toast & Notice Banner System */
.notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: var(--radius-lg, 12px);
    border: 1px solid #a7f3d0;
    border-left: 4px solid var(--success, #059669);
    background: #ecfdf5;
    color: #065f46;
    font-weight: 600;
    font-size: 13.5px;
    box-shadow: var(--shadow-sm);
    transition: opacity 0.22s ease, transform 0.22s ease;
}
.notice.warning {
    background: #fffbeb;
    border-color: #fde68a;
    border-left-color: var(--warning, #d97706);
    color: #92400e;
}
.notice.danger,
.notice.error {
    background: #fef2f2;
    border-color: #fecaca;
    border-left-color: var(--danger, #dc2626);
    color: #991b1b;
}
.notice.is-dismissing {
    opacity: 0;
    transform: translateY(-6px);
}
.notice-body {
    flex: 1;
}
.notice-close {
    background: transparent;
    border: none;
    color: currentColor;
    opacity: 0.65;
    font-size: 20px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}
.notice-close:hover {
    opacity: 1;
    background: rgba(15, 23, 42, 0.07);
}

/* 13.3 Submit Loading Feedback */
@keyframes rl-spin {
    to { transform: rotate(360deg); }
}
.button.is-loading,
button.is-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.88;
}
.button.is-loading::after,
button.is-loading::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: rl-spin 0.65s linear infinite;
    vertical-align: middle;
}

/* 13.4 Nano Banana Pro Visual Containers (100% Light & Dark Mode Compatible) */
.auth-split-shell {
    max-width: 960px;
    margin: 24px auto;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.auth-visual-pane {
    position: relative;
    background: linear-gradient(145deg, #090d16 0%, #0f172a 55%, #1e293b 100%);
    color: #f8fafc;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}
.auth-visual-media {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    margin: 16px 0;
}
.auth-visual-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.35);
    width: fit-content;
}
.auth-visual-pane h2 {
    margin: 10px 0 6px;
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
}
.auth-visual-pane p {
    margin: 0;
    font-size: 13.5px;
    color: #94a3b8;
    line-height: 1.5;
}
.auth-visual-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.auth-visual-badges span {
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}
.auth-form-pane {
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
@media (max-width: 820px) {
    .auth-split-shell {
        grid-template-columns: 1fr;
    }
    .auth-visual-pane {
        padding: 22px 20px;
    }
    .auth-visual-media {
        max-height: 180px;
    }
}

.feature-hero-banner {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    align-items: center;
    gap: 20px;
    padding: 22px 26px;
    margin-bottom: 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, #090d16 0%, #0f172a 60%, #1e293b 100%);
    color: #f8fafc;
    border: 1px solid #1e293b;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.feature-hero-banner h2 {
    margin: 6px 0 8px;
    font-size: 21px;
    font-weight: 800;
    color: #ffffff;
}
.feature-hero-banner p {
    margin: 0;
    color: #94a3b8;
    font-size: 13.5px;
}
.feature-hero-banner img {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.28);
}
@media (max-width: 768px) {
    .feature-hero-banner {
        grid-template-columns: 1fr;
    }
}

.smart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 28px 18px;
    gap: 8px;
    color: var(--muted);
}
.smart-empty-thumb {
    width: 68px;
    height: 68px;
    border-radius: 16px;
    object-fit: cover;
    background: #0f172a;
    border: 1px solid rgba(59, 130, 246, 0.25);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.14);
    margin-bottom: 4px;
}
.smart-empty-state strong {
    color: var(--text);
    font-size: 14.5px;
    font-weight: 700;
}
.smart-empty-state span {
    font-size: 13px;
    max-width: 420px;
}

/* 13.5 Smart Workspace Primitives (Avatar, Stock Pill, Live Margin, Stepper) */
.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light, #eff6ff);
    color: var(--primary, #2563eb);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    border: 1px solid rgba(37, 99, 235, 0.2);
}
.repair-workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr);
    gap: 18px;
    align-items: start;
}
.repair-workspace-col {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}
@media (max-width: 1120px) {
    .repair-workspace-grid {
        grid-template-columns: 1fr;
    }
}
.live-margin-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    font-size: 13px;
}
.live-margin-strip strong {
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}
.tracking-stepper {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0;
}
.tracking-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 10px 6px;
    border-radius: 10px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}
.tracking-step.is-done {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}
.tracking-step.is-current {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 700;
}
@media (max-width: 640px) {
    .tracking-stepper {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   14. SMART LAB UI v7 — MODERN SAAS VISUAL ENGINE (LIGHT & CORE)
   ========================================================================== */

:root {
    --bg: #eef2f7;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --panel-elevated: #f1f5f9;
    --input-bg: #ffffff;
    --line: #dbe3ef;
    --line-strong: #cbd5e1;
    --text: #0f172a;
    --text-secondary: #334155;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
    --shadow-soft: 0 4px 12px -2px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow: 0 14px 28px -6px rgba(15, 23, 42, 0.1), 0 6px 12px -4px rgba(15, 23, 42, 0.05);
}

/* 14.1 Refined App Shell, Sidebar & Topbar */
.sidebar {
    background: linear-gradient(180deg, #060a12 0%, #0b1324 55%, #0f172a 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 4px 0 20px rgba(2, 6, 23, 0.18);
}
.sidebar .side-nav a {
    position: relative;
    min-height: 37px;
    padding: 7px 11px;
    margin: 1px 4px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    border: 1px solid transparent;
    transition: all 0.16s ease;
}
.sidebar .side-nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f8fafc;
}
.sidebar .side-nav a.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.28) 0%, rgba(37, 99, 235, 0.08) 100%);
    border-color: rgba(59, 130, 246, 0.34);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.3);
}
.sidebar .side-nav a.active svg {
    color: #60a5fa;
    opacity: 1;
}
.sidebar .side-nav a.active::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 7px;
    bottom: 7px;
    width: 3.5px;
    border-radius: 0 4px 4px 0;
    background: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.8);
}

.topbar {
    min-height: 58px;
    padding: 8px 24px;
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(12px);
            backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}
.topbar-search input[type="search"] {
    height: 38px;
    min-height: 38px;
    border-radius: 999px !important;
    background: var(--panel-soft);
    border: 1px solid var(--line-strong);
    padding-left: 38px;
    font-size: 13px;
    transition: all 0.16s ease;
}
.topbar-search input[type="search"]:focus {
    background: var(--panel);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.button.primary,
button.button.primary,
.topbar-quick-actions .quick-btn.primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-color: #1d4ed8;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.button.primary:hover,
button.button.primary:hover,
.topbar-quick-actions .quick-btn.primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}
.button.small {
    min-height: 31px !important;
    height: 31px !important;
    padding: 0 11px !important;
    font-size: 12px !important;
    border-radius: 7px !important;
}
.whatsapp-btn {
    background: #16a34a !important;
    border-color: #15803d !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}
.whatsapp-btn:hover {
    background: #15803d !important;
}

/* 14.2 Elevated Panels & Bento KPI Grid */
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    padding: 20px 22px;
}

.metric-grid article,
.compact-metrics article,
.repair-kpi-row article,
.pos-summary article {
    position: relative;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--panel);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.metric-grid article:hover,
.compact-metrics article:hover,
.repair-kpi-row article:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
    border-color: var(--line-strong);
}
.metric-grid article::before,
.compact-metrics article::before,
.repair-kpi-row article::before {
    content: "" !important;
    display: block !important;
    position: absolute;
    inset: 0 0 auto 0 !important;
    width: 100% !important;
    height: 3.5px !important;
    background: var(--primary);
}
.metric-grid article:nth-child(2)::before,
.compact-metrics article:nth-child(2)::before,
.repair-kpi-row article:nth-child(2)::before {
    background: #10b981;
}
.metric-grid article:nth-child(3)::before,
.compact-metrics article:nth-child(3)::before,
.repair-kpi-row article:nth-child(3)::before {
    background: #f59e0b;
}
.metric-grid article:nth-child(4)::before,
.compact-metrics article:nth-child(4)::before,
.repair-kpi-row article:nth-child(4)::before {
    background: #6366f1;
}
.metric-grid article:nth-child(5)::before,
.compact-metrics article:nth-child(5)::before,
.repair-kpi-row article:nth-child(5)::before {
    background: #ec4899;
}
.metric-grid article.is-alert::before {
    background: var(--danger) !important;
}

/* Inventory KPI Bar -> Full Bento KPI Grid */
.inventory-kpi-bar {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)) !important;
    gap: 12px !important;
    margin-bottom: 18px !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.inventory-kpi-bar .kpi-item {
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 6px !important;
    padding: 14px 16px !important;
    background: var(--panel) !important;
    border: 1px solid var(--line) !important;
    border-radius: 13px !important;
    box-shadow: var(--shadow-sm) !important;
    overflow: hidden;
}
.inventory-kpi-bar .kpi-item::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3.5px;
    background: var(--primary);
}
.inventory-kpi-bar .kpi-item:nth-child(2)::before { background: #f59e0b; }
.inventory-kpi-bar .kpi-item:nth-child(3)::before { background: #6366f1; }
.inventory-kpi-bar .kpi-item:nth-child(4)::before { background: #0ea5e9; }
.inventory-kpi-bar .kpi-item:nth-child(5)::before { background: #8b5cf6; }
.inventory-kpi-bar .kpi-item.kpi-success::before { background: #10b981; }
.inventory-kpi-bar .kpi-label {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--muted) !important;
}
.inventory-kpi-bar .kpi-val {
    font-size: 21px !important;
    font-weight: 800 !important;
    color: var(--text) !important;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* Dashboard Month Strip -> Modern Bento Cards */
.month-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 0 0 22px;
    background: transparent;
    border-radius: 0;
    overflow: visible;
}
.month-strip > div {
    padding: 15px 18px;
    border-radius: 13px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.month-strip span {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.month-strip strong {
    color: #ffffff;
    font-size: 21px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* 14.3 Redesigned 2-Tier Repair Command Header (Fixes media_1795130229376_dfa8d543.png) */
.repair-command {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    margin-bottom: 18px;
    padding: 20px 24px !important;
    border: 1px solid var(--line) !important;
    border-top: 3.5px solid var(--primary) !important;
    border-radius: 14px !important;
    background: var(--panel) !important;
    box-shadow: var(--shadow-sm) !important;
}
.repair-command-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.repair-command-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 240px;
}
.repair-command-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.repair-command-heading h1 {
    font-size: 24px !important;
    font-weight: 800 !important;
    margin: 0 !important;
    letter-spacing: -0.02em;
}
.repair-command-main .repair-badges {
    margin-top: 0 !important;
}
.repair-command-main p {
    margin: 2px 0 0;
    font-size: 13.5px;
    color: var(--text-secondary);
    font-weight: 600;
}
.repair-command-primary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.repair-status-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}
.repair-status-select {
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 32px 0 12px !important;
    border-radius: 9px !important;
    border: 1.5px solid var(--primary) !important;
    background-color: var(--input-bg) !important;
    color: var(--text) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08);
}
.repair-status-select option,
.kanban-status-select option {
    background-color: var(--panel);
    color: var(--text);
}
.kanban-status-select {
    width: 100%;
    height: 30px !important;
    min-height: 30px !important;
    padding: 0 26px 0 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border-radius: 7px !important;
    background-color: var(--input-bg) !important;
    color: var(--text) !important;
    border: 1px solid var(--line-strong) !important;
    cursor: pointer;
}
.repair-command-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}
.repair-toolbar-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.repair-toolbar-group form {
    display: inline-flex;
    margin: 0;
}
.repair-toolbar-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-right: 4px;
}
.repair-toolbar-end {
    margin-left: auto;
}

/* 14.4 Full-Width Data Tables & On-Demand Slide-In Inspector */
.operational-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px;
    align-items: start;
}
.operational-grid .operational-inspector {
    display: none !important;
}
.operational-grid.is-inspector-open {
    grid-template-columns: minmax(0, 1fr) 330px !important;
}
.operational-grid.is-inspector-open .operational-inspector {
    display: flex !important;
    flex-direction: column;
}
@media (max-width: 1180px) {
    .operational-grid.is-inspector-open {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}
.inspector-head {
    position: relative;
}
.inspector-close-btn {
    width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.inspector-close-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
}

/* Table Headers & Rows Polish + Sticky Headers */
.table-wrap {
    border-radius: 13px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    background: var(--panel);
    overflow-x: auto;
}
.table-wrap table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}
table th,
.table-wrap table th {
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 11px 14px;
    border-bottom: 1.5px solid var(--line-strong);
    white-space: nowrap;
}
table td,
.table-wrap table td {
    padding: 11px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.table-wrap tbody tr:hover {
    background: #f8fafc;
}
.table-wrap td:last-child a,
.table-wrap td:last-child .link-button {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    margin: 2px 0 2px 3px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    background: var(--panel-soft);
    color: var(--text);
    transition: all 0.14s ease;
}
.table-wrap td:last-child a:hover,
.table-wrap td:last-child .link-button:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

/* 14.5 Thermal Stickers & Label Sheets (Inventory & Repairs Labels) */
.label-print-toolbar {
    max-width: 920px;
    flex-wrap: wrap;
}
.label-sheet {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
    max-width: 920px;
    margin: 24px auto;
}
.label-print,
.label-print.professional-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 390px;
    min-height: 172px;
    padding: 18px 20px;
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.label-sheet.label-format-40x30 .label-print {
    width: 310px;
    min-height: 145px;
    padding: 14px 16px;
}
.label-sheet.label-format-60x40 .label-print {
    width: 390px;
    min-height: 175px;
    padding: 18px 20px;
}
.label-sheet.label-format-100x150 .label-print {
    width: 450px;
    min-height: 230px;
    padding: 22px 24px;
}
.label-sheet.label-format-a4 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 210mm;
    background: #ffffff !important;
    padding: 14mm;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    gap: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.label-sheet.label-format-a4 .label-print {
    width: 100%;
    min-height: 145px;
    box-shadow: none;
    border: 1px dashed #94a3b8 !important;
}
.label-print > div,
.label-print-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    flex: 1;
    min-width: 0;
}
.label-eyebrow {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2563eb !important;
}
.label-print strong {
    font-size: 14.5px;
    font-weight: 800;
    color: #0f172a !important;
    line-height: 1.25;
    word-break: break-word;
}
.label-print span:not(.label-code):not(.label-eyebrow) {
    font-size: 12.5px;
    font-weight: 600;
    color: #334155 !important;
}
.label-print .label-price {
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin-top: 2px;
}
.label-print .label-code {
    display: inline-block;
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #94a3b8 !important;
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 5px;
    letter-spacing: 0.03em;
}
.label-print .qr-code {
    width: 96px;
    height: 96px;
    object-fit: contain;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px;
    background: #ffffff !important;
}

/* 14.6 Balanced 2-Column Integrations Grid (Zero Empty Voids & No Squished Badges) */
.integration-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px;
    align-items: stretch !important;
}
@media (max-width: 960px) {
    .integration-grid {
        grid-template-columns: 1fr !important;
    }
}
.integration-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.integration-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.integration-card-head h2 {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.3;
}
.integration-card-head .status {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}
.integration-fields.is-multi-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
}
.integration-fields.is-multi-col .span-2 {
    grid-column: 1 / -1;
}
.integration-actions {
    margin-top: auto;
    padding-top: 6px;
}

/* 14.7 Kanban Quick Filters & Compact RMA Inline Controls */
.kanban-quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.kanban-quick-chip {
    appearance: none;
    border: 1px solid var(--line-strong);
    background: var(--panel);
    color: var(--text-secondary);
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.14s ease;
}
.kanban-quick-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.kanban-quick-chip.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}
.rma-compact-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.rma-compact-form {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0;
}
.rma-compact-form select {
    width: auto;
    min-width: 118px;
    padding: 5px 8px;
    font-size: 12px;
}
.rma-more-details {
    position: relative;
}
.rma-more-details summary {
    list-style: none;
    cursor: pointer;
}
.rma-more-details summary::-webkit-details-marker {
    display: none;
}
.rma-popover-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 8px;
    margin-top: 8px;
    padding: 10px;
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    min-width: 290px;
}
.rma-popover-grid .span-2 {
    grid-column: 1 / -1;
}
.rma-popover-grid label {
    display: grid;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}
.rma-popover-grid input {
    padding: 5px 8px;
    font-size: 12px;
}

/* 14.8 Smart UX Badges, 1-Click Row Actions & 1366px Laptop Refinement */
.warranty-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}
.warranty-badge.is-active {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.35);
}
.warranty-badge.is-expired {
    background: rgba(100, 116, 139, 0.14);
    color: #64748b;
    border: 1px solid rgba(100, 116, 139, 0.28);
}
.warranty-badge.is-pending {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.28);
}
[data-theme="dark"] .warranty-badge.is-active {
    color: #34d399;
}
[data-theme="dark"] .warranty-badge.is-expired {
    color: #94a3b8;
}
[data-theme="dark"] .warranty-badge.is-pending {
    color: #60a5fa;
}
.table-wrap td:last-child a.row-wa-action,
.whatsapp-btn {
    background: rgba(34, 197, 94, 0.14) !important;
    border-color: rgba(34, 197, 94, 0.4) !important;
    color: #15803d !important;
}
[data-theme="dark"] .table-wrap td:last-child a.row-wa-action,
[data-theme="dark"] .whatsapp-btn {
    color: #4ade80 !important;
}
.table-wrap td:last-child a.row-wa-action:hover,
.whatsapp-btn:hover {
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
}

@media (max-width: 1440px) {
    .app-shell { grid-template-columns: 224px minmax(0, 1fr); }
    .page { padding: 18px 20px 36px; }
    .topbar { padding: 8px 16px; gap: 8px; }
    .topbar-left { flex: 0 0 auto; }
    .topbar-title { font-size: 14px; overflow: visible; text-overflow: clip; }
    .topbar-search { flex: 1 1 200px; max-width: 265px; margin: 0 4px; }
    .topbar-search input[type="search"] { padding: 0 54px 0 36px !important; font-size: 12.5px; }
    .topbar-quick-actions { gap: 6px; }
    .topbar-quick-actions .quick-btn { padding: 0 10px; font-size: 12px; height: 34px; }
    .nav { gap: 4px; }
    .nav a, .nav-button { padding: 5px 8px; font-size: 12.5px; }
    .month-strip { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    table th, .table-wrap table th { padding: 9px 10px; }
    table td, .table-wrap table td { padding: 9px 10px; font-size: 12.5px; }
    .rma-compact-form select { min-width: 104px; }
    .repair-command { padding: 16px 18px !important; }
    .repair-command-toolbar { gap: 8px 12px; }
    .subnav-bar { padding: 6px 18px; gap: 4px; }
    .subnav-bar a { padding: 5px 9px; font-size: 12.2px; }
    .catalog-add-field { flex: 1 1 160px; min-width: 135px; }
}

/* 14.9 SaaS Design System v8: Topbar Cash Pill, Actionable Empty States & Kanban Polish */
.topbar-cash-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--panel-soft);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.15s ease;
    font-variant-numeric: tabular-nums;
}
.topbar-cash-pill:hover {
    border-color: var(--primary);
}
.topbar-cash-pill .cash-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.topbar-cash-pill.is-open {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #059669;
}
.topbar-cash-pill.is-closed {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #b45309;
}

.smart-empty-state .empty-state-cta {
    margin-top: 8px;
}

.kanban-empty-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: auto 2px;
    padding: 26px 14px;
    border: 1.5px dashed var(--line-strong);
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.05);
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}
.repair-kanban-card {
    border-left: 3.5px solid var(--primary);
}
.repair-kanban-card[data-priority="urgent"] {
    border-left-color: #ef4444;
}
.repair-kanban-card[data-priority="high"] {
    border-left-color: #f59e0b;
}
.repair-kanban-card[data-priority="normal"] {
    border-left-color: #3b82f6;
}
.repair-kanban-card[data-priority="low"] {
    border-left-color: #64748b;
}



/* ==========================================================================
   AUDIT 22/11/2026 — correzioni di contrasto (WCAG AA, almeno 4,5:1)
   Blocco autonomo: per tornare indietro basta rimuoverlo.
   ========================================================================== */
.nav-section-title,
.sidebar-footer {
    color: #8b97ab;
}
.kanban-quick-chip.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}
[data-theme="dark"] .kanban-column-head h2 {
    color: #e2e8f0;
}


/* ==========================================================================
   AUDIT 22/11/2026 (2) — pagine pubbliche e uso da mobile
   Blocco autonomo: per tornare indietro basta rimuoverlo.
   ========================================================================== */
/* Accesso e registrazione: la miniatura incorniciata sembrava un'immagine non caricata */
.auth-hero .auth-visual-media {
    display: none;
}
/* Registrazione azienda: passaggi su una riga e leggibili anche nel tema scuro */
.auth-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
[data-theme="dark"] .auth-steps li {
    background: #111723;
    border-color: #334155;
    color: #94a3b8;
}
[data-theme="dark"] .auth-steps li.done {
    background: rgba(16, 185, 129, 0.12);
    border-color: #10b981;
    color: #6ee7b7;
}
[data-theme="dark"] .auth-steps li.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}
/* Titolo della barra in alto: non spinge fuori i pulsanti */
.topbar-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 900px) {
    /* Accesso da telefono: prima il modulo, poi la presentazione */
    .auth-stage .auth-box {
        order: -1;
    }
}
@media (max-width: 600px) {
    /* Intestazione pubblica: niente righe spezzate */
    .public-topbar .brand small {
        display: none;
    }
    .public-nav a {
        white-space: nowrap;
        padding-left: 8px;
        padding-right: 8px;
    }
    .public-topbar .brand strong {
        white-space: nowrap;
    }
    .public-topbar {
        gap: 6px;
    }
    /* Barra in alto del gestionale: il nome utente lascia spazio a tema ed "Esci" */
    .topbar:not(.public-topbar) .nav > a {
        display: none;
    }
    /* Numeri di Kanban e dashboard: griglia 2x2 compatta invece di una colonna */
    .metric-grid,
    .compact-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
    .metric-grid article,
    .compact-metrics article {
        padding: 12px 14px !important;
        min-height: 0 !important;
    }
    .metric-grid article strong,
    .compact-metrics article strong {
        font-size: 22px !important;
    }
}
@media (max-width: 370px) {
    /* Telefoni molto stretti (320 px): intestazione pubblica piu' compatta */
    .public-topbar .theme-toggle {
        display: none;
    }
    .public-nav a {
        font-size: 12.5px;
        padding-left: 6px;
        padding-right: 6px;
    }
}
