:root {
    --ss-ink: #17212b;
    --ss-muted: #687481;
    --ss-line: #e5e9ed;
    --ss-surface: #ffffff;
    --ss-canvas: #f5f7f8;
    --ss-accent: #c56b24;
    --ss-accent-soft: #fff3e8;
}

html.dark {
    --ss-ink: #e7ecf1;
    --ss-muted: #98a5b3;
    --ss-line: #2a3542;
    --ss-surface: #1b232c;
    --ss-canvas: #10161d;
    --ss-accent: #e2924a;
    --ss-accent-soft: #3a2a1a;
}

html.dark .fi-sidebar-item-button {
    color: var(--ss-muted);
}

html.dark .fi-sidebar-item-button:hover {
    background: #232e39;
    color: var(--ss-ink);
}

html.dark .fi-topbar {
    background: rgb(27 35 44 / 92%);
}

html.dark .fi-ta-table thead {
    background: #202a34;
}

html.dark .fi-ta-table thead th {
    color: var(--ss-muted);
}

html.dark .fi-ta-table tbody tr:hover,
html.dark .ss-storico-table tbody tr:hover {
    background: #2a2118;
}

html.dark .ss-vendita-input,
html.dark .fi-input,
html.dark .fi-select,
html.dark .fi-textarea {
    border-color: var(--ss-line);
}

html.dark .fi-in-repeatable-item {
    background: var(--ss-surface);
}

html.fi,
.fi-body {
    font-family: 'Instrument Sans', 'Segoe UI', sans-serif;
}

@media (min-width: 1024px) {
    html.fi {
        --sidebar-width: 15rem;
        --collapsed-sidebar-width: 4.25rem;
    }

}

.fi-body {
    background: var(--ss-canvas);
    color: var(--ss-ink);
}

.fi-main-ctn {
    min-width: 0;
    background: var(--ss-canvas);
}

.fi-sidebar {
    border-right: 1px solid var(--ss-line);
    background: var(--ss-surface);
    box-shadow: 8px 0 28px rgb(23 33 43 / 4%);
}

.fi-sidebar-header {
    min-height: 4.5rem;
    border-bottom: 1px solid var(--ss-line);
    background: var(--ss-surface);
}

.fi-sidebar-header .fi-logo {
    color: var(--ss-ink);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.fi-sidebar-nav {
    padding: 1.25rem 0.75rem;
}

.fi-sidebar-group-label {
    color: var(--ss-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.fi-sidebar-item-button {
    min-height: 2.65rem;
    border-radius: 0.65rem;
    color: #53606d;
    font-weight: 600;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.fi-sidebar-item-button:hover {
    background: #f4f6f7;
    color: var(--ss-ink);
    transform: translateX(2px);
}

.fi-sidebar-item-button.fi-active {
    background: var(--ss-accent-soft);
    color: var(--ss-accent);
    font-weight: 750;
}

.fi-topbar {
    min-height: 4.5rem;
    border-bottom: 1px solid var(--ss-line);
    background: rgb(255 255 255 / 92%);
    box-shadow: 0 1px 12px rgb(23 33 43 / 3%);
    backdrop-filter: blur(10px);
}

.fi-main {
    width: 100%;
    max-width: none;
    margin-inline: auto;
    padding: 1.25rem 1.75rem 2.5rem;
}

.fi-page-header-main-ctn {
    padding-top: 0;
}

.fi-page-main {
    padding-top: 0;
}

.fi-header {
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

.fi-header-heading {
    color: var(--ss-ink);
    font-size: clamp(1.65rem, 2vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -0.035em;
}

.fi-breadcrumbs {
    color: var(--ss-muted);
    font-size: 0.78rem;
    font-weight: 650;
}

.fi-section,
.fi-ta-ctn {
    border: 1px solid var(--ss-line);
    border-radius: 0.8rem;
    background: var(--ss-surface);
    box-shadow: 0 8px 24px rgb(23 33 43 / 5%);
}

.fi-ta-ctn {
    overflow: hidden;
}

.fi-ta-header,
.fi-ta-footer {
    padding-inline: 1.25rem;
}

.fi-ta-content {
    overflow-x: auto;
}

.fi-ta-table {
    min-width: 42rem;
}

.fi-ta-table tbody td {
    padding-block: 0.85rem;
}

.fi-ta-header {
    border-bottom: 1px solid var(--ss-line);
}

.fi-ta-table thead {
    background: #fafbfb;
}

.fi-ta-table thead th {
    color: #53606d;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.fi-ta-table tbody tr {
    transition: background-color 140ms ease;
}

.fi-ta-table tbody tr:hover {
    background: #fffaf5;
}

.ss-infolist-value {
    color: var(--ss-ink) !important;
}

.fi-in-entry-label {
    color: var(--ss-muted) !important;
    font-size: 0.7rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.fi-in-entry-content {
    color: var(--ss-ink) !important;
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.35;
}

.ss-infolist-value .fi-in-entry-content {
    font-size: 1.05rem;
    font-weight: 800;
}

.ss-infolist-value-secondary,
.ss-infolist-value-secondary .fi-in-entry-label {
    color: var(--ss-muted) !important;
}

.ss-infolist-value-secondary .fi-in-entry-content {
    font-size: 0.85rem !important;
    font-weight: 500 !important;
}

.ss-storico-form {
    margin-bottom: 1.5rem;
}

.ss-storico-wrap {
    margin-top: 1.5rem;
}

.ss-storico-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border: 1px solid var(--ss-line);
    border-radius: 0.55rem;
    background: var(--ss-surface);
    color: var(--ss-ink);
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 140ms ease;
}

.ss-storico-toggle:hover {
    background: var(--ss-accent-soft);
    border-color: var(--ss-accent);
}

.ss-storico-table-wrap {
    margin-top: 1rem;
    overflow-x: auto;
    border: 1px solid var(--ss-line);
    border-radius: 0.65rem;
    background: var(--ss-surface);
}

.ss-storico-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.ss-storico-table thead th {
    text-align: left;
    color: var(--ss-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--ss-line);
    white-space: nowrap;
}

.ss-storico-table tbody td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--ss-line);
    color: var(--ss-ink);
    white-space: nowrap;
}

.ss-storico-table tbody tr:last-child td {
    border-bottom: none;
}

.ss-storico-table tbody tr:hover {
    background: #fffaf5;
}

.ss-storico-table .ss-storico-right {
    text-align: right;
}

.ss-storico-empty {
    text-align: center;
    padding: 1.25rem;
    color: var(--ss-muted);
    white-space: normal;
}

.ss-scatola-modal-titolo {
    margin-bottom: 0.75rem;
    color: var(--ss-ink);
    font-size: 0.9rem;
}

.ss-vendita-panel {
    border: 1px solid var(--ss-line);
    border-radius: 0.75rem;
    background: var(--ss-surface);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.ss-vendita-panel-titolo {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--ss-ink);
    margin-bottom: 0.9rem;
}

.ss-vendita-field {
    margin-bottom: 0.9rem;
}

.ss-vendita-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ss-muted);
    margin-bottom: 0.3rem;
}

.ss-vendita-input {
    width: 100%;
    max-width: 22rem;
    border: 1px solid #d9dfe4;
    border-radius: 0.55rem;
    padding: 0.5rem 0.7rem;
    font-size: 0.9rem;
    color: var(--ss-ink);
    background: var(--ss-surface);
}

.ss-vendita-input:focus {
    outline: none;
    border-color: var(--ss-accent);
    box-shadow: 0 0 0 3px rgb(197 107 36 / 15%);
}

.ss-vendita-input-sm {
    max-width: 7rem;
}

.ss-vendita-radio-group {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.ss-vendita-radio-group label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--ss-ink);
}

.ss-vendita-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.ss-dash-grid {
    display: grid;
    width: 100%;
    box-sizing: border-box;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.1rem;
    margin-bottom: 1.5rem;
}

.ss-dash-grid-compatta {
    display: grid;
    width: 100%;
    box-sizing: border-box;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.1rem;
}

@media (max-width: 1024px) {
    .ss-dash-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .ss-dash-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.ss-dash-card {
    position: relative;
    border-radius: 0.85rem;
    padding: 1.4rem 1.4rem 1.1rem;
    color: #fff;
    box-shadow: 0 4px 14px rgb(0 0 0 / 12%);
    overflow: hidden;
}

.ss-dash-card-icon {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    width: 2.25rem;
    height: 2.25rem;
    opacity: 0.55;
}

.ss-dash-card-icon svg {
    width: 100%;
    height: 100%;
}

.ss-dash-card-valore {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.15;
}

.ss-dash-card-etichetta {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.9;
    margin-top: 0.15rem;
}

.ss-dash-card-dettaglio {
    margin-top: 0.9rem;
    padding-top: 0.7rem;
    border-top: 1px solid rgb(255 255 255 / 25%);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ss-dash-card-dettaglio-riga {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0.92;
}

.ss-dash-card-blu {
    background: linear-gradient(135deg, #22b7db, #1a9fc4);
}

.ss-dash-card-verde {
    background: linear-gradient(135deg, #22b866, #1a9c54);
}

.ss-dash-card-arancio {
    background: linear-gradient(135deg, #f2a93c, #e08f18);
}

.ss-dash-card-viola {
    background: linear-gradient(135deg, #7c5cd6, #5f3fc0);
}

.ss-vendita-barcode-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.ss-vendita-barcode-row .ss-vendita-input {
    flex: 1;
}

.ss-vendita-ricerca {
    border: 1px solid var(--ss-line);
    border-radius: 0.65rem;
    background: var(--ss-canvas);
    padding: 1rem;
    margin-bottom: 0.9rem;
}

.ss-vendita-ricerca-risultati {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 16rem;
    overflow-y: auto;
}

.ss-vendita-ricerca-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    background: var(--ss-surface);
    border: 1px solid var(--ss-line);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: var(--ss-ink);
    cursor: pointer;
}

.ss-vendita-ricerca-item:hover {
    border-color: var(--ss-accent);
    background: var(--ss-accent-soft);
}

.ss-vendita-ricerca-barcode {
    font-size: 0.75rem;
    color: var(--ss-muted);
    white-space: nowrap;
}

.ss-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(23, 33, 43, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.ss-modal-dialog {
    background: var(--ss-surface);
    border: 1px solid var(--ss-line);
    border-radius: 0.75rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 32rem;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.25rem;
}

.ss-modal-titolo {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ss-ink);
    margin-bottom: 0.9rem;
}

.ss-giacenza-riga {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--ss-line);
    margin-bottom: 0.6rem;
}

.ss-panel-titolo-riga {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.ss-panel-titolo-riga .ss-vendita-panel-titolo {
    margin-bottom: 0;
}

.ss-giacenza-valore {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--ss-ink);
}

.ss-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 0.55rem;
    border: 1px solid transparent;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 120ms ease, background-color 120ms ease;
}

.ss-btn:hover {
    filter: brightness(0.95);
}

.ss-btn-primary {
    background: var(--ss-accent);
    color: #fff;
}

.ss-btn-success {
    background: #16a34a;
    color: #fff;
}

.ss-btn-danger {
    background: #dc2626;
    color: #fff;
}

.ss-btn-outline {
    background: var(--ss-surface);
    color: var(--ss-ink);
    border-color: var(--ss-line);
}

.ss-btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.78rem;
}

.ss-vendita-totale {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: 0.9rem;
    margin-top: 0.6rem;
    border-top: 2px solid var(--ss-line);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--ss-ink);
}

.ss-vendita-resto {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ss-ink);
    margin-top: 0.5rem;
}

.ss-vendita-resto-negativo {
    color: #dc2626;
}

.ss-vendita-confirm-banner {
    background: var(--ss-accent-soft);
    border: 1px solid var(--ss-accent);
    border-radius: 0.6rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.9rem;
    font-size: 0.85rem;
    color: var(--ss-ink);
}

.fi-in-repeatable-item {
    border: 1px solid var(--ss-line);
    border-radius: 0.65rem;
    background: #fff;
    padding: 0.9rem 1rem;
}

.fi-input,
.fi-select,
.fi-textarea {
    border-color: #d9dfe4;
    border-radius: 0.55rem;
    box-shadow: 0 1px 2px rgb(23 33 43 / 3%);
}

.fi-input:focus,
.fi-select:focus,
.fi-textarea:focus {
    border-color: var(--ss-accent);
    box-shadow: 0 0 0 3px rgb(197 107 36 / 15%);
}

.fi-btn-primary {
    background: var(--ss-accent);
}

.fi-btn-primary:hover {
    background: #a95519;
}

@media (max-width: 640px) {
    .fi-main {
        padding: 1.25rem 0.75rem 2rem;
    }

    .fi-header {
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .fi-header-heading {
        font-size: 1.55rem;
    }

    .fi-section,
    .fi-ta-ctn {
        border-radius: 0.65rem;
    }

    .fi-ta-content {
        overflow-x: auto;
    }

    .fi-ta-table {
        min-width: 34rem;
    }

    .fi-ta-header,
    .fi-ta-footer {
        padding-inline: 0.85rem;
    }

    .fi-topbar {
        min-height: 3.75rem;
    }
}

.ss-segnaposti-lista {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.ss-segnaposto-btn {
    border: 1px solid var(--ss-line);
    border-radius: 999px;
    background: var(--ss-canvas);
    color: var(--ss-ink);
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    font-family: monospace;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.ss-segnaposto-btn:hover {
    background: var(--ss-accent-soft);
    border-color: var(--ss-accent);
    color: var(--ss-accent);
}
