:root {
    --st-ink: #1a2332;
    --st-slate: #2c3a4f;
    --st-steel: #4a5d78;
    --st-fog: #e8eef4;
    --st-paper: #f4f7fa;
    --st-amber: #e8a317;
    --st-amber-deep: #c9840a;
    --st-line: rgba(26, 35, 50, 0.12);
    --st-ok: #2f7d4a;
    --st-danger: #b42318;
    --st-radius: 6px;
    --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
    --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--st-ink);
    background: var(--st-paper);
}

/* ========== LOGIN (industrial / RSPP) ========== */

.guest-body {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(244, 247, 250, 0.92), rgba(232, 238, 244, 0.96)),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 31px,
            rgba(74, 93, 120, 0.08) 31px,
            rgba(74, 93, 120, 0.08) 32px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 31px,
            rgba(74, 93, 120, 0.08) 31px,
            rgba(74, 93, 120, 0.08) 32px
        );
}

.login-stage {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.safety-stripe {
    height: 10px;
    background: repeating-linear-gradient(
        -45deg,
        #1a2332,
        #1a2332 12px,
        #e8a317 12px,
        #e8a317 24px
    );
}

.login-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 0;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;
}

.login-hero {
    padding: 1.5rem 2rem 1.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--st-steel);
    margin-bottom: 1rem;
}

.kicker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--st-amber);
    box-shadow: 0 0 0 4px rgba(232, 163, 23, 0.25);
}

.hero-brand-block {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0 0 1rem;
}

.hero-logo {
    width: clamp(72px, 12vw, 120px);
    height: clamp(72px, 12vw, 120px);
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(26, 35, 50, 0.18);
}

.hero-brand {
    font-family: var(--font-display);
    font-size: clamp(3.2rem, 7vw, 5.2rem);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--st-ink);
    margin: 0;
}

.access-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.hero-lead {
    font-size: 1.15rem;
    line-height: 1.45;
    max-width: 34ch;
    color: var(--st-slate);
    margin: 0 0 1.75rem;
}

.hero-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.85rem;
}

.hero-points li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--st-slate);
    font-size: 0.98rem;
}

.hero-points i {
    color: var(--st-amber-deep);
    font-size: 1.15rem;
    margin-top: 0.1rem;
}

.hero-schematic {
    margin-top: 2.25rem;
}

.schematic-frame {
    border: 1px solid var(--st-line);
    background: rgba(255, 255, 255, 0.55);
    padding: 1rem 1.1rem 0.75rem;
    position: relative;
    max-width: 360px;
}

.schematic-label {
    position: absolute;
    top: -0.55rem;
    left: 0.85rem;
    background: var(--st-paper);
    padding: 0 0.4rem;
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    color: var(--st-steel);
}

.machine-svg {
    width: 100%;
    height: auto;
    color: var(--st-slate);
    display: block;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: stretch;
    padding: 1rem 0 1rem 1rem;
}

.access-card {
    width: 100%;
    background: #fff;
    border: 1px solid var(--st-line);
    border-top: 4px solid var(--st-amber);
    padding: 1.75rem 1.6rem 1.5rem;
    box-shadow: 0 18px 40px rgba(26, 35, 50, 0.08);
}

.access-header {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    margin-bottom: 1.4rem;
}

.access-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    background: var(--st-ink);
    color: var(--st-amber);
    font-size: 1.35rem;
    flex-shrink: 0;
}

.access-header h2 {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0;
    line-height: 1.1;
    text-transform: uppercase;
}

.access-header p {
    margin: 0.2rem 0 0;
    color: var(--st-steel);
    font-size: 0.9rem;
}

.alert-error {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    background: #fef3f2;
    color: var(--st-danger);
    border: 1px solid #f5c2c0;
    padding: 0.7rem 0.85rem;
    margin-bottom: 1rem;
    font-size: 0.92rem;
}

.access-form {
    display: grid;
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.35rem;
}

.field span {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--st-steel);
}

.field input {
    width: 100%;
    border: 1px solid #c9d3df;
    background: #fbfcfd;
    padding: 0.85rem 0.9rem;
    font: inherit;
    font-size: 1rem;
    color: var(--st-ink);
    border-radius: 2px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
    border-color: var(--st-amber);
    box-shadow: 0 0 0 3px rgba(232, 163, 23, 0.22);
}

.btn-access {
    margin-top: 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    border: 0;
    cursor: pointer;
    background: var(--st-ink);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.95rem 1rem;
    transition: background 0.15s ease, transform 0.15s ease;
}

.btn-access:hover {
    background: #101822;
}

.btn-access:active {
    transform: translateY(1px);
}

.btn-access i {
    color: var(--st-amber);
}

.access-note {
    margin: 1.15rem 0 0;
    font-size: 0.82rem;
    color: var(--st-steel);
    line-height: 1.4;
}

@media (max-width: 900px) {
    .login-grid {
        grid-template-columns: 1fr;
        padding: 1.5rem 1.1rem 2rem;
    }

    .login-hero {
        padding: 0.5rem 0 1.25rem;
    }

    .login-panel {
        padding: 0;
    }

    .hero-schematic {
        display: none;
    }
}

/* ========== ADMIN SHELL ========== */

.admin-body {
    min-height: 100vh;
    background: var(--st-fog);
}

.app-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    max-width: 260px;
    background: var(--st-ink);
    color: #d7dee8;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1rem;
    box-sizing: border-box;
    overflow: hidden;
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    align-self: start;
}

.sidebar-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.35rem 0.4rem 0;
    min-width: 0;
    flex: 1;
}

.sidebar-brand > div {
    min-width: 0;
}

.brand-mark {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: var(--st-amber);
    color: var(--st-ink);
    font-size: 1.25rem;
}

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #fff;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1;
}

.brand-sub {
    font-size: 0.75rem;
    color: rgba(215, 222, 232, 0.65);
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    display: grid;
    gap: 0.25rem;
    flex: 1;
    align-content: start;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.nav-section-label {
    margin: 0.85rem 0.75rem 0.2rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7a8796;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #c5cfdb;
    text-decoration: none;
    padding: 0.7rem 0.75rem;
    border-radius: var(--st-radius);
    font-size: 0.95rem;
    min-width: 0;
}

.nav-link i {
    flex-shrink: 0;
}

.nav-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.nav-link.active {
    background: rgba(232, 163, 23, 0.18);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--st-amber);
}

.nav-link.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1rem;
    margin-top: auto;
    display: grid;
    gap: 0.75rem;
    flex-shrink: 0;
}

.user-chip {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    min-width: 0;
}

.user-chip > div {
    min-width: 0;
}

.user-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(232, 163, 23, 0.2);
    color: var(--st-amber);
    display: grid;
    place-items: center;
    font-size: 0.78rem;
    font-weight: 700;
}

.user-name {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(215, 222, 232, 0.6);
}

.logout-link {
    color: #9eacbd;
    text-decoration: none;
    font-size: 0.88rem;
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
}

.logout-link:hover {
    color: #fff;
}

.main-panel {
    padding: 1.75rem 2rem 2.5rem;
    min-width: 0;
    overflow-x: auto;
}

.mobile-bar,
.sidebar-close,
.sidebar-backdrop {
    display: none;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin: 0 0 1.25rem;
    color: var(--st-ink);
}

.dashboard-intro {
    margin: 0 0 1.25rem;
    color: var(--st-steel);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--st-line);
    padding: 1.1rem 1rem;
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}

.stat-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: var(--st-fog);
    color: var(--st-slate);
    font-size: 1.2rem;
}

.stat-icon.accent {
    background: rgba(232, 163, 23, 0.18);
    color: var(--st-amber-deep);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    color: var(--st-ink);
}

.stat-label {
    font-weight: 600;
    margin-top: 0.25rem;
}

.stat-meta {
    font-size: 0.8rem;
    color: var(--st-steel);
    margin-top: 0.15rem;
}

.panel-box {
    background: #fff;
    border: 1px solid var(--st-line);
    padding: 1.25rem 1.35rem;
}

.panel-box h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0 0 0.75rem;
}

.next-steps {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--st-slate);
    line-height: 1.7;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.1rem;
}

.pending-summary-list {
    display: grid;
    gap: 0.85rem;
}

.pending-summary-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius);
    background: #fff;
}

.pending-summary-user {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.pending-summary-meta {
    text-align: right;
}

.empty-state-inline {
    margin: 0;
    color: var(--st-slate);
}

.temp-password-box {
    margin-bottom: 1rem;
    border: 2px solid rgba(232, 163, 23, 0.35);
    background: linear-gradient(180deg, rgba(255, 250, 240, 0.9), #fff);
}

.temp-password-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.temp-password-row code {
    display: inline-block;
    min-width: 220px;
    padding: 0.75rem 0.9rem;
    border-radius: var(--st-radius);
    background: #101822;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.traffic-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-top: 0.28rem;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.04);
}

.traffic-light--ok {
    background: var(--st-ok);
}

.traffic-light--warn {
    background: var(--st-amber);
}

.traffic-light--danger {
    background: var(--st-danger);
}

.error-page {
    min-height: 100vh;
    display: grid;
    place-content: center;
    text-align: center;
    padding: 2rem;
}

.error-code {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 700;
    color: var(--st-amber);
    line-height: 1;
}

/* ========== CRUD UI ========== */

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

.toolbar-hint {
    margin: 0;
    color: var(--st-steel);
    font-size: 0.95rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid transparent;
    border-radius: var(--st-radius);
    padding: 0.55rem 0.95rem;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.2;
}

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

.btn-primary:hover {
    background: #101822;
}

.btn-ghost {
    background: #fff;
    border-color: var(--st-line);
    color: var(--st-slate);
}

.btn-ghost:hover {
    border-color: var(--st-steel);
    color: var(--st-ink);
}

.btn-sm {
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
}

.btn-danger-ghost {
    background: #fff;
    border-color: rgba(180, 35, 24, 0.25);
    color: var(--st-danger);
}

.btn-danger-ghost:hover {
    background: rgba(180, 35, 24, 0.06);
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.85rem 1rem;
    border-radius: var(--st-radius);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.alert-success {
    background: rgba(47, 125, 74, 0.1);
    color: var(--st-ok);
    border: 1px solid rgba(47, 125, 74, 0.25);
}

.alert-danger {
    background: rgba(180, 35, 24, 0.08);
    color: var(--st-danger);
    border: 1px solid rgba(180, 35, 24, 0.22);
}

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

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

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

.data-table th {
    background: var(--st-fog);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--st-steel);
    font-weight: 700;
}

.data-table tbody tr:hover {
    background: rgba(232, 163, 23, 0.05);
}

.col-actions {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}

.inline-form {
    display: inline;
}

.empty-row {
    text-align: center;
    color: var(--st-steel);
    padding: 2rem 1rem !important;
}

.cell-meta {
    font-size: 0.8rem;
    color: var(--st-steel);
    margin-top: 0.15rem;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-ok {
    background: rgba(47, 125, 74, 0.12);
    color: var(--st-ok);
}

.badge-danger {
    background: rgba(180, 35, 24, 0.1);
    color: var(--st-danger);
}

.badge-muted {
    background: rgba(74, 93, 120, 0.12);
    color: var(--st-steel);
}

.tag-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
    background: var(--st-fog);
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    color: var(--st-ink);
}

.tag-code-lg {
    display: inline-block;
    font-size: 0.95rem;
    padding: 0.45rem 0.7rem;
}

.tag-display {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.tag-marker {
    width: 140px;
    height: 140px;
    object-fit: contain;
    border: 1px solid var(--st-line);
    background: #fff;
    border-radius: 4px;
}

.tag-marker-sm {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border: 1px solid var(--st-line);
    background: #fff;
    border-radius: 3px;
}

.tag-cell {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.tag-box {
    background: var(--st-fog);
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius);
    padding: 0.85rem 1rem;
}

.machine-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.thumb {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--st-line);
    background: var(--st-fog);
}

.thumb-empty {
    display: grid;
    place-items: center;
    color: var(--st-steel);
    font-size: 1.1rem;
}

.form-panel {
    background: #fff;
    border: 1px solid var(--st-line);
    padding: 1.35rem 1.4rem 1.5rem;
    max-width: 920px;
}

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

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-field-wide {
    grid-column: 1 / -1;
}

.form-field-check {
    justify-content: flex-end;
}

.form-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--st-slate);
}

.form-field input,
.form-field select,
.form-field textarea {
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius);
    padding: 0.65rem 0.75rem;
    font: inherit;
    color: var(--st-ink);
    background: #fff;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: 2px solid rgba(232, 163, 23, 0.35);
    border-color: var(--st-amber);
}

.form-field .tox-tinymce {
    border-radius: var(--st-radius) !important;
    border-color: var(--st-line) !important;
}

.form-field.has-error input,
.form-field.has-error select {
    border-color: var(--st-danger);
}

.field-error {
    color: var(--st-danger);
    font-size: 0.8rem;
}

.stat-note {
    font-size: 0.95rem;
    color: var(--st-slate);
    font-weight: 500;
}

.field-hint {
    margin: 0;
    font-size: 0.8rem;
    color: var(--st-steel);
}

.check-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 500 !important;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.35rem;
    padding-top: 1rem;
    border-top: 1px solid var(--st-line);
}

.foto-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.foto-preview img {
    width: 96px;
    height: 72px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--st-line);
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.45rem 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius);
    background: var(--st-fog);
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 1.35rem 0 0.75rem;
}

.form-panel-wide {
    max-width: 1100px;
}

.blocchi-list {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.blocco-card {
    border: 1px solid var(--st-line);
    background: #fff;
    padding: 1rem;
}

.blocco-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.content-blocks {
    display: grid;
    gap: 0.85rem;
}

.file-list {
    margin: 0;
    padding-left: 1.1rem;
    line-height: 1.8;
}

.video-embed {
    margin-top: 0.75rem;
    position: relative;
    width: 100%;
    max-width: 640px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.checklist-list {
    list-style: none;
    margin: 0.5rem 0 0.75rem;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

.checklist-list li {
    margin: 0;
}

.checklist-list .check-label {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.55rem 0.7rem;
    background: #f7f8f6;
    border: 1px solid var(--st-line);
}

.presa-visione-form {
    margin-top: 0.85rem;
}

.op-blocchi-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

.op-blocchi-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--st-line);
    background: #f7f8f6;
}

.op-blocchi-list a {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: inherit;
    text-decoration: none;
}

.op-blocchi-list a:hover {
    text-decoration: underline;
}

.blocco-card:target {
    outline: 2px solid var(--st-accent, #c45c26);
    outline-offset: 2px;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.filter-bar select {
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius);
    padding: 0.45rem 0.65rem;
    font: inherit;
}

.toolbar-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 1100px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .mobile-bar {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        position: sticky;
        top: 0;
        z-index: 30;
        background: var(--st-ink);
        color: #fff;
        padding: 0.75rem 1rem;
        border-bottom: 3px solid var(--st-amber);
    }

    .mobile-bar-brand {
        display: inline-flex;
        align-items: center;
        gap: 0.55rem;
        min-width: 0;
    }

    .mobile-bar-brand img {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        object-fit: cover;
        background: #fff;
        flex-shrink: 0;
    }

    .mobile-bar-title {
        font-family: var(--font-display);
        font-size: 1.25rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .menu-toggle,
    .sidebar-close {
        display: inline-grid;
        place-items: center;
        width: 40px;
        height: 40px;
        border: 1px solid rgba(255, 255, 255, 0.18);
        background: transparent;
        color: #fff;
        border-radius: var(--st-radius);
        cursor: pointer;
        font-size: 1.25rem;
        padding: 0;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(16, 24, 34, 0.55);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 40;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 50;
        width: min(280px, 86vw);
        max-width: min(280px, 86vw);
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        box-shadow: none;
    }

    .sidebar-close {
        display: inline-grid;
        margin: 0.15rem 0 0;
        flex-shrink: 0;
    }

    body.nav-open .sidebar {
        transform: translateX(0);
        box-shadow: 8px 0 28px rgba(0, 0, 0, 0.28);
    }

    body.nav-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body.nav-open {
        overflow: hidden;
    }

    .main-panel {
        padding: 1.25rem 1rem 2rem;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

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

    .form-actions {
        flex-direction: column-reverse;
    }
}
