/* ============================================
   VARIABILI CSS
============================================ */
:root {
    --primary-color: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-dark: #1e40af;

    --secondary-color: #6b7280;
    --secondary-light: #9ca3af;
    --secondary-dark: #4b5563;

    --bg-light: #f8fafc;
    --bg-card: #ffffff;

    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #0ea5e9;

    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;

    --transition-speed: 0.3s;
}

/* ============================================
   RESET + BASE
============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
}

/* ============================================
   LAYOUT STRUCTURE (FOOTER FIX)
============================================ */
.layout-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    margin-top: 76px;
    padding: 2rem 0;
}

/* ============================================
   NAVBAR
============================================ */
.navbar {
    background-color: rgba(30, 58, 138, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1030;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 1px;
    color: white !important;
    font-size: 1.4rem;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    border-radius: 4px;
    transition: all var(--transition-speed);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-item.active .nav-link {
    background-color: rgba(255, 255, 255, 0.15);
    color: white !important;
}

.navbar .btn-outline-light {
    border-radius: 20px;
    padding: 0.35rem 1.2rem;
}

/* ============================================
   FOOTER
============================================ */
footer {
    background-color: var(--secondary-dark);
    color: white;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   ICONA HERO HOME
============================================ */
.icon-bubble-hero {
    width: 120px;
    height: 120px;
    flex: 0 0 120px;
    box-shadow: 0 18px 40px rgba(0,0,0,.25);
}

.icon-bubble-hero i {
    font-size: 56px;
}

/* ============================================
   CARDS
============================================ */
.card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--bg-card);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.card-title {
    color: var(--primary-color);
    font-weight: 600;
}

/* ============================================
   BUTTONS
============================================ */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* ============================================
   TYPOGRAPHY
============================================ */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    font-weight: 600;
}

.lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* ============================================
   FORMS
============================================ */
.form-control {
    border-radius: 6px;
}

.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

/* ============================================
   ANIMATION
============================================ */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

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


/* ============================================
   APP LAYOUT (SIDEBAR)
============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-content {
    flex: 1;
    padding: 2rem;
    background-color: var(--bg-light);
}

/* ============================================
   SIDEBAR
============================================ */

.sidebar {
    width: 260px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 1rem;

    /* 🔥 QUESTO */
    min-height: 100vh;
    position: sticky;
    top: 0;
}


.sidebar-header {
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.sidebar-nav {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.7rem 1rem;
    color: white;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
}

.sidebar-link:hover {
    background-color: rgba(255,255,255,0.15);
    transform: translateX(4px);
}

.sidebar-link.logout {
    border-color: rgba(239,68,68,0.7);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 0.8rem;
    opacity: 0.9;
}


/* ==============================
   MOBILE BOTTOM NAV
============================== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 64px;
    background: var(--primary-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1050;
}

.mobile-bottom-nav a {
    color: white;
    text-decoration: none;
    font-size: 0.75rem;
    text-align: center;
}

.mobile-bottom-nav i {
    font-size: 1.2rem;
    display: block;
}

.mobile-bottom-nav .center {
    background: var(--success-color);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: -24px;
}

.mobile-bottom-nav .center i {
    font-size: 1.4rem;
}

/* ==============================
   MOBILE DRAWER
============================== */
.mobile-drawer {
    position: fixed;
    bottom: 64px;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 -10px 20px rgba(0,0,0,0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1040;
}

.mobile-drawer.open {
    transform: translateY(0);
}

.mobile-drawer a {
    display: block;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
}

.mobile-drawer a.logout {
    color: var(--danger-color);
    font-weight: 600;
}

/* ==============================
   MOBILE CONTENT SPACING
============================== */
.mobile-content {
    padding-bottom: 80px;
}

/* ==============================
   ACTIVE LINK (DESKTOP)
============================== */
.sidebar-link.active {
    background-color: rgba(255,255,255,0.22);
    border-color: white;
    font-weight: 600;
    box-shadow: inset 4px 0 0 white;
}

/* ==============================
   ACTIVE LINK (MOBILE BOTTOM)
============================== */
.mobile-bottom-nav a.active {
    color: var(--success-color);
}

.mobile-bottom-nav a.active i {
    transform: scale(1.2);
}

/* ==============================
   ACTIVE LINK (MOBILE DRAWER)
============================== */
.mobile-drawer a.active {
    background-color: var(--bg-light);
    font-weight: 600;
    border-left: 4px solid var(--primary-color);
}


/* ==============================
   MOBILE ACTIVE STATE
============================== */
.mobile-bottom-nav a.active {
    color: var(--success-color);
}

.mobile-bottom-nav a.active i {
    transform: scale(1.15);
}

.mobile-drawer a.active {
    background-color: rgba(30, 58, 138, 0.08);
    font-weight: 600;
    border-left: 4px solid var(--primary-color);
}

/* Colore AmbuCore richiesto */
  .bg-ambucore{ background-color: rgb(30, 58, 138); }

  /* Cerchietti icone (stile dashboard) */
  .icon-bubble{
    width: 54px; height: 54px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 54px;
    box-shadow: 0 8px 18px rgba(0,0,0,.12);
  }
  .icon-bubble i{ font-size: 22px; line-height: 1; }

  .icon-bubble-sm{
    width: 40px; height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    box-shadow: 0 6px 14px rgba(0,0,0,.10);
  }
  .icon-bubble-sm i{ font-size: 16px; line-height: 1; }

  /* Sezioni */
  .section-card{ border: 1px solid rgba(0,0,0,.06); }

  /* Card mezzo */
  .vehicle-card{
    border: 1px solid rgba(0,0,0,.06);
  }
  .vehicle-code{
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: .3px;
  }

  /* Badge soft */
  .badge-soft-danger{
    background: rgba(220,53,69,.10);
    color: #dc3545;
    border: 1px solid rgba(220,53,69,.18);
  }
  .badge-soft-primary{
    background: rgba(13,110,253,.10);
    color: #0d6efd;
    border: 1px solid rgba(13,110,253,.18);
  }

  /* Empty state */
  .empty-state{
    border: 1px dashed rgba(0,0,0,.18);
    border-radius: 12px;
    padding: 18px;
    background: rgba(0,0,0,.02);
  }


  .icon-bubble{
    width: 54px;
    height: 54px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 54px;
    box-shadow: 0 8px 18px rgba(0,0,0,.12);
    background-color: rgb(30, 58, 138);
  }
  .icon-bubble i{
    font-size: 22px;
    line-height: 1;
  }

  /* tiles dashboard */
  .dash-tile{
    border: 1px solid rgba(0,0,0,.06);
    transition: transform .12s ease, box-shadow .12s ease;
    color: inherit;
  }
  .dash-tile:hover{
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(0,0,0,.12);
  }
  .dash-tile .chev{
    opacity: .35;
    transition: opacity .12s ease, transform .12s ease;
  }
  .dash-tile:hover .chev{
    opacity: .75;
    transform: translateX(2px);
  }