/* ================================================================
   Moodash — CSS moderno (override AdminLTE 3)
   Font: Inter | Schema colori: violet-blue gradient
   ================================================================ */

/* === FONT === */
body,
.navbar,
.sidebar,
.card,
.content-header,
.main-footer,
.btn,
.table,
input,
select,
textarea {
    font-family: 'Inter', sans-serif !important;
}

/* ================================================================
   LOGIN PAGE
   ================================================================ */
body.login-page {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
}

.login-box {
    width: 420px;
}

.login-logo {
    margin-bottom: 10px;
}

.login-logo a {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-logo a b { color: #a78bfa; }

.login-logo .brand-svg {
    display: block;
}

.card.login-card {
    border-radius: 20px !important;
    border: none !important;
    box-shadow: 0 25px 60px rgba(0,0,0,0.4) !important;
    overflow: hidden;
}

.login-card-body {
    padding: 28px 32px !important;
}

.login-card-body .input-group-text {
    background: #f8f9fa;
    border-left: none;
    color: #6c757d;
}

.login-card-body .form-control {
    border-right: none;
    border-color: #dee2e6;
}

.login-card-body .form-control:focus {
    border-color: #a78bfa;
    box-shadow: 0 0 0 0.2rem rgba(167,139,250,0.25);
}

.login-card-body .btn-primary {
    background: linear-gradient(135deg, #4158d0, #c850c0) !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600;
    padding: 8px 16px;
    width: 100%;
}

.login-card-body .btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    transition: all 0.2s;
}

.login-box-msg {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.main-sidebar {
    background: linear-gradient(180deg, #1a1d2e 0%, #2b3160 100%) !important;
}

.sidebar-dark-primary .nav-sidebar .nav-link {
    border-radius: 8px;
    margin: 1px 8px;
    transition: background 0.18s ease;
    color: rgba(255,255,255,0.75);
}

.sidebar-dark-primary .nav-sidebar .nav-link:hover {
    background: rgba(255,255,255,0.10) !important;
    color: #fff;
}

.sidebar-dark-primary .nav-sidebar .nav-link.active {
    background: rgba(167,139,250,0.22) !important;
    color: #fff;
}

.sidebar-dark-primary .nav-sidebar .nav-icon {
    color: rgba(255,255,255,0.5);
}

.sidebar-dark-primary .nav-sidebar .nav-link.active .nav-icon {
    color: #a78bfa;
}

.sidebar-dark-primary .nav-header {
    color: rgba(255,255,255,0.35) !important;
    font-size: 0.7rem;
    letter-spacing: 1px;
    font-weight: 600;
    padding: 10px 16px 4px;
}

.brand-link {
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
    padding: 12px 16px !important;
    text-decoration: none !important;
}

.brand-link:hover { background: transparent !important; }

.brand-text {
    font-size: 1rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, #a78bfa, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ================================================================
   NAVBAR
   ================================================================ */
.main-header.navbar {
    box-shadow: 0 2px 12px rgba(0,0,0,0.07) !important;
    border-bottom: none !important;
    background: #fff !important;
}

.main-header.navbar .nav-link {
    color: #6c757d !important;
    transition: color 0.15s;
}
.main-header.navbar .nav-link:hover { color: #4158d0 !important; }

/* ================================================================
   CONTENT
   ================================================================ */
.content-wrapper {
    background: #f0f2f8 !important;
}

.content-header h1 {
    font-weight: 700;
    font-size: 1.5rem;
    color: #1a1d2e;
}

/* ================================================================
   KPI SMALL-BOX
   ================================================================ */
.small-box {
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.09) !important;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.small-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.13) !important;
}

.small-box .inner h3 {
    font-size: 2.1rem !important;
    font-weight: 700 !important;
}

.small-box .inner p {
    font-size: 0.92rem;
    font-weight: 500;
    opacity: 0.9;
}

.small-box-footer {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Card colori KPI */
.small-box.bg-info    { background: linear-gradient(135deg, #17a2b8, #0d8fa1) !important; }
.small-box.bg-success { background: linear-gradient(135deg, #28a745, #1a8a35) !important; }
.small-box.bg-warning { background: linear-gradient(135deg, #ffc107, #e0a800) !important; }
.small-box.bg-primary { background: linear-gradient(135deg, #4158d0, #6f42c1) !important; }
.small-box.bg-danger  { background: linear-gradient(135deg, #dc3545, #bd2130) !important; }

/* Nuova card inattivi */
.small-box.bg-inattivi {
    background: linear-gradient(135deg, #fd7e14, #e55e00) !important;
    color: #fff !important;
}
.small-box.bg-inattivi .inner { color: #fff; }
.small-box.bg-inattivi .small-box-footer {
    background: rgba(0,0,0,0.1) !important;
    color: rgba(255,255,255,0.85) !important;
}

/* ================================================================
   CARD GRAFICI
   ================================================================ */
.card {
    border-radius: 14px !important;
    border: none !important;
    box-shadow: 0 2px 14px rgba(0,0,0,0.06) !important;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.09) !important;
}

.card-header {
    border-bottom: 1px solid rgba(0,0,0,0.05) !important;
    font-weight: 600;
    font-size: 0.92rem;
    color: #1a1d2e;
}

.card-outline.card-primary { border-top: 3px solid #4158d0 !important; }
.card-outline.card-success  { border-top: 3px solid #28a745 !important; }
.card-outline.card-warning  { border-top: 3px solid #ffc107 !important; }
.card-outline.card-info     { border-top: 3px solid #17a2b8 !important; }
.card-outline.card-danger   { border-top: 3px solid #dc3545 !important; }

/* Nuova card violet */
.card-outline.card-violet { border-top: 3px solid #7c3aed !important; }

/* ================================================================
   TABELLE
   ================================================================ */
.table thead th {
    background: #f8f9fc;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6c757d;
    border-top: none !important;
    border-bottom: 2px solid #e9ecef !important;
}

.table-hover tbody tr:hover td {
    background: #f0f4ff;
}

.table td { vertical-align: middle; }

/* ================================================================
   BOTTONI
   ================================================================ */
.btn {
    border-radius: 8px !important;
    font-weight: 500;
    transition: all 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.btn-primary,
.btn-primary:focus {
    background: linear-gradient(135deg, #4158d0, #c850c0) !important;
    border: none !important;
}

.btn-sm { border-radius: 6px !important; }
.btn-xs { border-radius: 5px !important; font-size: 0.75rem; padding: 2px 8px; }

/* ================================================================
   BADGE
   ================================================================ */
.badge {
    border-radius: 6px !important;
    font-weight: 500;
    font-size: 0.78rem;
    padding: 3px 8px;
}

/* ================================================================
   PROGRESS BAR
   ================================================================ */
.progress {
    border-radius: 20px;
    height: 8px;
    background: #e9ecef;
}

.progress-bar { border-radius: 20px; }

/* ================================================================
   ALERT / FLASH
   ================================================================ */
.alert {
    border-radius: 12px !important;
    border: none !important;
    font-weight: 500;
}

/* ================================================================
   FOOTER
   ================================================================ */
.main-footer {
    border-top: 1px solid rgba(0,0,0,0.06) !important;
    color: #9faec5;
    font-size: 0.8rem;
    background: #fff;
}

/* ================================================================
   BREADCRUMB
   ================================================================ */
.breadcrumb {
    background: transparent !important;
    font-size: 0.83rem;
}

/* ================================================================
   TABS PER STORICO PER ISTANZA
   ================================================================ */
.history-tab-pills .nav-link {
    border-radius: 20px !important;
    padding: 3px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #6c757d;
    border: 1px solid #dee2e6;
    margin-left: 4px;
    background: transparent;
    transition: all 0.15s;
}

.history-tab-pills .nav-link.active,
.history-tab-pills .nav-link:hover {
    background: #4158d0 !important;
    border-color: #4158d0 !important;
    color: #fff !important;
}

/* ================================================================
   SCROLLBAR CUSTOM
   ================================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8cfe8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9fafd1; }

/* ================================================================
   RESPONSIVE TWEAKS
   ================================================================ */
@media (max-width: 576px) {
    .small-box .inner h3 { font-size: 1.6rem !important; }
    .login-box { width: 100%; padding: 16px; }
}
