/* Welcome allineato al page-header (stessa riga) */
.page-header:has(.dashboard-welcome) .page-header__row {
    align-items: center;
}

.page-header .dashboard-welcome {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    text-align: right;
    max-width: min(420px, 100%);
}

.dashboard-welcome__greeting {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
}

.dashboard-welcome__meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0.15rem 0 0;
    line-height: 1.3;
}

.dashboard-welcome__sep {
    opacity: 0.7;
    line-height: 1;
}

.dashboard-welcome__date {
    line-height: 1.3;
}

@media (max-width: 767.98px) {
    .page-header .dashboard-welcome {
        text-align: left;
        max-width: none;
        width: 100%;
    }

    .dashboard-welcome__meta {
        justify-content: flex-start;
    }
}

.dashboard-quick-card .card-body {
    padding: 0.65rem 0.5rem 0.55rem;
    overflow: visible;
}

.dashboard-quick-card .card-header {
    border-bottom: 1px solid var(--surface-border, #e2e8f0);
}

/* Toolbar azioni rapide — look gestionale, non “app tile” */
.quick-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

.quick-action {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 4.75rem;
    max-width: 100%;
    padding: 0.7rem 0.4rem 0.65rem;
    border-radius: 0;
    border: 0;
    border-right: 1px solid var(--surface-border, #e2e8f0);
    background: transparent;
    text-decoration: none;
    color: var(--text-primary, #0f172a);
    transition: background 0.15s ease, color 0.15s ease;
    min-height: 4.5rem;
    box-shadow: none;
}

.quick-action:last-child {
    border-right: 0;
}

.quick-action:hover {
    box-shadow: none;
    border-color: var(--surface-border, #e2e8f0);
    color: var(--text-primary, #0f172a);
    background: color-mix(in srgb, var(--text-primary, #0f172a) 4%, transparent);
}

.quick-action:hover .quick-action__icon {
    color: var(--text-primary, #0f172a);
}

.quick-action__icon {
    width: auto;
    height: auto;
    min-height: 1.25rem;
    border-radius: 0;
    background: transparent;
    color: var(--text-muted, #64748b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-bottom: 0.4rem;
    flex-shrink: 0;
}

.quick-action__label {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.25;
    color: var(--text-muted, #64748b);
    max-width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    word-break: break-word;
    hyphens: auto;
}

.quick-action:hover .quick-action__label {
    color: var(--text-primary, #0f172a);
}

[data-bs-theme="dark"] .quick-action {
    border-right-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary, #f4f7fb);
}

[data-bs-theme="dark"] .quick-action:hover {
    background: rgba(255, 255, 255, 0.04);
    border-right-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .quick-action__icon,
[data-bs-theme="dark"] .quick-action__label {
    color: #94a3b8;
}

[data-bs-theme="dark"] .quick-action:hover .quick-action__icon,
[data-bs-theme="dark"] .quick-action:hover .quick-action__label {
    color: #f1f5f9;
}

@media (max-width: 767.98px) {
    .dashboard-quick-card .card-body {
        padding: 0.55rem 0.35rem 0.45rem;
    }

    .quick-action {
        min-width: 4.25rem;
        min-height: 4.1rem;
        padding: 0.55rem 0.3rem;
    }

    .quick-action__label {
        font-size: 0.68rem;
    }
}

/* Picker personalizzazione (modale) */
#quickActionsModal .quick-actions-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 0.75rem;
}

#quickActionsModal .quick-actions-picker__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.45rem;
    min-height: 96px;
    padding: 0.85rem 0.65rem 0.75rem;
    margin: 0;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

#quickActionsModal .quick-actions-picker__item:hover {
    border-color: #4f46e5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.12);
    transform: translateY(-1px);
}

#quickActionsModal .quick-actions-picker__item.is-selected {
    border-color: #4f46e5;
    background: rgba(79, 70, 229, 0.08);
    box-shadow: inset 0 0 0 1px #4f46e5, 0 2px 8px rgba(79, 70, 229, 0.12);
}

#quickActionsModal .quick-actions-picker__check {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

#quickActionsModal .quick-actions-picker__item::after {
    content: '';
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 999px;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    z-index: 1;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

#quickActionsModal .quick-actions-picker__item.is-selected::after {
    border-color: #4f46e5;
    background: #4f46e5;
    box-shadow: inset 0 0 0 2px #fff;
}

#quickActionsModal .quick-actions-picker__icon {
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    color: var(--text-muted, #64748b);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    line-height: 1;
}

#quickActionsModal .quick-actions-picker__item.is-selected .quick-actions-picker__icon {
    background: transparent;
    color: var(--text-primary, #0f172a);
}

#quickActionsModal .quick-actions-picker__label {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
    color: inherit;
}

[data-bs-theme="dark"] #quickActionsModal .quick-actions-picker__item {
    background: #171717;
    border-color: #2e2e2e;
    color: #ececec;
    box-shadow: none;
}

[data-bs-theme="dark"] #quickActionsModal .quick-actions-picker__item:hover,
[data-bs-theme="dark"] #quickActionsModal .quick-actions-picker__item.is-selected {
    border-color: #818cf8;
    background: rgba(129, 140, 248, 0.14);
    box-shadow: inset 0 0 0 1px #818cf8;
}

[data-bs-theme="dark"] #quickActionsModal .quick-actions-picker__item::after {
    background: #222;
    border-color: #525252;
}

[data-bs-theme="dark"] #quickActionsModal .quick-actions-picker__item.is-selected::after {
    background: #818cf8;
    border-color: #818cf8;
}

[data-bs-theme="dark"] #quickActionsModal .quick-actions-picker__icon {
    background: rgba(129, 140, 248, 0.18);
    color: #a5b4fc;
}

[data-bs-theme="dark"] #quickActionsModal .quick-actions-picker__item.is-selected .quick-actions-picker__icon {
    background: #818cf8;
    color: #0c0c0c;
}

.todo-list .todo-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--surface-border);
}

.todo-list .todo-item:last-child {
    border-bottom: none;
}

.todo-item__icon {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
    background: color-mix(in srgb, var(--text-primary, #0f172a) 4%, transparent);
    color: var(--text-muted, #64748b);
    border: 1px solid var(--surface-border, #e2e8f0);
}

.todo-item__icon .exo-lucide__svg {
    width: 0.95rem;
    height: 0.95rem;
}

.todo-item__icon--danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.todo-item__icon--warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.todo-item__icon--info { background: #f8fafc; color: #475569; border-color: #e2e8f0; }

[data-bs-theme="dark"] .todo-item__icon {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

[data-bs-theme="dark"] .todo-item__icon--danger { background: #3a1212; color: #fca5a5; border-color: #7f1d1d; }
[data-bs-theme="dark"] .todo-item__icon--warning { background: #3a2a10; color: #fcd34d; border-color: #78350f; }
[data-bs-theme="dark"] .todo-item__icon--info { background: rgba(255, 255, 255, 0.04); color: #cbd5e1; border-color: rgba(255, 255, 255, 0.1); }

.dashboard-welcome__company {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    line-height: 1.3;
    min-height: 1.3em;
}

.dashboard-welcome__company .exo-lucide__svg,
.dashboard-welcome__company .bi {
    width: 0.85rem;
    height: 0.85rem;
    font-size: 0.85rem;
    line-height: 1;
    flex: 0 0 auto;
    color: var(--text-muted, #64748b);
    vertical-align: middle;
}

.todo-item__title {
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
}

.todo-item__meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.news-feed .news-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--surface-border);
}

.news-feed .news-item:last-child {
    border-bottom: none;
}

.news-item__title {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
}

.news-item__text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.news-item__date {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.chart-card .card-body {
    position: relative;
    min-height: 220px;
}

.dashboard-charts-row .chart-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
}

.dashboard-charts-row .chart-card .card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    height: 280px;
    padding-bottom: 1rem;
}

.dashboard-charts-row .chart-card .card-body canvas {
    flex: 1 1 auto;
    width: 100% !important;
    max-height: 100%;
}

@media (max-width: 991.98px) {
    .dashboard-charts-row .chart-card .card-body {
        min-height: 240px;
        height: 240px;
    }
}


/* Lucide quick actions — monochrome, stroke leggero */
.quick-action__icon .exo-lucide__svg,
.dash-phone-quick__icon .exo-lucide__svg,
.quick-actions-picker__icon .exo-lucide__svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  stroke: currentColor;
  fill: none;
}
.dash-phone-quick__icon .exo-lucide__svg { width: 1.2rem; height: 1.2rem; }
.quick-action__icon > i.bi,
.dash-phone-quick__icon > i.bi,
.quick-actions-picker__icon > i.bi { display: none !important; }
