:root {
    --app-ink: #16324f;
    --app-ocean: #1f5f8b;
    --app-sand: #f4efe6;
    --app-highlight: #f3a712;
    --app-mint: #2a9d8f;
    --app-danger: #bb3e03;
    --app-muted: #6c757d;
    --app-surface: #ffffff;
    --app-border: rgba(22, 50, 79, 0.12);
}

body {
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(243, 167, 18, 0.12), transparent 30%),
        linear-gradient(180deg, #f8f6f1 0%, #edf3f8 100%);
    color: #213547;
    min-height: 100vh;
}

.app-navbar {
    background: linear-gradient(120deg, var(--app-ink), var(--app-ocean));
}

.hero-panel {
    background: linear-gradient(135deg, rgba(22, 50, 79, 0.96), rgba(31, 95, 139, 0.92));
    border-radius: 1.75rem;
    padding: 2rem;
    color: #fff;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: 0 20px 50px rgba(22, 50, 79, 0.16);
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.status-card {
    border-radius: 1.5rem;
    padding: 1rem 1.1rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    display: flex;
    flex-direction: column;
    min-height: 110px;
    justify-content: space-between;
    box-shadow: 0 12px 30px rgba(22, 50, 79, 0.07);
}

.status-card__label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-card__value {
    font-size: 2rem;
    line-height: 1;
}

.status-card.preso-in-carico { border-left: 6px solid #457b9d; }
.status-card.in-lavorazione { border-left: 6px solid var(--app-highlight); }
.status-card.in-riparazione { border-left: 6px solid #e76f51; }
.status-card.pronto-per-consegna { border-left: 6px solid var(--app-mint); }
.status-card.consegnato { border-left: 6px solid #264653; }

.badge-stato {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-stato.preso { background: rgba(69, 123, 157, 0.14); color: #28506c; }
.badge-stato.lavorazione { background: rgba(243, 167, 18, 0.18); color: #7f5500; }
.badge-stato.riparazione { background: rgba(231, 111, 81, 0.18); color: #9a3412; }
.badge-stato.pronto { background: rgba(42, 157, 143, 0.18); color: #156e64; }
.badge-stato.consegnato { background: rgba(38, 70, 83, 0.16); color: #1d3d49; }

.dashboard-table th,
.dashboard-table td {
    padding: 1rem 1.25rem;
}

.info-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.1rem;
    border-radius: 999px;
    background: rgba(31, 95, 139, 0.08);
    color: var(--app-ink);
    font-weight: 700;
}

.webcam-panel {
    border: 1px solid var(--app-border);
    border-radius: 1.5rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.72);
}

.camera-surface,
.preview-surface {
    position: relative;
    min-height: 300px;
    border-radius: 1.25rem;
    overflow: hidden;
    border: 1px dashed rgba(22, 50, 79, 0.25);
    background: linear-gradient(145deg, #e9eff4, #f7fbfd);
}

.camera-surface video,
.preview-surface img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-placeholder,
.preview-placeholder,
.empty-photo-state {
    min-height: 300px;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 1rem;
    color: var(--app-muted);
}

.detail-block,
.photo-card {
    background: rgba(248, 249, 250, 0.85);
    border-radius: 1.25rem;
    padding: 1.2rem;
    border: 1px solid rgba(22, 50, 79, 0.08);
}

.photo-card__header {
    font-weight: 700;
    margin-bottom: 1rem;
}

.timeline {
    display: grid;
    gap: 1rem;
}

.timeline__item {
    position: relative;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(22, 50, 79, 0.08);
    border-radius: 1rem;
    padding: 1rem;
}

.timeline--compact .timeline__item {
    padding: 0.85rem;
}

.clean-list {
    display: grid;
    gap: 0.85rem;
    padding-left: 1.1rem;
}

.print-card-preview,
.print-ticket {
    background: linear-gradient(145deg, #fff7ea, #fff);
    border: 1px solid rgba(243, 167, 18, 0.28);
    border-radius: 1.5rem;
    padding: 1.25rem;
}

.print-card-preview__label,
.print-ticket__label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--app-muted);
    margin-bottom: 0.6rem;
}

.print-ticket__code {
    display: block;
    font-size: clamp(1.7rem, 4vw, 2.75rem);
    line-height: 1;
    margin-bottom: 0.4rem;
}

.detail-list dt {
    font-weight: 700;
}

.form-control,
.form-select,
.btn {
    border-radius: 0.9rem;
}

.form-text {
    color: #5f6f7f;
}

.btn-lg,
.form-control-lg,
.form-select-lg {
    min-height: 3.35rem;
}

@media (max-width: 991.98px) {
    .hero-panel {
        padding: 1.5rem;
    }

    .camera-surface,
    .preview-surface,
    .camera-placeholder,
    .preview-placeholder,
    .empty-photo-state {
        min-height: 220px;
    }
}

@media print {
    .navbar,
    .btn,
    .alert,
    .timeline,
    .card:not(.print-surface),
    .hero-panel {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .print-surface,
    .print-surface .card-body,
    .print-ticket {
        border: 0;
        box-shadow: none !important;
        background: #fff;
    }
}