/* ddAdvisor — layout applicativo (sopra tokens.css) */

.dd-shell { display: flex; min-height: 100vh; }

.dd-sidebar {
    width: 240px;
    flex: 0 0 240px;
    background: var(--dd-navy-dark);
    color: #fff;
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
}
.dd-sidebar-foot {
    margin-top: auto;
    padding: 0.75rem 0.75rem 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
}
.dd-sidebar .dd-brand { padding: 0 0.5rem 1.25rem; }
.dd-sidebar .dd-brand img { max-width: 160px; }
.dd-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.78);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 2px;
    display: flex;
    gap: 0.6rem;
    align-items: center;
}
.dd-sidebar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.dd-sidebar .nav-link.active { color: #fff; background: var(--dd-primary); }

.dd-main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.dd-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.5rem;
    background: var(--dd-bg);
    border-bottom: 1px solid #eef0f3;
}
.dd-content { padding: 1.5rem; flex: 1 1 auto; }

/* Auth */
.dd-auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dd-bg-soft);
    padding: 1rem;
}
.dd-auth-card { width: 100%; max-width: 420px; }

/* Card sezioni documenti (8 box due diligence) */
.dd-doc-card {
    position: relative;
    overflow: hidden;
    background: #6ea0c329;
    border: 1px solid #e7eaee;
    border-radius: var(--dd-radius);
    padding: 1.1rem 0.85rem 0.9rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 22, 58, 0.06);
    transition: box-shadow 0.15s ease, transform 0.12s ease;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.dd-doc-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 22, 58, 0.1); }
.dd-doc-bg {
    position: absolute;
    right: -1rem;
    bottom: -1.5rem;
    font-size: 9rem;
    color: var(--dd-primary);
    opacity: 0.1;
    pointer-events: none;
    line-height: 1;
}
.dd-doc-num  { font-size: 1.9rem; font-weight: 700; color: var(--dd-primary); line-height: 1; position: relative; }
.dd-doc-name { color: var(--dd-navy); font-weight: 600; margin: 0.4rem 0 0.9rem; position: relative; }
.dd-doc-counters { margin-top: auto; display: flex; gap: 0.6rem; justify-content: center; font-size: 0.85rem; position: relative; flex-wrap: wrap; }
.dd-doc-counters .dd-tier b { color: #8a9099; font-weight: 600; margin-right: 1px; }

/* Pipeline lead (board a stage) */
.dd-pipeline { display: flex; gap: 0.6rem; padding-bottom: 0.5rem; }
.dd-pipe-col { flex: 1 1 0; min-width: 0; background: var(--dd-bg-soft); border-radius: var(--dd-radius); display: flex; flex-direction: column; }
@media (max-width: 991.98px) { .dd-pipeline { overflow-x: auto; } .dd-pipe-col { flex: 0 0 160px; } }
.dd-pipe-head { padding: 0.55rem 0.75rem; background: var(--dd-bg); border-radius: var(--dd-radius) var(--dd-radius) 0 0; }
.dd-pipe-body { padding: 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; min-height: 60px; }
.dd-pipe-card { display: block; background: var(--dd-bg); border: 1px solid #e7eaee; border-radius: 10px; padding: 0.55rem 0.65rem; box-shadow: 0 1px 2px rgba(0, 22, 58, 0.05); transition: box-shadow 0.12s ease; }
.dd-pipe-card:hover { box-shadow: 0 4px 12px rgba(0, 22, 58, 0.1); }

/* Chat */
.dd-chat-box { height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; padding: 0.25rem; }
.dd-msg { display: flex; }
.dd-msg-me { justify-content: flex-end; }
.dd-msg-bubble { max-width: 75%; background: #fff; border: 1px solid #e7eaee; border-radius: 12px; padding: 0.5rem 0.7rem; font-size: 0.9rem; box-shadow: 0 1px 2px rgba(0, 22, 58, 0.04); }
.dd-msg-me .dd-msg-bubble { background: var(--dd-primary); color: #fff; border-color: var(--dd-primary); }
.dd-msg-author { font-size: 0.72rem; font-weight: 600; color: var(--dd-primary); margin-bottom: 2px; }
.dd-msg-me .dd-msg-author { color: #fff; }
.dd-msg-time { font-size: 0.65rem; opacity: 0.6; margin-top: 2px; text-align: right; }

@media (max-width: 767.98px) {
    .dd-shell { flex-direction: column; }
    .dd-sidebar { width: 100%; flex-basis: auto; }
}

/* Avatar iniziali (Agenti / liste) */
.dd-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%;
    background: #6ea0c329; color: #0b2a4a; font-weight: 600; font-size: .8rem;
    flex: 0 0 34px;
}
/* Dashboard */
.dd-kpi { position: relative; overflow: hidden; }
.dd-kpi .dd-kpi-ico { position: absolute; right: -6px; bottom: -10px; font-size: 3.4rem; opacity: .08; color: #0b2a4a; }
.dd-chart-box { position: relative; height: 260px; }
.dd-overview-card { display: block; text-decoration: none; color: inherit; transition: transform .12s ease, box-shadow .12s ease; height: 100%; }
.dd-overview-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(11,42,74,.10); }
.dd-overview-card .bi { font-size: 1.5rem; color: #3da5d2; }

/* ===== Uniformità pulsanti in tutta l'app =====
   Stessa dimensione dei pulsanti revisionati del Catalogo servizi
   (btn-sm + padding orizzontale). Sovrascrive btn-lg/btn-sm nell'area app. */
.dd-main .btn,
.dd-main .btn-sm,
.dd-main .btn-lg {
    font-size: .8125rem;
    padding: .35rem 1rem;
    border-radius: .5rem;
    line-height: 1.5;
    font-weight: 500;
}
/* Bottoni icona-only (p-0 / btn-close) mantengono il loro padding */
.dd-main .btn.p-0,
.dd-main .btn-close {
    padding: 0;
}
.dd-main .btn-close { border-radius: 0; }
