/**
 * ============================================
 * STYLE.CSS - Ticketing NEITCUS���
 * Stili personalizzati applicazione
 * Versione: 1.0
 * Data: 02 Ottobre 2025
 * ============================================
 */

/* ============================================
   VARIABILI COLORI NEITCUS
   ============================================ */
:root {
    --neitcus-primary: #003B73;
    --neitcus-primary-dark: #002a52;
    --neitcus-primary-light: #0056a3;
    --neitcus-white: #FFFFFF;
    --neitcus-light-gray: #F5F7FA;
    --neitcus-gray: #E0E0E0;
    --neitcus-text: #333333;
    --neitcus-success: #28a745;
    --neitcus-danger: #dc3545;
    --neitcus-warning: #ffc107;
    --neitcus-info: #17a2b8;
}

/* ============================================
   RESET E GENERALE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--neitcus-primary) 0%, var(--neitcus-primary-light) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neitcus-text);
}

/* ============================================
   PAGINA LOGIN
   ============================================ */
.login-page {
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

.login-box {
    background: var(--neitcus-white);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
    animation: fadeInUp 0.5s ease-in-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    max-width: 280px;
    height: auto;
}

.login-title {
    color: var(--neitcus-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.login-form .form-label {
    font-weight: 500;
    color: var(--neitcus-text);
    margin-bottom: 0.5rem;
}

.login-form .form-control {
    border: 2px solid var(--neitcus-gray);
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-form .form-control:focus {
    border-color: var(--neitcus-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 59, 115, 0.15);
    outline: none;
}

.login-form .input-group-text {
    background-color: var(--neitcus-light-gray);
    border: 2px solid var(--neitcus-gray);
    border-right: none;
    border-radius: 8px 0 0 8px;
    color: var(--neitcus-primary);
}

.login-form .input-group .form-control {
    border-left: none;
    border-radius: 0;
}

.login-form .input-group .btn-outline-secondary {
    border: 2px solid var(--neitcus-gray);
    border-left: none;
    border-radius: 0 8px 8px 0;
    color: var(--neitcus-primary);
    background-color: var(--neitcus-light-gray);
}

.login-form .input-group .btn-outline-secondary:hover {
    background-color: var(--neitcus-gray);
    color: var(--neitcus-primary-dark);
}

.btn-primary {
    background-color: var(--neitcus-primary);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--neitcus-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 59, 115, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.login-form a {
    color: var(--neitcus-primary);
    transition: color 0.3s ease;
}

.login-form a:hover {
    color: var(--neitcus-primary-dark);
    text-decoration: underline;
}

.login-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--neitcus-gray);
}

.login-footer .text-muted {
    color: #6c757d !important;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ============================================
   ALERT
   ============================================ */
.alert {
    border-radius: 8px;
    border: none;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert i {
    font-size: 1.2rem;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* ============================================
   DASHBOARD
   ============================================ */
body.dashboard {
    background: var(--neitcus-light-gray);
    display: block;
    align-items: unset;
    justify-content: unset;
}

.navbar-neitcus,
.bg-neitcus {
    background-color: var(--neitcus-primary) !important;
}

.navbar {
    z-index: 1030;
}

.navbar-brand img {
    height: 50px !important;
    width: auto;
    transition: all 0.3s ease;
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-neitcus {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.card-neitcus:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-header {
    background-color: #e9ecef !important;
    color: #003B73 !important;
    border-bottom: 2px solid #003B73 !important;
    font-weight: 600;
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6,
.card-header p,
.card-header span,
.card-header i,
.card-header a {
    color: #003B73 !important;
}

.card-header .badge {
    background-color: #ffffff !important;
    color: #003B73 !important;
    font-weight: 700 !important;
    border: 2px solid #003B73 !important;
    padding: 6px 12px !important;
    font-size: 0.9rem !important;
}

/* ============================================
   TABELLE
   ============================================ */
.table thead,
.table thead.table-light {
    background-color: #003B73 !important;
}

.table thead th,
.table thead.table-light th {
    color: #ffffff !important;
    font-weight: 600;
}

.table tbody td {
    vertical-align: top !important;
}

.table tbody tr:hover {
    background-color: #f5f7fa;
    cursor: pointer;
}

/* ============================================
   BOTTONI
   ============================================ */
.btn-primary,
.btn-neitcus {
    background-color: #003B73 !important;
    border-color: #003B73 !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-neitcus:hover {
    background-color: #002a52 !important;
    border-color: #002a52 !important;
}

/* ============================================
   BADGE
   ============================================ */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ============================================
   UTILITY
   ============================================ */
.text-neitcus-primary {
    color: #003B73 !important;
}

.bg-neitcus-primary {
    background-color: #003B73 !important;
}

.border-neitcus {
    border-color: #003B73 !important;
}

.spinner-neitcus {
    border: 3px solid var(--neitcus-light-gray);
    border-top: 3px solid var(--neitcus-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .navbar-brand img {
        height: 40px !important;
    }
}

@media (max-width: 576px) {
    .login-box {
        padding: 30px 25px;
    }
    
    .login-logo img {
        max-width: 220px;
    }
    
    .login-title {
        font-size: 1.3rem;
    }
}

/* ======= [OVERRIDE NON DISTRUTTIVO] CONTRASTO HEADER & TABELLE =======
   Non rimuove stili esistenti. Solo correzioni di contrasto, con !important.
   Da incollare IN FONDO al file originale.                                       */

/* Titoli sezione (card header “sopra”, es. ‘Ultimi Ticket’): sfondo blu, testo bianco */
.card-header {
  background-color: #003B73 !important;
  color: #ffffff !important;
  border-bottom: 2px solid #002b55 !important;
}
.card-header h1, .card-header h2, .card-header h3,
.card-header h4, .card-header h5, .card-header h6,
.card-header span, .card-header i, .card-header a {
  color: #ffffff !important;
}

/* Evita “bianco su bianco” se qualcuno ha messo .text-white sugli header */
.card-header.text-white, .card-header .text-white, .card-header.text-white * {
  color: #ffffff !important;
}

/* Intestazioni tabella (thead “sotto”): sfondo chiaro, testo blu */
.table thead { background-color: #f0f4fa !important; }
.table thead th {
  color: #003B73 !important;
  font-weight: 600 !important;
  border-bottom: 2px solid #003B73 !important;
}

/* Badge/label coerenti (copre sia Bootstrap 4 che 5) */
.badge,
.label { border-radius: 8px; font-weight: 700; }

/* Priorità (blu) */
.badge-primary, .bg-primary, .label-primary {
  background-color: #006eff !important; color: #ffffff !important;
}

/* Stato “Chiuso” (scuro) */
.badge-dark, .bg-dark, .label-default {
  background-color: #333333 !important; color: #ffffff !important;
}

/* Stato “Aperto/Ok” (success) */
.badge-success, .bg-success, .label-success {
  background-color: #28a745 !important; color: #ffffff !important;
}

/* Stato “Attenzione” (warning) */
.badge-warning, .bg-warning, .label-warning {
  background-color: #ffcc00 !important; color: #000000 !important;
}

/* Sfondo pagina dashboard (se ereditava gradienti del login) */
body.dashboard {
  background: #F5F7FA !important;
  display: block !important;
  align-items: unset !important;
  justify-content: unset !important;
}

/* Hover righe tabella più leggibile */
.table-hover tbody tr:hover { background-color: #f3f8ff !important; }

/* ==========================================================
   UNIVERSAL DASHBOARD STYLE FIX
   Si applica a tutte le dashboard: clients, users, specializations, tickets
   ========================================================== */

/* HEADER CARD (es. “Clienti”, “Utenti”, “Specializzazioni”, ecc.) */
.card-header {
  background-color: #003B73 !important;
  color: #ffffff !important;
  border-bottom: 2px solid #002b55 !important;
  font-weight: 600 !important;
}
.card-header h1, .card-header h2, .card-header h3,
.card-header h4, .card-header h5, .card-header h6,
.card-header span, .card-header i, .card-header a {
  color: #ffffff !important;
}

/* TABELLE DI LISTA (thead di tutte le dashboard) */
.table thead {
  background-color: #f0f4fa !important;
}
.table thead th {
  color: #003B73 !important;
  font-weight: 600 !important;
  border-bottom: 2px solid #003B73 !important;
}

/* RIGHE */
.table tbody td {
  color: #222 !important;
}
.table-hover tbody tr:hover {
  background-color: #f3f8ff !important;
}

/* BADGE GLOBALI */
.badge, .label {
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 10px;
}

.badge-primary, .bg-primary, .label-primary {
  background-color: #006eff !important;
  color: #ffffff !important;
}
.badge-dark, .bg-dark, .label-default {
  background-color: #333333 !important;
  color: #ffffff !important;
}
.badge-success, .bg-success, .label-success {
  background-color: #28a745 !important;
  color: #ffffff !important;
}
.badge-warning, .bg-warning, .label-warning {
  background-color: #ffcc00 !important;
  color: #000000 !important;
}

/* BACKGROUND UNIFICATO PER TUTTE LE DASHBOARD */
body.dashboard {
  background: #F5F7FA !important;
}

/* PULSANTI COERENTI */
.btn-primary {
  background-color: #003B73 !important;
  border-color: #003B73 !important;
}
.btn-primary:hover {
  background-color: #00509e !important;
  border-color: #00509e !important;
}

/* ===== DASHBOARD THEAD: testo BLU su sfondo chiaro (override duro) ===== */

/* Sfondo chiaro imposto su ogni thead possibile */
table thead,
.table thead,
.table > thead,
.table > thead > tr {
  background-color: #f0f4fa !important;
}

/* Testo blu e opacità piena su TUTTE le celle thead */
table thead th,
.table thead th,
.table > thead > tr > th,
thead th[scope="col"],
.thead-dark th,         /* se usi .thead-dark */
.thead-light th {       /* se usi .thead-light */
  color: #003B73 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #003B73 !important; /* Chrome/WebKit */
  text-shadow: none !important;
  border-bottom: 2px solid #003B73 !important;
  font-weight: 600 !important;
}

/* Se qualcuno ha messo classi “bianche” sul thead, le annulliamo qui */
.table thead .text-white,
.table thead.text-white,
.table thead *[class*="text-white"] {
  color: #003B73 !important;
}

/* Neutralizza temi scuri applicati per errore */
.table thead.bg-dark,
.table thead.thead-dark,
.table thead .bg-dark {
  background-color: #f0f4fa !important;
  color: #003B73 !important;
}

/* Allineamento/coerenza righe */
.table tbody td { color: #222 !important; }
.table-hover tbody tr:hover { background-color: #f3f8ff !important; }

/* Header “sopra” (card title) resta blu con testo bianco */
.card-header {
  background-color: #003B73 !important;
  color: #ffffff !important;
  border-bottom: 2px solid #002b55 !important;
}
.card-header * { color: #ffffff !important; }

/* ===== FIX BADGE CHIARI SU CARD HEADER BLU ===== */

/* Badge chiari (es. “Disattivato”, “Attivo”) dentro intestazioni blu */
.card-header .badge-light,
.card-header .bg-light,
.card-header .badge-secondary,
.card-header .bg-secondary {
  background-color: #ffffff !important;
  color: #003B73 !important;
  border: 2px solid #ffffff !important;
  font-weight: 700 !important;
}

/* Per sicurezza, se c'è un .badge dentro header blu, forziamo contrasto */
.card-header .badge {
  background-color: #ffffff !important;
  color: #003B73 !important;
}

/* Aggiustamento estetico */
.card-header .badge {
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.85rem;
  vertical-align: middle;
}


