/* Dashboard phone-first: solo ≤767.98px. Desktop invariato. */

.dashboard-phone {
    display: none;
}

@media (max-width: 767.98px) {
    .dashboard-desktop {
        display: none !important;
    }

    .dashboard-phone {
        display: block;
        padding-bottom: 1.25rem;
    }
}

@media (min-width: 768px) {
    .dashboard-phone {
        display: none !important;
    }
}

/* —— Welcome —— */
.dash-phone-welcome {
    margin: 0 0 1.1rem;
    padding: 0.15rem 0 0.85rem;
    border-bottom: 1px solid var(--surface-border, #e2e8f0);
}

.dash-phone-welcome__greeting {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.dash-phone-welcome__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}

.dash-phone-welcome__company {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* —— Sections —— */
.dash-phone-section {
    margin-bottom: 1.25rem;
}

.dash-phone-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
    min-height: 2rem;
}

.dash-phone-section__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.dash-phone-section__title .exo-lucide__svg {
    width: 1rem;
    height: 1rem;
    color: var(--text-muted, #64748b);
}

.dash-phone-empty {
    margin: 0;
    padding: 0.85rem 0;
    font-size: 0.875rem;
    color: var(--text-muted, #64748b);
}

/* —— Todos —— */
.dash-phone-todo {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dash-phone-todo__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 52px;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--surface-border, #e2e8f0);
    border-radius: 0.75rem;
    background: var(--surface-card, #fff);
    text-decoration: none;
    color: inherit;
}

.dash-phone-todo__item:active {
    background: color-mix(in srgb, var(--section-color, #4f46e5) 6%, transparent);
}

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

.dash-phone-todo__icon .exo-lucide__svg {
    width: 1rem;
    height: 1rem;
}

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

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

.dash-phone-todo__chevron {
    margin-left: auto;
    color: var(--text-muted, #94a3b8);
    display: inline-flex;
}

.dash-phone-todo__chevron .exo-lucide__svg {
    width: 0.95rem;
    height: 0.95rem;
}

.dash-phone-welcome__company {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.dash-phone-welcome__company .exo-lucide__svg {
    width: 0.85rem;
    height: 0.85rem;
}

.dash-phone-todo__body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1 1 auto;
}

.dash-phone-todo__title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.25;
}

.dash-phone-todo__meta {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
}

.dash-phone-todo__chevron {
    color: var(--text-muted, #94a3b8);
    flex-shrink: 0;
}

/* —— KPI —— */
.dash-phone-kpi-focus {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 0.55rem;
}

.dash-phone-kpi {
    padding: 0.9rem 1rem;
    border: 1px solid var(--surface-border, #e2e8f0);
    border-radius: 0.75rem;
    background: var(--surface-card, #fff);
}

.dash-phone-kpi--primary {
    padding: 1.05rem 1.1rem;
}

.dash-phone-kpi-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

.dash-phone-kpi__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.25rem;
}

.dash-phone-kpi__value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.dash-phone-kpi--primary .dash-phone-kpi__value {
    font-size: 1.65rem;
}

.dash-phone-kpi-more {
    display: grid;
    gap: 0.5rem;
}

.dash-phone-kpi--compact {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
}

.dash-phone-kpi--compact .dash-phone-kpi__label {
    margin: 0;
}

.dash-phone-kpi--compact .dash-phone-kpi__value {
    font-size: 1.05rem;
}

/* —— Quick actions grid (stile toolbar, non tile colorate) —— */
.dash-phone-quick {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border: 1px solid var(--surface-border, #e2e8f0);
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--surface-card, #fff);
}

.dash-phone-quick__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 4.5rem;
    padding: 0.7rem 0.35rem 0.6rem;
    border: 0;
    border-right: 1px solid var(--surface-border, #e2e8f0);
    border-bottom: 1px solid var(--surface-border, #e2e8f0);
    border-radius: 0;
    background: transparent;
    text-decoration: none;
    color: inherit;
    text-align: center;
}

.dash-phone-quick__item:nth-child(4n) {
    border-right: 0;
}

.dash-phone-quick__item:nth-last-child(-n+4) {
    border-bottom: 0;
}

.dash-phone-quick__item:active {
    border-color: var(--surface-border, #e2e8f0);
    background: color-mix(in srgb, var(--text-primary, #0f172a) 5%, transparent);
}

.dash-phone-quick__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;
}

.dash-phone-quick__label {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.2;
    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;
}

[data-bs-theme="dark"] .dash-phone-quick {
    border-color: rgba(255, 255, 255, 0.1);
    background: var(--surface-card, #1e1e1e);
}

[data-bs-theme="dark"] .dash-phone-quick__item {
    border-right-color: rgba(255, 255, 255, 0.08);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .dash-phone-quick__icon,
[data-bs-theme="dark"] .dash-phone-quick__label {
    color: #94a3b8;
}

/* —— Invoices —— */
.dash-phone-invoices {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.dash-phone-invoice {
    display: block;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--surface-border, #e2e8f0);
    border-radius: 0.75rem;
    background: var(--surface-card, #fff);
    text-decoration: none;
    color: inherit;
}

.dash-phone-invoice:active {
    background: color-mix(in srgb, var(--section-color, #4f46e5) 5%, transparent);
}

.dash-phone-invoice__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.dash-phone-invoice__number {
    font-weight: 700;
    font-size: 0.92rem;
}

.dash-phone-invoice__customer {
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.4rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-phone-invoice__bottom {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}

.dash-phone-invoice__bottom strong {
    font-size: 0.95rem;
    color: var(--bs-body-color, #0f172a);
}

.dash-phone-invoice__tag {
    margin-top: 0.35rem;
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
}

/* —— Charts —— */
.dash-phone-chart-card {
    border: 1px solid var(--surface-border, #e2e8f0);
    border-radius: 0.75rem;
    background: var(--surface-card, #fff);
    padding: 0.75rem;
}

.dash-phone-chart-card__body--doughnut {
    position: relative;
    height: 200px;
}

.dash-phone-chart-card__body--bar {
    position: relative;
    height: 220px;
}

.dash-phone-chart-card__body canvas {
    width: 100% !important;
    max-height: 100%;
}

/* —— Accordion —— */
.dash-phone-accordion .accordion-item {
    border: 1px solid var(--surface-border, #e2e8f0);
    border-radius: 0.75rem !important;
    overflow: hidden;
    background: var(--surface-card, #fff);
    margin-bottom: 0.5rem;
}

.dash-phone-accordion .accordion-item:last-child {
    margin-bottom: 0;
}

.dash-phone-accordion .accordion-button {
    min-height: 48px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: none !important;
    background: transparent;
    color: inherit;
}

.dash-phone-accordion .accordion-button:not(.collapsed) {
    background: color-mix(in srgb, var(--section-color, #4f46e5) 6%, transparent);
    color: inherit;
}

.dash-phone-accordion .accordion-body {
    font-size: 0.875rem;
}

/* —— Activity / news —— */
.dash-phone-activity {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dash-phone-activity li {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--surface-border, #e2e8f0);
    font-size: 0.85rem;
}

.dash-phone-activity li:last-child {
    border-bottom: none;
}

.dash-phone-activity li span {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
}

.dash-phone-news + .dash-phone-news {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--surface-border, #e2e8f0);
}

.dash-phone-news__title {
    display: block;
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
}

a.dash-phone-news__title:active {
    color: var(--section-color, #4f46e5);
}

.dash-phone-news__text {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}

.dash-phone-news__date {
    margin-top: 0.3rem;
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
}

[data-bs-theme="dark"] .dash-phone-welcome,
[data-bs-theme="dark"] .dash-phone-todo__item,
[data-bs-theme="dark"] .dash-phone-kpi,
[data-bs-theme="dark"] .dash-phone-quick__item,
[data-bs-theme="dark"] .dash-phone-invoice,
[data-bs-theme="dark"] .dash-phone-chart-card,
[data-bs-theme="dark"] .dash-phone-accordion .accordion-item {
    border-color: #2e2e2e;
}

@media (max-width: 380px) {
    .dash-phone-quick {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}


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