
/* ==========================================
   VARIABILI COLORI
   ========================================== */
:root {
    --vintage-beige: #f0e9d9;
    --dark-blue: #1a3a4a;
    --medium-blue: #2b5f7b;
    --light-blue: #5cadd3;
    --grid-line: #333;
    --beige: #e8d8b7;
    --highlight-yellow: #ffcc00;
}

/* ==========================================
   UTILITÀ GENERALI
   ========================================== */
.seo-heading {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ==========================================
   HEADER E NAVBAR
   ========================================== */
   /* Header e navigazione */
.ticktactoe-header {
    background-color: var(--dark-blue);
    color: var(--beige);
    font-family: 'Courier New', monospace;
    padding: 0.25rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1030;
    height: 7rem;
}

.ticktactoe-user-area {
    background-color: rgba(232, 216, 183, 0.1);
    border-right: 1px solid rgba(232, 216, 183, 0.2);
}

.ticktactoe-search {
    background-color: rgba(232, 216, 183, 0.1);
    border: 1px solid rgba(232, 216, 183, 0.2);
    color: var(--beige);
}

.ticktactoe-search::placeholder {
    color: rgba(232, 216, 183, 0.5);
}

.ticktactoe-search:focus {
    background-color: rgba(232, 216, 183, 0.15);
    border-color: var(--beige);
    color: var(--beige);
    box-shadow: 0 0 0 0.2rem rgba(232, 216, 183, 0.25);
}

.logo-container {
    width: 30px;
    height: 30px;
    margin-right: 8px;
}

/* ==========================================
   SIDEBAR
   ========================================== */
.ticktactoe-sidebar {
    background-color: var(--beige);
    font-family: 'Courier New', monospace;
    border-right: 3px solid var(--dark-blue);
    min-height: calc(100vh - 56px); /* Altezza dell'header */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="150" height="150" viewBox="0 0 150 150"><rect width="150" height="150" fill="none"/><path d="M0,50 L150,50 M0,100 L150,100 M50,0 L50,150 M100,0 L100,150" stroke="%231a3a4a" stroke-width="1" stroke-opacity="0.1"/></svg>');
    background-repeat: repeat;
}

.sidebar-heading {
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--dark-blue);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid var(--dark-blue);
    padding-left: 10px;
}

.nav-link {
    color: var(--dark-blue) !important;
    border-left: 3px solid transparent;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    margin-bottom: 3px;
}

.nav-link:hover {
    background-color: rgba(26, 58, 74, 0.1);
    border-left-color: var(--medium-blue);
}

.nav-link.active {
    background-color: rgba(26, 58, 74, 0.15);
    border-left-color: var(--dark-blue);
    font-weight: bold;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid rgba(26, 58, 74, 0.2);
    color: var(--dark-blue);
    text-align: center;
    font-size: 0.8rem;
}

.menu-section {
    position: relative;
    padding-bottom: 15px;
}

.menu-section::after {
    content: "";
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 0;
    height: 1px;
    background-color: rgba(26, 58, 74, 0.1);
}

.sidebar-icon {
    width: 20px;
    display: inline-block;
    text-align: center;
    margin-right: 8px;
}

/* ==========================================
   RELAZIONI NELLA SIDEBAR
   ========================================== */
.relationship-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    margin-left: 0.5rem;
    background-color: var(--dark-blue);
    color: var(--beige);
    border-radius: 10px;
    opacity: 0.7;
}

.relationship-item {
    display: flex;
    align-items: center;
    margin-left: 1rem;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    color: var(--dark-blue);
}

.relationship-item:before {
    content: "→";
    margin-right: 0.5rem;
    font-weight: bold;
}

.relationship-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: var(--medium-blue);
    color: var(--beige);
    border-radius: 50%;
    margin-left: 0.5rem;
    font-size: 0.7rem;
    font-weight: bold;
}

.hierarchy-section {
    background-color: rgba(255, 255, 255, 0.2);
    border-left: 3px solid var(--medium-blue);
    margin: 0.5rem 0 0.5rem 1rem;
    padding: 0.5rem;
}

.hierarchy-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--medium-blue);
    font-weight: bold;
    margin-bottom: 0.3rem;
}

/* ==========================================
   FOOTER
   ========================================== */
.ticktactoe-footer {
    background-color: var(--dark-blue);
    color: var(--beige);
    font-family: 'Courier New', monospace;
    padding: 1.5rem 0;
    border-top: 3px solid var(--medium-blue);
    margin-top: 3rem;
    position: relative;
}

.ticktactoe-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="none"/><path d="M33.33,0 V100 M66.67,0 V100 M0,33.33 H100 M0,66.67 H100" stroke="%232b5f7b" stroke-width="1" stroke-opacity="0.1"/></svg>');
    background-repeat: repeat;
    opacity: 0.3;
    z-index: 0;
}

.footer-content {
    position: relative;
    z-index: 1;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.footer-links li {
    margin-left: 1.5rem;
    position: relative;
}

.footer-links li::before {
    content: "•";
    position: absolute;
    left: -0.9rem;
    color: var(--medium-blue);
}

.footer-links li:first-child::before {
    display: none;
}

.footer-link {
    color: var(--beige);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.footer-link:hover {
    color: var(--light-blue);
    text-decoration: underline;
}

.footer-logo {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.footer-grid {
    display: inline-grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 2px;
    margin-right: 10px;
}

.footer-cell {
    width: 15px;
    height: 15px;
    border: 1px solid var(--beige);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--beige);
}

/* ==========================================
   NOTIFICHE
   ========================================== */
.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--highlight-yellow);
    color: var(--dark-blue);
    font-size: 0.7rem;
    font-weight: bold;
    padding: 0.15rem 0.4rem;
    border-radius: 50%;
    transform: translate(50%, -50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.notification-item {
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.notification-item.unread {
    border-left-color: var(--highlight-yellow);
    background-color: rgba(255, 204, 0, 0.05);
}

.notification-item:hover {
    background-color: rgba(26, 58, 74, 0.05);
}

.notification-title {
    font-weight: bold;
    color: var(--dark-blue);
}

.notification-meta {
    font-size: 0.8rem;
    color: #6c757d;
}

.notification-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background-color: rgba(26, 58, 74, 0.1);
    border-radius: 50%;
    margin-right: 0.75rem;
}

#notifiche-container {
    max-height: 300px;
    overflow-y: auto;
}

#notifiche-container::-webkit-scrollbar {
    width: 5px;
}

#notifiche-container::-webkit-scrollbar-track {
    background: rgba(232, 216, 183, 0.3);
}

#notifiche-container::-webkit-scrollbar-thumb {
    background-color: var(--medium-blue);
    border-radius: 10px;
}

/* ==========================================
   DEBUG INFO
   ========================================== */
.debug-info {
    margin-top: 1rem;
    padding: 0.5rem;
    border: 1px dashed var(--medium-blue);
    border-radius: 5px;
    background-color: rgba(43, 95, 123, 0.2);
}

.debug-info summary {
    cursor: pointer;
    color: var(--light-blue);
}

.debug-info p {
    margin: 0.5rem 0;
    color: var(--beige);
    font-size: 0.8rem;
}

.error-container {
    max-width: 100%;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.error-message {
    font-family: monospace;
    font-size: 0.9rem;
}

/* ==========================================
   MEDIA QUERIES
   ========================================== */
@media (max-width: 768px) {
    .footer-links {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .ticktactoe-footer .text-md-end {
        text-align: center !important;
    }
    
    .ticktactoe-footer .text-start {
        text-align: center !important;
    }
}
/* Stili di base */
body {
    background: url('/assets/img/background.png') no-repeat center center fixed;
    background-size: cover;
    font-family: 'Arial', sans-serif;
}

.container-fluid {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%231a3a4a"/><path d="M0,20 L100,20 M0,40 L100,40 M0,60 L100,60 M0,80 L100,80 M20,0 L20,100 M40,0 L40,100 M60,0 L60,100 M80,0 L80,100" stroke="%232b5f7b" stroke-width="0.5"/></svg>');
    background-repeat: repeat;
}



.navbar-brand {
    color: var(--vintage-beige) !important;
    font-weight: bold;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

.navbar-brand img {
    margin-right: 10px;
}

.navbar-nav {
    color: var(--vintage-beige);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: var(--vintage-beige) !important;
    padding: 0.5rem 0.75rem;
    position: relative;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(232, 216, 183, 0.1);
}

.nav-item.dropdown {
    display: flex;
    align-items: center;
}

/* Menu dropdown */
.dropdown-menu {
    background-color: var(--vintage-beige);
    border: 2px solid var(--dark-blue);
    padding: 0.5rem;
    font-family: 'Courier New', monospace;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.navbar-nav .dropdown-menu {
    position: absolute;
    top: 60px;
    right: 10px;
    z-index: 1050;
    min-width: 200px;
    display: none;
}

.navbar-nav .dropdown-menu.show {
    display: block;
}

.dropdown-menu li {
    padding: 10px;
}

.nav-item.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-header {
    color: var(--dark-blue);
    font-weight: bold;
    border-bottom: 1px solid rgba(26, 58, 74, 0.2);
}

.dropdown-divider {
    border-top: 1px solid rgba(26, 58, 74, 0.2);
    margin: 0.3rem 0;
}

.dropdown-item {
    color: var(--dark-blue);
    font-weight: normal;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(26, 58, 74, 0.1);
}

/* Barra di ricerca */
.ticktactoe-search {
    background-color: rgba(232, 216, 183, 0.15);
    border: 2px solid var(--medium-blue);
    color: var(--vintage-beige);
    font-family: 'Courier New', monospace;
    max-width: 500px;
    flex: 1;
}

.ticktactoe-search::placeholder {
    color: rgba(232, 216, 183, 0.5);
}

.ticktactoe-search:focus {
    background-color: rgba(232, 216, 183, 0.2);
    color: var(--vintage-beige);
    border-color: var(--light-blue);
    box-shadow: 0 0 0 0.25rem rgba(92, 173, 211, 0.25);
}

/* Area utente e notifiche */
.ticktactoe-user-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
/* Notification Popup Styles */
.notification-toast {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 350px;
    background-color: #e8d8b7;
    border: 3px solid #1a3a4a;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.2);
    z-index: 9999;
    font-family: 'Courier New', monospace;
    transform: translateX(400px);
    transition: transform 0.3s ease-in-out;
    opacity: 0;
    overflow: hidden;
}

.notification-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-toast::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="none"/><path d="M33.33,0 V100 M66.67,0 V100 M0,33.33 H100 M0,66.67 H100" stroke="%232b5f7b" stroke-width="1" stroke-opacity="0.1"/></svg>');
    background-repeat: repeat;
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
}

.notification-toast-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background-color: #1a3a4a;
    color: #e8d8b7;
    position: relative;
}

.notification-toast-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

.notification-toast-title {
    flex-grow: 1;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.notification-toast-time {
    margin-right: 10px;
    font-size: 0.8rem;
    opacity: 0.8;
}

.notification-toast-close {
    background: none;
    border: none;
    color: #e8d8b7;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.notification-toast-body {
    padding: 15px;
    color: #1a3a4a;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}
/* Stile per il popup di notifica */
.notification-popup {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 320px;
    background-color: #e8d8b7;
    border: 3px solid #1a3a4a;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transform: translateX(400px);
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 0;
    font-family: 'Courier New', monospace;
    overflow: hidden;
}

.notification-popup.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-popup::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="none"/><path d="M33.33,0 V100 M66.67,0 V100 M0,33.33 H100 M0,66.67 H100" stroke="%232b5f7b" stroke-width="1" stroke-opacity="0.1"/></svg>');
    background-repeat: repeat;
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
}

.notification-popup-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: #1a3a4a;
    color: #e8d8b7;
    position: relative;
}

.notification-popup-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

.notification-popup-title {
    flex-grow: 1;
    font-weight: bold;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.notification-popup-close {
    background: none;
    border: none;
    color: #e8d8b7;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.notification-popup-body {
    padding: 15px;
    color: #1a3a4a;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.notification-popup-actions {
    margin-top: 10px;
    text-align: right;
}

.notification-popup-link {
    display: inline-block;
    padding: 5px 10px;
    background-color: #2b5f7b;
    color: #e8d8b7;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: 1px solid #1a3a4a;
}

.notification-popup-link:hover {
    background-color: #1a3a4a;
    transform: translateY(-2px);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

/* Miglioramenti per il badge di notifica */
.notification-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 0 4px;
    border: 1px solid #e8d8b7;
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Miglioramenti per il dropdown delle notifiche */
.notification-dropdown {
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #e8d8b7;
    border: 3px solid #1a3a4a;
    border-radius: 0;
    margin-top: 10px;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.2);
}

.notification-dropdown::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="none"/><path d="M33.33,0 V100 M66.67,0 V100 M0,33.33 H100 M0,66.67 H100" stroke="%232b5f7b" stroke-width="1" stroke-opacity="0.1"/></svg>');
    background-repeat: repeat;
    opacity: 0.2;
    z-index: -1;
    pointer-events: none;
}

.notification-item {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(26, 58, 74, 0.1);
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background-color: rgba(26, 58, 74, 0.05);
}

.notification-item.unread {
    border-left: 4px solid #2b5f7b;
    background-color: rgba(255, 255, 255, 0.4);
}

.notification-header {
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px dashed rgba(26, 58, 74, 0.2);
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1a3a4a;
}

.notification-footer {
    padding: 10px;
    text-align: center;
    border-top: 1px solid rgba(26, 58, 74, 0.1);
    background-color: rgba(26, 58, 74, 0.05);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2b5f7b;
    color: #e8d8b7;
    margin-right: 10px;
    flex-shrink: 0;
}

.notification-content {
    flex-grow: 1;
}

.notification-title {
    font-weight: bold;
    margin-bottom: 4px;
    color: #1a3a4a;
}

.notification-message {
    font-size: 0.85rem;
    color: #555;
}

.notification-time {
    font-size: 0.75rem;
    color: #777;
    margin-top: 4px;
}

.notification-actions {
    margin-top: 10px;
    display: flex;
    gap: 5px;
}

.notification-action-btn {
    padding: 2px 8px;
    font-size: 0.75rem;
    background-color: #1a3a4a;
    color: #e8d8b7;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-action-btn:hover {
    background-color: #2b5f7b;
}
.notification-toast-actions {
    margin-top: 10px;
    text-align: right;
}

.notification-toast-link {
    display: inline-block;
    padding: 5px 10px;
    background-color: #2b5f7b;
    color: #e8d8b7;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: 1px solid #1a3a4a;
}

.notification-toast-link:hover {
    background-color: #1a3a4a;
    transform: translateY(-2px);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

/* Enhanced Notification Dropdown Styles */
#notificheDropdown {
    position: relative;
}
.notification-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: var(--highlight-yellow);
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    transform: translate(50%, -50%);
}

.bi-bell {
    color: var(--highlight-yellow) !important;
    font-size: 1.5rem;
}

.icon-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: var(--medium-blue);
}

/* Logo e container */
.logo-container {
    position: relative;
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

/* Messaggi di errore */
.error-container {
    position: absolute;
    top: 100%;
    right: 1rem;
    width: 400px;
    max-width: 90vw;
    z-index: 1050;
}

.error-message {
    margin-top: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    border: 1px solid rgba(26, 58, 74, 0.2);
}

/* Contenuto principale */
.main-content {
    background-color: var(--vintage-beige);
    border: 3px solid var(--grid-line);
    border-radius: 0;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 15px;
}

.main-content::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="150" height="150" viewBox="0 0 150 150"><rect width="150" height="150" fill="none"/><path d="M0,50 L150,50 M0,100 L150,100 M50,0 L50,150 M100,0 L100,150" stroke="%23333" stroke-width="1"/></svg>');
    background-repeat: repeat;
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
}

.header-title {
    background-color: var(--dark-blue);
    font-family: 'Courier New', monospace;
    color: var(--vintage-beige);
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
    border: 3px solid var(--grid-line);
    letter-spacing: 2px;
    font-weight: bold;
    font-size: 1.8rem;
}

/* Grid di ticket */
.ticket-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.ticket-cell {
    background-color: var(--vintage-beige);
    aspect-ratio: 1/1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--grid-line);
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.ticket-cell:hover {
    transform: scale(1.05);
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.1);
}

.ticket-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--dark-blue);
}

.ticket-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--dark-blue);
}

.ticket-label {
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--dark-blue);
    margin-top: 5px;
}

/* Box di statistiche */
.stat-box {
    background-color: rgba(255, 255, 255, 0.6);
    border: 2px solid var(--grid-line);
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-box .number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--dark-blue);
}

.stat-box .label {
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--dark-blue);
}

.stat-box .title {
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--dark-blue);
}

.stat-box .icon {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 2rem;
    opacity: 0.2;
    color: var(--dark-blue);
}

/* Pulsanti */
.btn-vintage {
    background-color: var(--dark-blue);
    color: var(--vintage-beige);
    border: 2px solid var(--grid-line);
    border-radius: 0;
    font-weight: bold;
    padding: 8px 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-vintage:hover {
    background-color: var(--medium-blue);
    color: var(--vintage-beige);
    transform: translateY(-2px);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
}

.btn-vintage-primary {
    background-color: var(--medium-blue);
    color: var(--vintage-beige);
}

.btn-vintage-secondary {
    background-color: #6c757d;
}

.btn-vintage-success {
    background-color: #2e7d32;
    color: var(--vintage-beige);
}

.btn-vintage-warning {
    background-color: #ff9800;
    color: var(--dark-blue);
}

/* Tabelle */
.table {
    color: var(--dark-blue);
}

.table thead {
    background-color: var(--dark-blue);
    color: var(--vintage-beige);
}

.table thead th {
    font-weight: bold;
    border-bottom: 2px solid var(--grid-line);
}

.table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

/* Badge e stati */
.badge-ttt {
    background-color: var(--dark-blue);
    color: var(--vintage-beige);
    font-weight: bold;
    padding: 5px 8px;
    border-radius: 0;
    font-size: 0.75rem;
    border: 1px solid var(--grid-line);
}

.badge-ttt-aperto {
    background-color: #ff9800;
    color: white;
}

.badge-ttt-in_lavorazione {
    background-color: #2196f3;
    color: white;
}

.badge-ttt-in_attesa {
    background-color: #9e9e9e;
    color: white;
}

.badge-ttt-risolto {
    background-color: #4caf50;
    color: white;
}

.badge-ttt-chiuso {
    background-color: #424242;
    color: white;
}
/* Badge "novità non lette" nella lista ticket
   (riusa la struttura di .badge-ttt, cambia solo colore + animazione) */
.badge-ttt-unread {
    background-color: #dc3545;
    color: #fff;
    animation: ttt-pulse 2s ease-in-out infinite;
}

@keyframes ttt-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.65; }
}

/* Card e pannelli */
.card-ttt {
    background-color: rgba(255, 255, 255, 0.6);
    border: 2px solid var(--grid-line);
    border-radius: 0;
    margin-bottom: 20px;
}

.card-ttt .card-header {
    background-color: var(--dark-blue);
    color: var(--vintage-beige);
    font-weight: bold;
    padding: 10px 15px;
    border-bottom: 2px solid var(--grid-line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-ttt .card-body {
    padding: 15px;
}

/* Moduli e form */
.form-section {
    border: 2px solid var(--grid-line);
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
}

.form-section-header {
    position: absolute;
    top: -10px;
    left: 10px;
    background-color: var(--vintage-beige);
    padding: 0 10px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--dark-blue);
}

.icon-section {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    color: var(--dark-blue);
    opacity: 0.5;
}

/* Progress bar */
.progress {
    height: 20px;
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--grid-line);
    border-radius: 0;
}

.progress-bar {
    background-color: var(--medium-blue);
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
}

/* Liste */
.list-group-ttt {
    border: 2px solid var(--grid-line);
    border-radius: 0;
}

.list-group-ttt .list-group-item {
    border: none;
    border-bottom: 1px solid var(--grid-line);
    background-color: transparent;
    color: var(--dark-blue);
}

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

.list-group-ttt .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

/* Media queries per responsività */
@media (max-width: 768px) {
    .ticket-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .ticket-grid {
        grid-template-columns: 1fr;
    }

/* Stili per la sidebar */
.ticktactoe-sidebar {
    background-color: #e8d8b7;
    font-family: 'Courier New', monospace;
    border-right: 3px solid #1a3a4a;
    min-height: calc(100vh - 56px); /* Altezza dell'header */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="150" height="150" viewBox="0 0 150 150"><rect width="150" height="150" fill="none"/><path d="M0,50 L150,50 M0,100 L150,100 M50,0 L50,150 M100,0 L100,150" stroke="%231a3a4a" stroke-width="1" stroke-opacity="0.1"/></svg>');
    background-repeat: repeat;
}

.sidebar-heading {
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1a3a4a;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid #1a3a4a;
    padding-left: 10px;
}

.nav-link {
    color: #1a3a4a !important;
    border-left: 3px solid transparent;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    margin-bottom: 3px;
}

.nav-link:hover {
    background-color: rgba(26, 58, 74, 0.1);
    border-left-color: #2b5f7b;
}

.nav-link.active {
    background-color: rgba(26, 58, 74, 0.15);
    border-left-color: #1a3a4a;
    font-weight: bold;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid rgba(26, 58, 74, 0.2);
    color: #1a3a4a;
    text-align: center;
    font-size: 0.8rem;
}

.menu-section {
    position: relative;
    padding-bottom: 15px;
}

.menu-section::after {
    content: "";
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 0;
    height: 1px;
    background-color: rgba(26, 58, 74, 0.1);
}

.sidebar-icon {
    width: 20px;
    display: inline-block;
    text-align: center;
    margin-right: 8px;
}

/* Stili per la visualizzazione delle relazioni nella sidebar */
.relationship-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    margin-left: 0.5rem;
    background-color: #1a3a4a;
    color: #e8d8b7;
    border-radius: 10px;
    opacity: 0.7;
}

.relationship-item {
    display: flex;
    align-items: center;
    margin-left: 1rem;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    color: #1a3a4a;
}

.relationship-item:before {
    content: "→";
    margin-right: 0.5rem;
    font-weight: bold;
}

.relationship-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: #2b5f7b;
    color: #e8d8b7;
    border-radius: 50%;
    margin-left: 0.5rem;
    font-size: 0.7rem;
    font-weight: bold;
}

.hierarchy-section {
    background-color: rgba(255, 255, 255, 0.2);
    border-left: 3px solid #2b5f7b;
    margin: 0.5rem 0 0.5rem 1rem;
    padding: 0.5rem;
}

.hierarchy-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #2b5f7b;
    font-weight: bold;
    margin-bottom: 0.3rem;
}

/* Logo TicTacToe mini per il footer */
.tictactoe-logo-mini {
    display: inline-grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 2px;
    margin-bottom: 10px;
}

.tictactoe-logo-mini:before {
    content: "";
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 2px;
    width: 42px;
    height: 42px;
}

.tictactoe-logo-mini:after {
    content: "";
    position: absolute;
    width: 42px;
    height: 42px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="42" height="42" viewBox="0 0 42 42"><rect width="42" height="42" fill="none"/><path d="M14,0 V42 M28,0 V42 M0,14 H42 M0,28 H42" stroke="%231a3a4a" stroke-width="1"/><path d="M5,5 L9,9 M9,5 L5,9" stroke="%231a3a4a" stroke-width="1"/><circle cx="21" cy="7" r="4" stroke="%231a3a4a" stroke-width="1" fill="none"/><path d="M33,5 L37,9 M37,5 L33,9" stroke="%231a3a4a" stroke-width="1"/><circle cx="7" cy="21" r="4" stroke="%231a3a4a" stroke-width="1" fill="none"/><text x="21" y="23" text-anchor="middle" font-family="Courier New" font-size="12" fill="%231a3a4a">T</text><path d="M33,19 L37,23 M37,19 L33,23" stroke="%231a3a4a" stroke-width="1"/><circle cx="7" cy="35" r="4" stroke="%231a3a4a" stroke-width="1" fill="none"/><path d="M19,33 L23,37 M23,33 L19,37" stroke="%231a3a4a" stroke-width="1"/><circle cx="35" cy="35" r="4" stroke="%231a3a4a" stroke-width="1" fill="none"/></svg>');
}
    
@media (max-width: 768px) {
    .ticket-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .ticket-grid {
        grid-template-columns: 1fr;
    }


    
}
/* Filtro mese per resi */
.form-select-sm {
    padding: 0.25rem 2rem 0.25rem 0.5rem;
    font-size: 0.875rem;
    background-size: 12px 10px;
    min-width: 200px;
}

/* Badge informativi migliorati */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
    font-size: 0.875rem;
}

.badge.bg-info {
    background-color: rgba(92, 173, 211, 0.9) !important;
    color: white;
}

/* Alert per statistiche comparative */
.alert-light {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--grid-line);
    border-radius: 0;
}

.alert-light h6 {
    color: var(--dark-blue);
    font-weight: bold;
    margin-bottom: 10px;
}

/* Colori per variazioni */
.text-danger {
    color: #dc3545 !important;
}

.text-success {
    color: #28a745 !important;
}

.text-muted {
    color: #6c757d !important;
}

/* Icone di tendenza */
.bi-arrow-up::before,
.bi-arrow-down::before,
.bi-dash::before {
    font-size: 1.1em;
    vertical-align: middle;
}

/* Miglioramenti responsive */
@media (max-width: 768px) {
    #resi_month_select {
        width: 100% !important;
        margin-bottom: 10px;
    }
    
    .btn-vintage.btn-sm {
        width: 100%;
        margin-top: 5px;
    }
    
    .alert-light {
        margin-bottom: 10px;
    }
    
    .metric-box h6 {
        font-size: 0.9rem;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
}

/* Animazione per metriche */
.metric-box {
    animation: fadeIn 0.5s ease-in;
}

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

/* Miglioramento hover per selezione mese */
#resi_month_select:hover {
    border-color: var(--medium-blue);
    cursor: pointer;
}

/* Stile per grafico comparativo */
.chart-container canvas {
    background-color: rgba(255, 255, 255, 0.5);
    padding: 10px;
}