/*
 * Stile UI approvato di PortalDAZ (27/10/2026): token e classi daz-*.
 * Documentazione: .claude/skills/portaldaz-mockup/references/stile.md
 * Va incluso nei layout dopo il CSS di Bootstrap.
 */

:root {
    --daz-bg: #f4f6f9;
    --daz-surface: #ffffff;
    --daz-border: #e3e7ee;
    --daz-border-card: #dfe4eb;
    --daz-divider: #f0f2f5;
    --daz-divider-strong: #e9edf2;
    --daz-text: #1f2937;
    --daz-muted: #5b6472;
    --daz-section-title: #4b5563;
    --daz-primary: #0d6efd;
    --daz-primary-text: #0b5ed7;
    --daz-primary-soft: #e7f0ff;
    --daz-chip: #eef2f7;
    --daz-success-soft: #f3fbf6;
    --daz-success-border: #cfe9d9;
    --daz-success-chip: #d1f0dd;
    --daz-success-text: #0f5132;
    --daz-danger-text: #b02a37;
    --daz-product1: #92400e;
    --daz-product2: #0b6b80;
    --daz-font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --daz-font-mono: ui-monospace, Consolas, monospace;
}

/* Card esterna */
.daz-card {
    background: var(--daz-surface);
    border: 1px solid var(--daz-border-card);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
    color: var(--daz-text);
    font-family: var(--daz-font);
    font-size: 14px;
    overflow: hidden;
}

/* Testata: icona, titolo e riga di etichette */
.daz-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid #e9edf2;
}

.daz-card-icon {
    flex: none;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--daz-primary-soft);
    color: var(--daz-primary-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.daz-card-head-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 0;
    min-width: 0;
}

.daz-title {
    margin: 0;
    font-family: inherit;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--daz-text);
}

.daz-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.daz-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--daz-chip);
    color: var(--daz-text);
}

/* Fascia di valori: una cella per valore, linee sottili tra le celle (quelle sul bordo esterno vengono tagliate).
   La linea orizzontale sta sotto ogni cella e non sopra, così con un numero dispari di celle resta intera */
.daz-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
}

.daz-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    min-width: 0;
    box-shadow: -1px 0 0 0 var(--daz-divider-strong), 0 1px 0 0 var(--daz-divider-strong);
}

.daz-stat-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--daz-section-title);
    overflow-wrap: anywhere;
}

.daz-product1 { color: var(--daz-product1); }
.daz-product2 { color: var(--daz-product2); }

.daz-stat-actions {
    display: flex;
    gap: 6px;
}

@media (min-width: 992px) {
    .daz-stats {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
        padding: 20px 0;
    }

    .daz-stat {
        padding: 4px 24px;
        box-shadow: -1px 0 0 0 var(--daz-divider-strong);
    }
}

.daz-big {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
}

.daz-big-regular { font-weight: 500; }

.daz-unit {
    margin-left: 4px;
    font-size: 14px;
    font-weight: 600;
}

/* Riga etichetta / valore */
.daz-kv {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 28px;
    border-bottom: 1px solid var(--daz-divider);
}

.daz-kv:last-child { border-bottom: 0; }
.daz-k { color: var(--daz-muted); }
.daz-v { font-weight: 600; text-align: right; }

/* Bottoni */
.daz-ibtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid #d5dbe4;
    background: var(--daz-surface);
    color: var(--daz-primary-text);
    cursor: pointer;
    text-decoration: none;
    flex: none;
}

.daz-ibtn:hover { color: #0a4fb6; background: var(--daz-primary-soft); }

.daz-btn,
.daz-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--daz-primary);
    background: var(--daz-primary);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
}

.daz-btn-outline {
    background: var(--daz-surface);
    color: var(--daz-primary-text);
}

/* Fascia in fondo alla card con l'ultima nota aperta */
.daz-note-band {
    border-top: 1px solid var(--daz-success-border);
    background: var(--daz-success-soft);
    padding: 14px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
}

.daz-note-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.daz-note-text {
    flex: 1 1 300px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.daz-badge-open {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--daz-success-chip);
    color: var(--daz-success-text);
    font-weight: 700;
}

.daz-muted {
    font-size: 12px;
    color: var(--daz-muted);
}

/* Cellulare */
@media (max-width: 575.98px) {
    .daz-card { font-size: 15px; }

    .daz-card-head { padding: 16px; }

    .daz-card-icon { display: none; }

    .daz-title { font-size: 20px; }

    .daz-chip { padding: 5px 10px; }
    .daz-chips { gap: 6px; }

    .daz-big { font-size: 24px; }

    .daz-kv { min-height: 44px; }

    .daz-ibtn {
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }

    .daz-btn,
    .daz-btn-outline {
        min-height: 44px;
        border-radius: 10px;
        font-size: 15px;
    }

    .daz-note-band {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 14px 16px;
    }

    .daz-note-head {
        justify-content: space-between;
        align-items: center;
    }

    .daz-note-text {
        flex: none;
        font-size: 15px;
    }
}
