
/* ── LAYOUT ─────────────────────────────────────────────────────────── */
.bb-ar-layout {
    display: flex;
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    align-items: flex-start;
}

/* ── NAV LATERALE ───────────────────────────────────────────────────── */
.bb-ar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 200px;
    background: #f8f7f4;
    border-radius: 8px;
    padding: 1rem;
}

.bb-ar-nav__item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    color: #444;
    font-size: 0.95rem;
    transition: background 0.15s, color 0.15s;
}

.bb-ar-nav__item:hover {
    background: #ede8dc;
    color: #222;
}

.bb-ar-nav__item--active {
    background: #b8913a;
    color: #fff;
    font-weight: 600;
}

.bb-ar-nav__item--logout {
    margin-top: 1rem;
    border-top: 1px solid #e0ddd5;
    padding-top: 1rem;
    color: #777;
}

.bb-ar-nav__item--logout:hover {
    color: #c0392b;
    background: #fdf0ef;
}

/* ── MAIN CONTENT ───────────────────────────────────────────────────── */
.bb-ar-main {
    flex: 1;
    min-width: 0;
}

.bb-ar-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #222;
}

/* ── DASHBOARD ──────────────────────────────────────────────────────── */
.bb-ar-welcome h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: #333;
}

.bb-ar-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.bb-ar-stat-card {
    background: #fff;
    border: 1px solid #e8e3d8;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.bb-ar-stat-card--alert {
    border-color: #e67e22;
    background: #fef9f0;
}

.bb-ar-stat-card__number {
    font-size: 2rem;
    font-weight: 700;
    color: #b8913a;
    line-height: 1;
}

.bb-ar-stat-card--alert .bb-ar-stat-card__number {
    color: #e67e22;
}

.bb-ar-stat-card__label {
    font-size: 0.85rem;
    color: #666;
}

.bb-ar-stat-card__link {
    font-size: 0.82rem;
    color: #b8913a;
    text-decoration: none;
    margin-top: 0.5rem;
}

.bb-ar-stat-card__link:hover {
    text-decoration: underline;
}

.bb-ar-prossimo {
    background: #f0ede4;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.bb-ar-prossimo h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bb-ar-azioni {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2.6rem !important;
}

/* ── CARDS ──────────────────────────────────────────────────────────── */
.bb-ar-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bb-ar-card {
    background: #fff;
    border: 1px solid #e8e3d8;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
}

.bb-ar-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.bb-ar-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: #222;
    display: block;
}

.bb-ar-card__sub {
    font-size: 0.85rem;
    color: #777;
    display: block;
    margin-top: 0.2rem;
}

.bb-ar-card__body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #666;
}

.bb-ar-card__totale {
    font-weight: 600;
    color: #333;
}

.bb-ar-card__footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0ece3;
}

/* ── ANAGRAFICA ─────────────────────────────────────────────────────── */
.bb-ar-anagrafica__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 2rem;
}

.bb-ar-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.bb-ar-field__label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #666;
}

.bb-ar-field__value {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
}

.bb-ar-anagrafica__note {
    font-size: 0.85rem;
    color: #777;
}

.bb-ar-anagrafica__note a {
    color: #b8913a;
}

/* ── EMPTY STATE ────────────────────────────────────────────────────── */
.bb-ar-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.bb-ar-empty p {
    margin-bottom: 1rem;
}

/* ── BADGE ──────────────────────────────────────────────────────────── */
.bb-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.bb-badge--success  { background: #e8f5e9; color: #2e7d32; }
.bb-badge--warning  { background: #fff3e0; color: #e65100; }
.bb-badge--info     { background: #e3f2fd; color: #1565c0; }
.bb-badge--danger   { background: #fde8e8; color: #c0392b; }
.bb-badge--neutral  { background: #f0f0f0; color: #666; }

/* ── BOTTONI ────────────────────────────────────────────────────────── */
.bb-btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.15s;
}

.bb-btn:hover { opacity: 0.85; }

.bb-btn--primary {
    background: #b8913a;
    color: #fff;
}

.bb-btn--outline {
    border: 2px solid #b8913a;
    color: #b8913a;
    background: transparent;
}

.bb-btn--outline:hover {
    background: #b8913a;
    color: #fff;
    opacity: 1;
}

/* ── UPLOAD PROGRESS ────────────────────────────────────────────────── */
.bb-upload-progress {
    margin-top: 0.75rem;
    background: #f0ede4;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
}

.bb-upload-progress__bar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: #b8913a;
    transition: width 0.2s;
    border-radius: 6px;
}

.bb-upload-progress span {
    position: relative;
    z-index: 1;
    padding: 0 0.75rem;
    font-size: 0.82rem;
    color: #555;
}

.bb-upload-error {
    color: #c0392b;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .bb-ar-layout {
        flex-direction: column;
    }

    .bb-ar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        min-width: unset;
        width: 100%;
    }

    .bb-ar-stats {
        grid-template-columns: 1fr;
    }

    .bb-ar-anagrafica__grid {
        grid-template-columns: 1fr;
    }
}

/* ── FONT TORQUE ─────────────────────────────────────────────────────── */
.bb-ar-nav__item,
.bb-bottom-nav__item,
.bb-altro-drawer__item,
.bb-ar-welcome h2,
.bb-ar-title,
.bb-ar-stat-card__label,
.bb-ar-card__title,
.bb-ar-field__label,
.bb-btn {
    font-family: "Torque Light", sans-serif;
}

/* ── FIX SVG NAV ─────────────────────────────────────────────────────── */
.bb-ar-nav--desktop .bb-ar-nav__item svg {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0;
}

.bb-ar-nav--desktop .bb-ar-nav__item {
    font-size: 0.9rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.6rem !important;
}

/* ── OVERRIDE COLORI TESTO ───────────────────────────────────────────── */
.bb-prev-riepilogo__label  { color: #666 !important; }
.bb-prev-riepilogo__value  { color: #222 !important; }
.bb-prev-header__codice    { color: #666 !important; }
.bb-prev-table td          { color: #333 !important; }
.bb-ar-stat-card__label    { color: #666 !important; }
.bb-ar-stat-card__number   { color: #BE965A !important; }
.bb-ar-card__sub           { color: #666 !important; }
.bb-ar-card__title         { color: #222 !important; }
.bb-pag-info               { color: #666 !important; }
.bb-ar-field__label        { color: #666 !important; }
.bb-ar-field__value        { color: #222 !important; }

/* ── TESTO NERO ───────────────────────────────────────────────────────── */
.bb-ar-card__sub,
.bb-ar-card__body,
.bb-prev-riepilogo__label,
.bb-prev-riepilogo__value,
.bb-prev-header__codice,
.bb-prev-table td,
.bb-prev-table th,
.bb-ar-stat-card__label,
.bb-ar-field__label,
.bb-ar-field__value,
.bb-pag-info,
.bb-ar-anagrafica__note,
.bb-ar-empty p {
    color: #111 !important;
}

/* ── STAT CARDS ───────────────────────────────────────────────────────── */
.bb-ar-stat-card {
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-decoration: none;
    display: flex;
}
.bb-ar-stat-card:hover {
    border-color: #BE965A !important;
    box-shadow: 0 2px 12px rgba(190,150,90,0.12) !important;
}
.bb-ar-stat-card__number {
    font-size: 2.8rem !important;
}
.bb-ar-stat-card__label {
    font-size: 1rem !important;
}
.bb-ar-stat-card__link {
    font-size: 0.9rem !important;
}

/* ── STAT CARDS TESTO ─────────────────────────────────────────────────── */
.bb-ar-stat-card__label {
    font-size: 1.2rem !important;
    font-weight: 500 !important;
    color: #111 !important;
}
.bb-ar-stat-card__link {
    font-size: 1rem !important;
    margin-top: 0.25rem !important;
}

/* ── BOTTOM NAV ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .bb-bottom-nav__item {
        color: #333 !important;
        font-size: 0.78rem !important;
        font-weight: 500 !important;
    }
    .bb-bottom-nav__item svg {
        width: 26px !important;
        height: 26px !important;
        stroke-width: 1.8 !important;
    }
    .bb-bottom-nav__item.active {
        color: #BE965A !important;
    }
    .bb-bottom-nav__item.active svg {
        stroke-width: 2.2 !important;
    }
}

/* ── PAGINAZIONE ─────────────────────────────────────────────────────── */
.bb-pag-info {
    font-size: 0.8rem;
    color: #666 !important;
    margin-bottom: 1rem;
}
.bb-paginazione {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}
.bb-pag-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 0.5rem !important;
    border-radius: 6px !important;
    border: 1px solid #e8e3d8 !important;
    background: #fff !important;
    color: #444 !important;
    font-size: 0.88rem !important;
    text-decoration: none !important;
    transition: all 0.15s !important;
    cursor: pointer !important;
}
.bb-pag-btn:hover {
    border-color: #BE965A !important;
    color: #BE965A !important;
}
.bb-pag-btn--active {
    background: #BE965A !important;
    border-color: #BE965A !important;
    color: #fff !important;
    font-weight: 600 !important;
}
.bb-pag-btn--disabled {
    opacity: 0.35 !important;
    cursor: default !important;
    pointer-events: none !important;
}
.bb-pag-dots {
    color: #aaa;
    font-size: 0.88rem;
    padding: 0 0.25rem;
}

/* ── STORICO MANUALE ─────────────────────────────────────────────────── */
.bb-ar-storico .bb-contratto-azioni {
    margin-top: 1rem !important;
    padding-top: 0.75rem !important;
}

/* ── DASHBOARD MOBILE ────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .bb-ar-welcome h2 {
        font-size: 1.6rem !important;
        font-weight: 700 !important;
    }
    .bb-ar-section-title {
        font-size: 1.1rem !important;
        font-weight: 700 !important;
    }
    .bb-ar-ul-card__title {
        font-size: 1.3rem !important;
        font-weight: 700 !important;
    }
    .bb-ar-ul-card__modello {
        font-size: 1rem !important;
        font-weight: 500 !important;
        color: #666 !important;
    }
    .bb-ar-ul-card__date {
        font-size: 1rem !important;
        font-weight: 600 !important;
        color: #333 !important;
    }
    .bb-ar-ul-card__manual {
        font-size: 0.95rem !important;
        padding: 0.7rem 1.2rem !important;
    }
    .bb-ar-ul-card {
        text-align: left !important;
    }

    /* ── FONT GLOBALI MOBILE ── */
    .bb-ar-title { font-size: 1.5rem !important; font-weight: 700 !important; }

    /* Stat cards */
    .bb-ar-stat-card__number { font-size: 2.4rem !important; }
    .bb-ar-stat-card__label  { font-size: 1.1rem !important; font-weight: 600 !important; }
    .bb-ar-stat-card__link   { font-size: 0.95rem !important; }

    /* Cards preventivi / contratti */
    .bb-ar-card__title  { font-size: 1.1rem !important; font-weight: 700 !important; }
    .bb-ar-card__sub    { font-size: 0.95rem !important; }
    .bb-ar-card__body   { font-size: 1rem !important; }
    .bb-ar-card__totale { font-size: 1rem !important; font-weight: 700 !important; }

    /* Badge */
    .bb-badge { font-size: 0.88rem !important; padding: 0.3rem 0.85rem !important; }

    /* Bottoni */
    .bb-btn { font-size: 1rem !important; padding: 0.75rem 1.5rem !important; }

    /* Anagrafica */
    .bb-ar-field__label { font-size: 0.9rem !important; }
    .bb-ar-field__value { font-size: 1.05rem !important; font-weight: 600 !important; }

    /* Preventivo dettaglio */
    .bb-prev-riepilogo__label { font-size: 0.9rem !important; }
    .bb-prev-riepilogo__value { font-size: 1rem !important; font-weight: 600 !important; }
    .bb-prev-header__codice   { font-size: 1rem !important; }
    .bb-prev-table td,
    .bb-prev-table th         { font-size: 0.95rem !important; }

    /* Paginazione */
    .bb-pag-btn  { font-size: 1rem !important; min-width: 40px !important; height: 40px !important; }
    .bb-pag-info { font-size: 0.9rem !important; }

    /* Empty state */
    .bb-ar-empty p { font-size: 1rem !important; }
}
