/* Stili Tracciabilità Bovini */

:root {
    --primary-color: #0d6efd;
    --primary-dark: #0a58ca;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    box-sizing: border-box;
}

body {
    background-color: #f0f2f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

main {
    flex: 1;
    max-width: 100%;
    overflow-x: hidden;
}

/* ========================================
   ANIMAZIONI GLOBALI
   ======================================== */

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(100%);
    }
}

@keyframes iconSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Classe per animare elementi all'ingresso */
.animate-in {
    animation: fadeInUp 0.5s var(--ease-out) forwards;
}

.animate-in-delay-1 { animation-delay: 0.1s; opacity: 0; }
.animate-in-delay-2 { animation-delay: 0.2s; opacity: 0; }
.animate-in-delay-3 { animation-delay: 0.3s; opacity: 0; }
.animate-in-delay-4 { animation-delay: 0.4s; opacity: 0; }

/* ========================================
   LOGIN PAGE
   ======================================== */

.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 0 15px;
    animation: fadeInUp 0.6s var(--ease-out);
}

.login-card {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease;
}

.login-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

/* ========================================
   DASHBOARD CARDS (KPI)
   ======================================== */

.kpi-card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s var(--ease-out);
    overflow: hidden;
    position: relative;
    animation: fadeInUp 0.5s var(--ease-out) backwards;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.kpi-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.kpi-card .card-body {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.kpi-value {
    font-size: 2.2rem;
    font-weight: 700;
    word-break: break-word;
    transition: transform 0.3s var(--ease-bounce);
}

.kpi-card:hover .kpi-value {
    transform: scale(1.05);
}

.kpi-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Card con sfondo colorato: testo bianco */
.kpi-card.bg-primary .kpi-value,
.kpi-card.bg-success .kpi-value,
.kpi-card.bg-info .kpi-value,
.kpi-card.bg-danger .kpi-value {
    color: #fff;
}

.kpi-card.bg-primary .kpi-label,
.kpi-card.bg-success .kpi-label,
.kpi-card.bg-info .kpi-label,
.kpi-card.bg-danger .kpi-label {
    color: rgba(255, 255, 255, 0.85);
}

/* Card warning: testo bianco */
.kpi-card.bg-warning .kpi-value,
.kpi-card.bg-warning .kpi-label {
    color: #fff;
}

.kpi-card.bg-warning .kpi-label {
    color: rgba(255, 255, 255, 0.85);
}

/* ========================================
   TABLES
   ======================================== */

.table-container {
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    animation: fadeInUp 0.5s var(--ease-out);
    transition: box-shadow 0.3s ease;
}

.table-container:hover {
    box-shadow: var(--shadow-md);
}

.table-container table {
    min-width: 600px;
}

.table {
    margin-bottom: 0;
}

.table th {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
    padding: 0.875rem 0.75rem;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
    padding: 0.875rem 0.75rem;
    transition: background-color 0.2s ease;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.04);
    transform: scale(1.002);
}

.table td strong {
    word-break: break-all;
}

/* ========================================
   STATUS BADGES
   ======================================== */

.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
    border-radius: 6px;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
}

.badge:hover {
    transform: scale(1.05);
}

.badge-venduto {
    background: linear-gradient(135deg, var(--success-color), #157347);
    color: #fff;
    box-shadow: 0 2px 6px rgba(25, 135, 84, 0.3);
}

.badge-non-venduto {
    background: linear-gradient(135deg, var(--warning-color), #e0a800);
    color: #000;
    box-shadow: 0 2px 6px rgba(255, 193, 7, 0.3);
}

.badge-in_lavorazione,
.badge-in-lavorazione {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: #fff;
    box-shadow: 0 2px 6px rgba(108, 117, 125, 0.3);
}

.badge-completato {
    background: linear-gradient(135deg, var(--success-color), #157347);
    color: #fff;
    box-shadow: 0 2px 6px rgba(25, 135, 84, 0.3);
}

.badge-fatturato {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
}

/* ========================================
   FORMS
   ======================================== */

.form-container {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.5s var(--ease-out);
    transition: box-shadow 0.3s ease;
}

.form-container:hover {
    box-shadow: var(--shadow-md);
}

.form-control {
    border-radius: 8px;
    border: 1.5px solid #dee2e6;
    padding: 0.625rem 0.875rem;
    transition: all 0.25s ease;
}

.form-select {
    border-radius: 8px;
    border: 1.5px solid #dee2e6;
    padding: 0.625rem 2.25rem 0.625rem 0.875rem;
    transition: all 0.25s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* Select piccoli (form-select-sm) */
.form-select-sm {
    padding: 0.4rem 2rem 0.4rem 0.75rem;
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.4rem;
}

/* Dynamic Rows */
.capi-row {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    animation: fadeInUp 0.3s var(--ease-out);
}

.capi-row:hover {
    box-shadow: var(--shadow-sm);
    border-color: #dee2e6;
}

.btn-remove-row {
    color: var(--danger-color);
    transition: all 0.2s ease;
}

.btn-remove-row:hover {
    transform: scale(1.1);
}

/* ========================================
   CHARTS
   ======================================== */

.chart-container {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    overflow-x: auto;
    animation: fadeInUp 0.5s var(--ease-out);
    transition: all 0.3s ease;
}

.chart-container:hover {
    box-shadow: var(--shadow-md);
}

.chart-container h5 {
    font-weight: 600;
    color: #343a40;
    margin-bottom: 1rem;
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    animation: fadeInUp 0.4s var(--ease-out);
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.1), rgba(25, 135, 84, 0.05));
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 193, 7, 0.05));
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.1), rgba(13, 202, 240, 0.05));
    border-left: 4px solid var(--info-color);
}

.alert-floating {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1050;
    min-width: 280px;
    max-width: 90%;
    animation: slideInRight 0.4s var(--ease-out);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.25s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn:active::after {
    width: 200px;
    height: 200px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(13, 110, 253, 0.4);
    background: linear-gradient(135deg, #0b5ed7, #0a58ca);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #157347);
    border: none;
    box-shadow: 0 2px 8px rgba(25, 135, 84, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(25, 135, 84, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #e0a800);
    border: none;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #bb2d3b);
    border: none;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(220, 53, 69, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color), #0aa2c0);
    border: none;
    box-shadow: 0 2px 8px rgba(13, 202, 240, 0.3);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(13, 202, 240, 0.4);
}

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-warning:hover,
.btn-outline-danger:hover,
.btn-outline-info:hover {
    transform: translateY(-2px);
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}

.page-link {
    border-radius: 8px;
    border: none;
    margin: 0 2px;
    transition: all 0.2s ease;
}

.page-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

/* ========================================
   NAVBAR
   ======================================== */

.navbar {
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-size: 1rem;
    font-weight: 600;
    transition: transform 0.2s ease;
}

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

.nav-link {
    transition: all 0.2s ease;
    border-radius: 6px;
    margin: 0 2px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.2s var(--ease-out);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1), rgba(13, 110, 253, 0.05));
    transform: translateX(4px);
}

/* Action buttons in tables */
.table td .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* Action buttons wrapper */
.btn-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-actions .btn {
    transition: all 0.2s ease;
}

.btn-actions .btn:hover {
    transform: scale(1.1);
}

.table td:last-child {
    white-space: nowrap;
}

/* Bulk actions responsive */
.d-flex.gap-2 {
    flex-wrap: wrap;
}

/* ========================================
   CARDS
   ======================================== */

.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s var(--ease-out);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.card-header.bg-primary,
.card-header.bg-success,
.card-header.bg-warning,
.card-header.bg-danger,
.card-header.bg-info {
    background: linear-gradient(135deg, currentColor, currentColor) !important;
}

.list-group-item {
    border: none;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background-color: rgba(13, 110, 253, 0.04);
}

.list-group-item:last-child {
    border-bottom: none;
}

/* ========================================
   MODALS
   ======================================== */

.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid #f0f0f0;
    padding: 1rem 1.5rem;
}

.modal.fade .modal-dialog {
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s var(--ease-out);
}

.modal.show .modal-dialog {
    transform: scale(1) translateY(0);
}

/* ========================================
   LOADING SKELETON
   ======================================== */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* ========================================
   SCROLLBAR CUSTOM
   ======================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c1c1c1, #a1a1a1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a1a1a1, #818181);
}

/* ========================================
   HEADINGS
   ======================================== */

h2 {
    font-weight: 700;
    color: #212529;
    position: relative;
    display: inline-block;
}

h2 i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

/* ==================== */
/* RESPONSIVE BREAKPOINTS */
/* ==================== */

/* Tablet */
@media (max-width: 992px) {
    .kpi-value {
        font-size: 1.6rem;
    }
    
    .form-container {
        padding: 1rem;
    }
    
    .table-container {
        padding: 0.75rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    main.container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Dropdown notifiche/messaggi mobile - solo quelli con classe specifica */
    .dropdown-mobile-fullwidth .dropdown-menu {
        position: fixed !important;
        top: 56px !important;
        left: 10px !important;
        right: 10px !important;
        width: calc(100vw - 20px) !important;
        max-width: none !important;
        transform: none !important;
    }
    
    .kpi-value {
        font-size: 1.4rem;
    }
    
    .kpi-label {
        font-size: 0.75rem;
    }
    
    .kpi-card .card-body {
        padding: 1rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    h2 i {
        display: none;
    }
    
    /* Stack header buttons */
    .row.mb-4 .col-12.d-flex {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start !important;
    }
    
    .row.mb-4 .col-12.d-flex > div {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }
    
    .row.mb-4 .col-12.d-flex > div .btn {
        flex: 1;
    }
    
    /* Table adjustments */
    .table-container table {
        min-width: 500px;
    }
    
    .table th, .table td {
        padding: 0.4rem;
        font-size: 0.8rem;
    }
    
    .table td .btn {
        padding: 0.15rem 0.3rem;
        font-size: 0.7rem;
    }
    
    .btn-actions {
        gap: 6px;
    }
    
    .table td:last-child {
        white-space: normal;
    }
    
    /* Hide less important columns on mobile */
    .table .hide-mobile {
        display: none;
    }
    
    /* Form adjustments */
    .form-container {
        padding: 1rem;
    }
    
    .form-label {
        font-size: 0.85rem;
    }
    
    /* Capi rows */
    .capi-row .row {
        gap: 0.5rem;
    }
    
    .capi-row .col-md-2,
    .capi-row .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Bulk actions */
    .d-flex.justify-content-between.align-items-center.mb-3 {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch !important;
    }
    
    .d-flex.justify-content-between.align-items-center.mb-3 > div {
        width: 100%;
    }
    
    .d-flex.justify-content-between.align-items-center.mb-3 select {
        width: 100% !important;
    }
    
    /* Pagination */
    .d-flex.justify-content-between.align-items-center.flex-wrap.gap-2.mt-3 {
        flex-direction: column;
        gap: 1rem !important;
    }
    
    /* Charts */
    .chart-container {
        padding: 0.75rem;
    }
    
    .chart-container h5 {
        font-size: 1rem;
    }
    
    /* Login */
    .login-container {
        margin: 30px auto;
    }
    
    .login-card .card-body {
        padding: 1.5rem !important;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .kpi-value {
        font-size: 1.2rem;
    }
    
    .navbar-brand {
        font-size: 0.85rem;
    }
    
    .navbar-nav .nav-link {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    .table-container table {
        min-width: 400px;
    }
    
    .table th, .table td {
        padding: 0.3rem;
        font-size: 0.75rem;
    }
    
    .btn {
        font-size: 0.8rem;
        padding: 0.35rem 0.6rem;
    }
    
    .btn-sm {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Hide action text, show only icons */
    .table td .btn i {
        margin: 0;
    }
}

/* Print */
@media print {
    .navbar, footer, .btn, .no-print, .pagination, form > .d-flex {
        display: none !important;
    }
    
    .table-container {
        box-shadow: none;
        padding: 0;
    }
    
    .table {
        font-size: 10pt;
    }
}


/* ========================================
   TOOLTIP CUSTOM
   ======================================== */

[data-bs-toggle="tooltip"] {
    cursor: pointer;
}

.tooltip {
    animation: fadeIn 0.2s ease;
}

/* ========================================
   CHECKBOX & RADIO CUSTOM
   ======================================== */

.form-check-input {
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-check-input:checked {
    animation: pulse 0.3s ease;
}

.form-check-label {
    cursor: pointer;
    transition: color 0.2s ease;
}

.form-check-input:checked + .form-check-label {
    color: var(--primary-color);
}

/* ========================================
   SELECTION HIGHLIGHT
   ======================================== */

::selection {
    background: rgba(13, 110, 253, 0.2);
    color: inherit;
}

/* ========================================
   FOCUS STATES
   ======================================== */

*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ========================================
   LOADING STATES
   ======================================== */

.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Ripple effect per bottoni */
.btn-ripple {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    pointer-events: none;
    width: 100px;
    height: 100px;
    margin-left: -50px;
    margin-top: -50px;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ========================================
   EMPTY STATES
   ======================================== */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ========================================
   KEYBOARD SHORTCUTS PANEL
   ======================================== */

.keyboard-shortcuts-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.keyboard-shortcuts-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.shortcuts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: white;
}

.shortcuts-header h5 {
    margin: 0;
    font-size: 1rem;
}

.shortcuts-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.shortcuts-body {
    padding: 1rem 1.25rem;
    max-height: 50vh;
    overflow-y: auto;
}

.shortcuts-section {
    margin-bottom: 1rem;
}

.shortcuts-section:last-child {
    margin-bottom: 0;
}

.shortcuts-section h6 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
    font-size: 0.875rem;
}

.shortcut-item kbd {
    min-width: 70px;
    text-align: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-family: inherit;
    color: #495057;
}

.shortcut-item span {
    color: #212529;
}

.shortcut-item i {
    width: 16px;
    text-align: center;
    color: #6c757d;
}

.shortcuts-footer {
    padding: 0.75rem 1.25rem;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    text-align: center;
}

.shortcuts-footer kbd {
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 3px;
    padding: 0.1rem 0.3rem;
    font-size: 0.7rem;
}

/* Overlay quando il pannello è aperto */
.keyboard-shortcuts-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.keyboard-shortcuts-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Icona tastiera nella navbar - stesso stile delle altre icone */
.nav-link[title*="tastiera"] {
    transition: opacity 0.2s;
}

.nav-link[title*="tastiera"]:hover {
    opacity: 0.8;
}

/* Indicatore shortcut pending (quando si preme "g") */
.shortcut-pending-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.shortcut-pending-indicator.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.shortcut-pending-indicator kbd {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.85rem;
}

.shortcut-pending-indicator span {
    color: rgba(255, 255, 255, 0.8);
}

/* Responsive */
@media (max-width: 576px) {
    .keyboard-shortcuts-panel {
        width: 95%;
        max-height: 85vh;
    }
    
    .shortcuts-body {
        max-height: 55vh;
    }
    
    .shortcut-item kbd {
        min-width: 60px;
        font-size: 0.7rem;
    }
}

/* ========================================
   GOOGLE PLACES AUTOCOMPLETE
   ======================================== */

/* Container dropdown Google Places - z-index alto per apparire sopra tutto */
.pac-container {
    z-index: 10000 !important;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #dee2e6;
    font-family: inherit;
    margin-top: 2px;
}

.pac-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
}

.pac-item:hover {
    background-color: #f8f9fa;
}

.pac-item-selected {
    background-color: #e9ecef;
}

.pac-icon {
    margin-right: 8px;
}

.pac-item-query {
    font-weight: 500;
    color: #212529;
}

.pac-matched {
    font-weight: 600;
    color: #0d6efd;
}

/* Input con autocomplete attivo */
.address-autocomplete {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10zm0-7a3 3 0 1 1 0-6 3 3 0 0 1 0 6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 35px;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    max-width: 420px;
}

.toast-notification {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInUp 0.4s var(--ease-out);
    border-left: 4px solid var(--primary-color);
    min-width: 280px;
    max-width: 400px;
}

.toast-notification.toast-success {
    border-left-color: var(--success-color);
}

.toast-notification.toast-error {
    border-left-color: var(--danger-color);
}

.toast-notification.toast-warning {
    border-left-color: var(--warning-color);
}

.toast-notification.toast-info {
    border-left-color: var(--info-color);
}

.toast-notification.hiding {
    animation: slideOutDown 0.3s var(--ease-out) forwards;
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--success-color); }
.toast-error .toast-icon { color: var(--danger-color); }
.toast-warning .toast-icon { color: var(--warning-color); }
.toast-info .toast-icon { color: var(--info-color); }

.toast-content {
    flex: 1;
    min-width: 0; /* Permette al flex item di restringersi */
    overflow: hidden;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #212529;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.toast-message {
    font-size: 0.875rem;
    color: #6c757d;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #495057;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: toastProgress linear forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ========================================
   SKELETON LOADING
   ======================================== */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    border-radius: 4px;
}

.skeleton-text:last-child {
    width: 70%;
}

.skeleton-title {
    height: 1.5em;
    width: 50%;
    margin-bottom: 1em;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-card {
    padding: 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.skeleton-table-row {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.skeleton-table-cell {
    height: 1em;
    flex: 1;
}

.skeleton-table-cell:first-child {
    flex: 0.5;
}

.skeleton-table-cell:last-child {
    flex: 0.3;
}

.skeleton-kpi {
    height: 100px;
    border-radius: 16px;
}

.skeleton-chart {
    height: 250px;
    border-radius: 16px;
}

/* ========================================
   TABLE HOVER EFFECTS (Enhanced)
   ======================================== */

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.06);
}

.table tbody tr:hover td {
    color: #212529;
}

.table tbody tr:hover td:first-child {
    box-shadow: inset 4px 0 0 var(--primary-color);
}

.table tbody tr.selected {
    background-color: rgba(13, 110, 253, 0.1);
}

.table tbody tr.selected td:first-child {
    box-shadow: inset 4px 0 0 var(--success-color);
}

/* ========================================
   ANIMATED ICONS
   ======================================== */

.icon-spin:hover {
    animation: iconSpin 0.6s ease;
}

.icon-bounce:hover {
    animation: iconBounce 0.4s ease;
}

.icon-pulse:hover {
    animation: pulse 0.5s ease;
}

/* Icone nei bottoni */
.btn i {
    transition: transform 0.2s ease;
}

.btn:hover i {
    transform: scale(1.15);
}

.btn-outline-primary:hover i,
.btn-outline-success:hover i {
    animation: iconBounce 0.3s ease;
}

.btn-outline-danger:hover i {
    animation: iconSpin 0.4s ease;
}

/* Icone nella navbar */
.nav-link i {
    transition: transform 0.2s ease;
}

.nav-link:hover i {
    transform: scale(1.2);
}

/* Icone nelle card header */
.card-header i {
    transition: all 0.3s ease;
}

.card:hover .card-header i {
    transform: scale(1.1);
}

/* Refresh icon spin on click */
.icon-refresh.spinning {
    animation: iconSpin 1s linear infinite;
}

/* ========================================
   PROGRESS BARS (Enhanced)
   ======================================== */

.progress {
    height: 8px;
    border-radius: 10px;
    background-color: #e9ecef;
    overflow: hidden;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.6s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

.progress-bar-striped {
    background-image: linear-gradient(
        45deg,
        rgba(255,255,255,0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255,255,255,0.15) 50%,
        rgba(255,255,255,0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
}

.progress-bar-animated {
    animation: progressStripes 1s linear infinite;
}

@keyframes progressStripes {
    from { background-position: 1rem 0; }
    to { background-position: 0 0; }
}

/* Progress in cards */
.card-progress {
    margin-top: 1rem;
}

.card-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.card-progress-value {
    font-weight: 600;
    color: #212529;
}

/* Circular progress */
.progress-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(var(--primary-color) var(--progress, 0%), #e9ecef 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-circle::before {
    content: '';
    position: absolute;
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
}

.progress-circle-value {
    position: relative;
    font-size: 0.875rem;
    font-weight: 600;
    color: #212529;
}

/* ========================================
   EMPTY STATES
   ======================================== */

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.4;
    color: var(--primary-color);
}

.empty-state-icon i {
    animation: bounce 2s ease-in-out infinite;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.empty-state-description {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state-action {
    margin-top: 1rem;
}

/* Varianti empty state */
.empty-state-small {
    padding: 2rem 1rem;
}

.empty-state-small .empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.empty-state-small .empty-state-title {
    font-size: 1rem;
}

.empty-state-small .empty-state-description {
    font-size: 0.85rem;
}

/* Empty state illustrazioni specifiche */
.empty-state-no-data .empty-state-icon::before {
    content: '📊';
    font-size: 3rem;
}

.empty-state-no-results .empty-state-icon::before {
    content: '🔍';
    font-size: 3rem;
}

.empty-state-no-messages .empty-state-icon::before {
    content: '💬';
    font-size: 3rem;
}

.empty-state-no-notifications .empty-state-icon::before {
    content: '🔔';
    font-size: 3rem;
}

/* Empty state con sfondo */
.empty-state-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 2px dashed #dee2e6;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(13, 110, 253, 0.3);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--primary-color), var(--info-color)) border-box;
}

/* Responsive toast */
@media (max-width: 480px) {
    .toast-container {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
    
    .toast-notification {
        min-width: auto;
    }
}
