/* ===== Plan giornata interattivo: ricreazione della pagina "Plan giornata" del gestionale (jckite/src/stili/planning.css +
   inventario.css per kpi, schede, avvisi). Stessi colori e misure, prefisso .pl- ===== */
.pl { --pl-border: #d9edf6; --pl-muted: #5d6e86; --pl-text-2: #2f4566; --pl-text-3: #4f6280; --pl-navy: #163459;
    --pl-soft: #e7f8fd; --pl-ink: #0a7299; --pl-pos: #10b981; --pl-pos-soft: #ecfdf5; --pl-pos-ink: #027a48;
    --pl-warn: #f59e0b; --pl-warn-soft: #fffbeb; --pl-warn-deep: #92400e; --pl-neg-ink: #b42318; --pl-teal: #0d9488;
    --pl-grey-soft: #f2f4f7; --pl-grey-skel: #eef0f3; --pl-segment: #edf2f7;
    --pl-shadow: 0 1px 2px rgba(22, 52, 89, .05), 0 4px 14px rgba(22, 52, 89, .06);
    position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; background: #fcfcfc; color: var(--pl-navy);
    font: 400 14px/1.4 var(--sans); }

/* --- intestazione e navigazione tra i giorni --- */
.pl-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; }
.pl-title h3 { margin: 0 0 4px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.pl-title p { margin: 0; font-size: 13.5px; color: var(--pl-muted); }
.pl-when-tag { display: inline-block; margin-right: 8px; padding: 1px 9px; border-radius: 999px; background: var(--lp-azzurro); color: #fff; font-size: 12px; font-weight: 700; }
.pl-nav { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.pl-nav-row { display: flex; gap: 8px; }
.pl-datebox { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 4px 0 6px; border: 1px solid var(--pl-border); border-radius: 10px; background: #fff; box-shadow: var(--pl-shadow); }
.pl-datebox span { width: 30px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--pl-muted); font-size: 18px; cursor: pointer; user-select: none; }
.pl-datebox span:hover { color: var(--pl-ink); background: var(--pl-soft); }
.pl-datebox b { min-width: 150px; text-align: center; font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pl-datebox i { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--lp-azzurro); }
.pl-datebox i svg { width: 15px; height: 15px; fill: #fff; }
.pl-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--pl-segment); }
.pl-seg-btn { height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--pl-muted); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.pl-seg-btn:hover { color: var(--pl-navy); }
.pl-seg-btn.is-active { background: #fff; color: var(--pl-navy); box-shadow: 0 1px 3px rgba(22, 52, 89, .12); }
.pl-icon-btn { width: 40px; height: 40px; padding: 0; border: 1px solid var(--pl-border); border-radius: 10px; background: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--pl-shadow); }
.pl-icon-btn svg { width: 16px; height: 16px; fill: var(--pl-ink); }
.pl-icon-btn:hover { background: var(--pl-soft); }

/* --- prossimi giorni --- */
.pl-week { display: grid; grid-template-columns: repeat(7, minmax(104px, 1fr)); gap: 8px; overflow-x: auto; scrollbar-width: none; }
.pl-week::-webkit-scrollbar { display: none; }
.pl-day { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 11px; min-width: 0;
    border: 1px solid var(--pl-border); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; color: inherit; text-align: left;
    transition: border-color .15s, box-shadow .15s, transform .15s, background .15s; }
.pl-day:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(22, 52, 89, .08); }
.pl-day.is-active { border-color: var(--lp-azzurro); box-shadow: 0 0 0 2px rgba(7, 188, 231, .25); background: var(--pl-soft); }
.pl-day.is-today::after { content: ""; position: absolute; top: 10px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--lp-azzurro); }
.pl-day-top { display: flex; align-items: baseline; gap: 6px; }
.pl-day-top small { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--pl-muted); }
.pl-day-top b { font-size: 20px; font-weight: 700; line-height: 1.1; }
.pl-day-money { margin: 2px 0; padding: 1px 8px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--pl-grey-soft); color: var(--pl-text-3); font-variant-numeric: tabular-nums; }
.pl-day-money.is-pos { background: var(--pl-pos-soft); color: var(--pl-pos-ink); }
.pl-day-stats { display: flex; gap: 9px; font-size: 12px; font-weight: 600; color: var(--pl-text-2); }
.pl-day-stats > span { display: inline-flex; align-items: center; gap: 3px; }
.pl-day-stats svg { width: 11px; height: 11px; fill: var(--pl-muted); }
.pl-day-stats i { font-style: normal; }
.pl-day-wind { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--pl-muted); }
.pl-day-wind svg { width: 11px; height: 11px; fill: currentColor; }
.pl-day-wind.is-good { color: var(--pl-teal); }
.pl-day-wind.is-none { opacity: .5; }

/* --- KPI --- */
.pl-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.pl-kpi { display: flex; align-items: center; gap: 10px; padding: 9px 12px; min-width: 0; background: #fff; border: 1px solid var(--pl-border); border-radius: 14px; box-shadow: var(--pl-shadow); }
.pl-kpi-icon { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--pl-pos-soft); }
.pl-kpi-icon svg { width: 14px; height: 14px; fill: var(--pl-pos-ink); }
.pl-kpi:nth-child(2) .pl-kpi-icon, .pl-kpi:nth-child(3) .pl-kpi-icon, .pl-kpi:nth-child(4) .pl-kpi-icon, .pl-kpi:nth-child(5) .pl-kpi-icon, .pl-kpi:nth-child(6) .pl-kpi-icon { background: var(--pl-soft); }
.pl-kpi:nth-child(2) .pl-kpi-icon svg, .pl-kpi:nth-child(3) .pl-kpi-icon svg, .pl-kpi:nth-child(4) .pl-kpi-icon svg, .pl-kpi:nth-child(5) .pl-kpi-icon svg, .pl-kpi:nth-child(6) .pl-kpi-icon svg { fill: var(--pl-ink); }
.pl-kpi-txt { display: flex; flex-direction: column; min-width: 0; }
.pl-kpi-txt small { font-size: 11.5px; color: var(--pl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-kpi-txt b { font-size: 16.5px; font-weight: 700; line-height: 1.25; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pl-kpi-txt em { font-style: normal; font-size: 11.5px; color: var(--pl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- avvisi con l'azione: si chiudono quando risolti --- */
.pl-alerts { display: flex; flex-direction: column; gap: 6px; }
.pl-alert { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--lp-azzurrino); background: var(--pl-soft); color: var(--pl-navy);
    font: inherit; font-size: 13px; text-align: left; cursor: pointer; overflow: hidden; max-height: 60px; opacity: 1;
    transition: max-height .35s var(--uscita), opacity .25s, padding .35s var(--uscita), margin .35s var(--uscita), border-width .35s, filter .15s; }
.pl-alert.is-warn { border-color: #fde7b0; background: var(--pl-warn-soft); color: var(--pl-warn-deep); }
.pl-alert:hover { filter: brightness(.98); }
.pl-alert > i { flex: 0 0 auto; width: 16px; height: 16px; display: inline-flex; }
.pl-alert > i svg { width: 16px; height: 16px; fill: var(--pl-ink); }
.pl-alert.is-warn > i svg { fill: var(--lp-warn-ink, #b45309); }
.pl-alert > span { flex: 1; min-width: 0; }
.pl-alert > b { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-weight: 600; color: var(--pl-ink); }
.pl-alert.is-warn > b { color: var(--pl-warn-deep); }
.pl-alert > b svg { width: 14px; height: 14px; fill: currentColor; transition: translate .15s; }
.pl-alert:hover > b svg { translate: 3px 0; }
.pl-alert.is-risolto { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; margin-bottom: -6px; border-width: 0; pointer-events: none; }
.pl-allgood { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--pl-pos-soft); color: var(--pl-pos-ink); font-size: 13.5px; font-weight: 500; }
.pl-allgood svg { width: 16px; height: 16px; fill: currentColor; }

/* --- schede e "Come sarà la giornata" --- */
.pl-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--pl-border); overflow-x: auto; scrollbar-width: none; }
.pl-tabs::-webkit-scrollbar { display: none; }
.pl-tab { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px 11px; white-space: nowrap; border: 0; background: none;
    font: inherit; font-size: 14px; font-weight: 600; color: var(--pl-muted); cursor: pointer; border-radius: 10px 10px 0 0; transition: color .15s, background .15s; }
.pl-tab:hover { color: var(--pl-navy); background: rgba(7, 188, 231, .05); }
.pl-tab.is-active { color: var(--pl-navy); }
.pl-tab.is-active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--lp-azzurro); }
.pl-tab-badge { min-width: 20px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700; font-style: normal; background: #eceef2; color: var(--pl-text-3); text-align: center; }
.pl-card { background: #fff; border: 1px solid var(--pl-border); border-radius: 14px; box-shadow: var(--pl-shadow); }
.pl-card-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.pl-card-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.pl-ico { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--pl-soft); }
.pl-ico svg { width: 14px; height: 14px; fill: var(--pl-ink); }
.pl-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 14px 18px 18px; }
.pl-stats > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: #f8f9fb; border: 1px solid var(--pl-grey-skel); }
.pl-stats small { font-size: 12px; font-weight: 600; color: var(--pl-muted); }
.pl-stats b { font-size: 24px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.pl-stats b span { font-size: 15px; color: var(--pl-muted); font-weight: 600; }
.pl-stats em { font-style: normal; font-size: 12px; color: var(--pl-muted); }

/* --- guida e messaggi (come l'agenda) --- */
.pl-guida { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px; border-radius: 12px; background: var(--lp-tenue); color: var(--pl-navy); font-size: 13.5px; }
.pl-guida-n { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--lp-azzurro); color: var(--lp-navy-profondo); font-size: 12px; font-weight: 700; }
.pl-guida p { margin: 0; flex: 1; }
.pl-guida b { font-weight: 600; }
.pl-guida button, .pl-guida a { flex: 0 0 auto; font: inherit; font-size: 13px; font-weight: 600; color: var(--lp-azzurro-ink); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.pl-guida.is-fine { background: var(--pl-navy); color: #fff; }
.pl-guida.is-fine .pl-guida-n { background: #6ee7b7; color: #05603a; }
.pl-guida.is-fine a, .pl-guida.is-fine button { color: var(--lp-azzurrino); }
.pl-toast { position: absolute; left: 50%; bottom: 74px; z-index: 40; translate: -50% 12px; max-width: min(92%, 440px); padding: 10px 14px; border-radius: 10px;
    background: var(--pl-navy); color: #fff; font-size: 13px; line-height: 1.4; box-shadow: 0 12px 30px rgba(22, 52, 89, .3); opacity: 0; pointer-events: none; transition: opacity .25s, translate .25s var(--uscita); }
.pl-toast.is-neg { background: #fef2f2; color: var(--pl-neg-ink); box-shadow: 0 12px 30px rgba(180, 35, 24, .18), inset 0 0 0 1px #fecaca; }
.pl-toast.is-visibile { opacity: 1; translate: -50% 0; }

@media (max-width: 760px) {
    .pl { padding: 12px; gap: 10px; }
    .pl-head { align-items: stretch; }
    .pl-title h3 { font-size: 19px; }
    .pl-nav { align-items: stretch; }
    .pl-datebox b { flex: 1; min-width: 0; }
    .pl-nav-row .pl-seg { flex: 1; }
    .pl-nav-row .pl-seg-btn { flex: 1; height: 36px; }
    .pl-week { grid-template-columns: repeat(7, 96px); margin: 0 -12px; padding: 2px 12px; }
    .pl-kpis { display: flex; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 2px 12px 6px; }
    .pl-kpis::-webkit-scrollbar { display: none; }
    .pl-kpi { flex: 0 0 auto; min-width: 150px; }
    .pl-alert { font-size: 12.5px; padding: 9px 12px; flex-wrap: wrap; max-height: 96px; }
    .pl-alert > b { margin-left: 26px; }
    .pl-tab { padding: 10px 10px 11px; font-size: 13.5px; }
    .pl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 12px 14px; }
    .pl-stats b { font-size: 20px; }
    .pl-guida { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
    .pl-alert, .pl-day, .pl-toast, .pl-alert > b svg { transition: none; }
}
