/* --- VARIABILI --- */
:root {
    --csi-blue: #1e3a8a;
    --csi-navy: #0f172a;
    --csi-bg: #f8fafc;
    --csi-border: #e2e8f0;
    --csi-dark-slate: #1e293b;
    --csi-highlight: #3b82f6;
}

/* --- BASE --- */
html, body {
    height: auto;
    overflow-x: visible !important;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--csi-bg);
    color: #334155;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- TOP BAR --- */
.top-bar {
    background-color: #ffffff;
    border-bottom: 1px solid var(--csi-border);
    font-size: 0.75rem;
    padding: 8px 0;
}
.top-bar strong { color: var(--csi-blue); }

/* --- HEADER STICKY --- */
.header-sticky-container {
    position: -webkit-sticky; 
    position: sticky !important;
    top: 0;
    z-index: 1050 !important;
    background: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.main-header {
    background: white !important;
    border-bottom: 4px solid var(--csi-blue);
    padding: 15px 0; /* Aumentato padding per logo più grande */
}

/* LOGO INGRANDITO */
.logo-img { 
    height: 85px; 
    width: auto; 
}

.logo-title-main {
    font-size: 1.25rem;
    color: var(--csi-blue);
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
}

.logo-title-sub {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- MENU NAVIGATION --- */
.bg-dark { background-color: var(--csi-dark-slate) !important; }

#subNavbar .nav-link {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8) !important;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    padding: 15px 20px !important;
}

#subNavbar .nav-link:hover,
#subNavbar .nav-link.active {
    color: var(--csi-highlight) !important;
    border-bottom: 3px solid var(--csi-highlight);
    background-color: rgba(255, 255, 255, 0.05);
}

/* --- SIDEBAR WIDGETS --- */
.card-widget {
    border: 1px solid var(--csi-border);
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.widget-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--csi-blue);
    padding: 1rem;
    border-bottom: 1px solid var(--csi-border);
    margin: 0;
    text-align: center;
    background-color: #fcfdfe;
}

.list-group-item {
    border: none;
    padding: 14px 18px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: 0.2s;
}

.list-group-item.active {
    background-color: var(--csi-blue) !important;
    color: white !important;
    position: relative;
}

/* --- CAROUSEL --- */
.carousel-item img {
    height: 400px !important;
    object-fit: cover !important;
}

.carousel-caption {
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 50px;
    border-radius: 4px;
    bottom: 30px;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    width: fit-content !important;
    display: inline-block;
    max-width: 85%;
}

.carousel-caption h5 {
    font-size: 0.8rem !important;
    font-weight: 600;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: normal;
}

/* --- QUICK LINKS (RIGHTBAR) --- */
.btn-quick {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 15px;
    border-radius: 12px;
    font-weight: 700;
    margin-bottom: 12px;
    text-decoration: none;
    color: white !important;
    transition: 0.3s;
    font-size: 0.8rem;
    text-transform: uppercase;
}
.bg-albo { background-color: var(--csi-dark-slate); }
.bg-delibere { background-color: #3b82f6; }
.bg-determine { background-color: #1d4ed8; }

/* --- BOTTONI EXTRA SMALL --- */
.btn-xs {
    padding: 0.12rem 0.45rem;
    font-size: 0.7rem;
    line-height: 1.2;
}

.btn-xs i, 
.btn-xs .bi {
    font-size: 0.75rem;
}

/* --- TRASPARENZA & NEWS HOVER --- */
.hover-bg-light:hover {
    background-color: #f1f5f9;
    color: var(--csi-blue) !important;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .logo-img { height: 60px; }
    .logo-title-main { font-size: 1rem; }
    .logo-title-sub { font-size: 0.75rem; }
    .navbar-brand { white-space: normal !important; max-width: 75%; margin-right: 0; }
    .carousel-item img { height: 200px !important; }
    .carousel-caption { bottom: 15px; padding: 9px 50px; width: fit-content !important; }
    .carousel-caption h5 { font-size: 0.65rem !important; letter-spacing: -0.2px; }
}