:root {
    --offcanvas-width: 250px;
    --header-height: 80px;
    --page-padding: 1rem;
    --card-header-height: 49px;
    --title-height: 100px; /* Added for title container height */
}
#epatrol_table .dropdown-toggle::after {
    display: none;

}
#main header {
    height: var(--header-height);
}

#main main {
    margin-top: var(--header-height);
}

#main .offcanvas-main {
    width: var(--offcanvas-width);
}
.mappa{
    position: sticky;
    top: 110px; /* distanza dal top della finestra */
}
@media (min-width: 992px) {
    #main main {
        margin-left: var(--offcanvas-width);
    }

    #main .offcanvas-main {
        transform: none;
        visibility: visible !important;
        top: var(--header-height);
        height: calc(100% - var(--header-height));
    }

    #main .offcanvas-backdrop::before {
        display: none;
    }
}

/* Date Range Section Styles */
.date-range-section {
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.date-range-section:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.date-range-section h6 {
    font-size: 0.875rem;
    letter-spacing: 0.3px;
}

.date-range-section .form-control {
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    padding: 0.6rem 2.75rem 0.6rem 0.75rem;
    min-height: 38px;
    line-height: 1.5;
}

.date-range-section .form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.15);
}

.date-range-section .form-control::-moz-placeholder {
    color: #adb5bd;
    font-style: italic;
}

.date-range-section .form-control::placeholder {
    color: #adb5bd;
    font-style: italic;
}

.date-range-section i.fa-calendar-alt {
    font-size: 1.1rem;
}

.date-range-section i.fa-info-circle {
    opacity: 0.6;
}

.date-range-section small {
    font-size: 0.75rem;
    line-height: 1.4;
}

/* Date Picker Custom Styling */
#dateReport {
    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='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.75rem !important;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#dateReport:hover {
    background-color: #f8f9fa;
}

/* Aumenta larghezza offcanvas per dare più spazio */
@media (min-width: 992px) {
    #main .offcanvas-main {
        width: 280px;
    }
    
    #main main {
        margin-left: 280px;
    }
}

div.pac-container.pac-logo {
  z-index: 1055;
}

@media (min-width: 992px) {
.home-banner {
        background-repeat:no-repeat;
        background-size:cover;
        background-image: url("../assets/home_banner.png") 
    }
}

.logo {
    height: 30px;
}

#formFilterReport .form-select {
    font-size:0.8rem;
}

/* Stili per altezza dinamica */
.presence-list {
    height: calc(100vh - var(--header-height) - var(--page-padding) * 4 - var(--card-header-height) - 80px);
    overflow-y: auto;
}
.presence-map {
    height: calc(100vh - var(--header-height) - var(--page-padding) * 4 - 88px);
    overflow-y: auto;
}
.invoices {
    position: absolute;
    top: 100px;
    z-index: 10000;
    width: 85%;
    right: 10px;
    opacity: 0.6;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

/* Storico Ronde */
.storico-map {
    height: 350px;
    min-height: 250px;
}
.storico-list {
    height: calc(100vh - var(--header-height) - var(--page-padding) * 4 - 180px);
    overflow-y: auto;
}
.storico-tags {
    max-height: 350px;
    overflow-y: auto;
}
.storico-list .list-group-item.active {
    background-color: rgba(var(--bs-primary-rgb), 0.08) !important;
    border-color: transparent;
    color: var(--bs-body-color);
    border-left: 4px solid var(--bs-primary) !important;
}
.storico-list .list-group-item:not(.active) {
    border-left: 4px solid transparent;
}
@media (max-width: 991px) {
    .storico-map { height: 250px; }
    .storico-list { height: auto; max-height: 400px; }
}

/* Kanban styles */
.kanban__column {
    min-height: calc(100vh - var(--header-height) - var(--title-height) - 2rem); /* Updated to subtract title height */
    display: flex;
    flex-direction: column;
}
.kanban__column .vstack {
    max-height: calc(100vh - var(--header-height) - var(--title-height) - 6rem); /* Updated to subtract title height */
    overflow-y: auto;
    padding-right: .25rem;
}
.kanban__card {
    cursor: pointer;
    border: 1px solid var(--bs-border-color);
    transition: background-color .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.kanban__card:hover {
    background-color: var(--bs-secondary-bg);
}
.kanban__card.is-selected,
.is-selected {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .15);
}
.kanban .sticky-top { z-index: 2; }

/* Drag and Drop Styles */
.kanban__card[draggable="true"] {
    cursor: grab;
}

.kanban__card.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: rotate(2deg);
}

.kanban__drop-zone {
    transition: background-color .2s ease;
}

.kanban__drop-zone.drop-zone-active {
    background-color: rgba(var(--bs-success-rgb), 0.05);
    outline: 2px dashed rgba(var(--bs-success-rgb), 0.3);
    outline-offset: -4px;
}

.kanban__drop-zone.drop-zone-hover {
    background-color: rgba(var(--bs-success-rgb), 0.1);
    outline: 2px solid rgba(var(--bs-success-rgb), 0.5);
    outline-offset: -4px;
}

/* Impedisci la selezione del testo durante il drag */
.kanban__card[draggable="true"]:active {
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
}

/* Offcanvas Detail Styles */
.offcanvas-body .card {
    transition: transform .2s ease, box-shadow .2s ease;
}

.offcanvas-body .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important;
}

.offcanvas-body .btn-lg {
    padding: .75rem 1.5rem;
    font-weight: 500;
    transition: all .2s ease;
}

.offcanvas-body .btn-lg:hover {
    transform: translateY(-1px);
    box-shadow: 0 .25rem .5rem rgba(0,0,0,.15);
}

.offcanvas-body .btn-lg:active {
    transform: translateY(0);
}

/* Immagine segnalazione nell'offcanvas */
.offcanvas-body img.img-fluid {
    transition: transform .3s ease;
    cursor: pointer;
}

.offcanvas-body img.img-fluid:hover {
    transform: scale(1.02);
}

/* Maintainer Selection Styles */
.maintainer-results .list-group-item {
    cursor: pointer;
    transition: all .2s ease;
    border-left: 3px solid transparent;
}

.maintainer-results .list-group-item:hover {
    background-color: var(--bs-primary-bg-subtle);
    border-left-color: var(--bs-primary);
    transform: translateX(3px);
}

.maintainer-results .list-group-item:active {
    transform: scale(0.98);
}

/* Scrollbar per lista manutentori */
.maintainer-results .list-group::-webkit-scrollbar {
    width: 8px;
}

.maintainer-results .list-group::-webkit-scrollbar-track {
    background: var(--bs-secondary-bg);
    border-radius: 4px;
}

.maintainer-results .list-group::-webkit-scrollbar-thumb {
    background: var(--bs-border-color);
    border-radius: 4px;
}

.maintainer-results .list-group::-webkit-scrollbar-thumb:hover {
    background: var(--bs-secondary);
}

/* Input ricerca manutentore */
#maintainer_search:focus {
    border-color: var(--bs-warning);
    box-shadow: 0 0 0 .25rem rgba(var(--bs-warning-rgb), .25);
}

/* Alert manutentore selezionato */
.offcanvas-body .alert-success {
    border-left: 4px solid var(--bs-success);
    animation: slideIn 0.3s ease;
}

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

/* Diario Operativo Styles */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-weight: 600;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
}

.avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
}

/* Note card hover effect */
.list-group-item {
    transition: all 0.2s ease;
    border-left: 4px solid transparent !important;
}

.list-group-item:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.03);
    border-left-color: var(--bs-primary) !important;
    transform: translateX(2px);
}

/* Severity badge colors */
.badge.bg-danger {
    background-color: var(--bs-danger) !important;
}

.badge.bg-warning {
    background-color: var(--bs-warning) !important;
    color: var(--bs-dark) !important;
}

.badge.bg-info {
    background-color: var(--bs-info) !important;
}

.badge.bg-success {
    background-color: var(--bs-success) !important;
}

/* Avatar colors matching severity */
.avatar.bg-danger {
    background-color: var(--bs-danger) !important;
}

.avatar.bg-warning {
    background-color: var(--bs-warning) !important;
    color: var(--bs-dark) !important;
}

.avatar.bg-info {
    background-color: var(--bs-info) !important;
}

.avatar.bg-success {
    background-color: var(--bs-success) !important;
}

/* Search input styling */
.input-group .form-control.border-start-0 {
    border-left: 0 !important;
}

.input-group .input-group-text.bg-transparent {
    background-color: transparent !important;
}

/* Card shadow and border */
.card.border-0.shadow-sm {
    border-radius: 0.5rem;
    overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .list-group-item {
        padding: 1rem !important;
    }
    
    .avatar-sm {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .badge {
        font-size: 0.65rem;
        padding: 0.25em 0.5em;
    }
}

/* Empty state styling */
.text-center.py-5 i.fa-clipboard-list {
    opacity: 0.3;
}

/* Filter card styling */
.card.border-0.shadow-sm .card-body {
    background-color: rgba(var(--bs-primary-rgb), 0.02);
}

/* Smooth transitions */
.list-group-item,
.card,
.btn,
.form-control,
.form-select {
    transition: all 0.2s ease;
}

/* Custom scrollbar for notes list */
.list-group.list-group-flush {
    max-height: 70vh;
    overflow-y: auto;
}

.list-group.list-group-flush::-webkit-scrollbar {
    width: 6px;
}

.list-group.list-group-flush::-webkit-scrollbar-track {
    background: var(--bs-light);
    border-radius: 3px;
}

.list-group.list-group-flush::-webkit-scrollbar-thumb {
    background: var(--bs-secondary);
    border-radius: 3px;
}

.list-group.list-group-flush::-webkit-scrollbar-thumb:hover {
    background: var(--bs-primary);
}

/* Note text styling */
.list-group-item p {
    line-height: 1.6;
    color: var(--bs-body-color);
    margin-bottom: 0.5rem;
}

.list-group-item h6 {
    font-weight: 600;
    color: var(--bs-dark);
}

.list-group-item small.text-muted {
    font-size: 0.75rem;
}

/* Filter section responsive */
@media (max-width: 768px) {
    .row.g-3 > .col-md-4,
    .row.g-3 > .col-md-3,
    .row.g-3 > .col-md-2 {
        margin-bottom: 0.5rem;
    }
    
    .row.g-3 > .col-md-2 button {
        width: 100%;
    }
}

/* Loading spinner */
.spinner-border.text-primary {
    width: 3rem;
    height: 3rem;
}

/* Header section */
.d-flex.justify-content-between.align-items-center h1 {
    font-weight: 600;
    color: var(--bs-dark);
}

.d-flex.justify-content-between.align-items-center p.text-muted {
    font-size: 0.875rem;
}

/* ==========================================================================
   Kanban Board Drag & Drop Styles
   ========================================================================== */

/* Kanban board container */
.kanban-board {
    min-height: 500px;
    transition: all 0.3s ease;
}

/* Kanban column (drop zone) */
.kanban-column {
    min-height: 400px;
    border: 2px dashed transparent;
    border-radius: 8px;
    transition: all 0.3s ease;
    background-color: rgba(248, 249, 250, 0.5);
}

/* Kanban column when active (accepting drops) */
.kanban-column.drop-active {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
    transform: translateY(-2px);
}

/* Kanban column when hovered with valid draggable */
.kanban-column.drop-hover {
    border-color: var(--bs-success);
    background-color: rgba(var(--bs-success-rgb), 0.05);
    box-shadow: 0 0 0 3px rgba(var(--bs-success-rgb), 0.1);
    transform: translateY(-2px);
}

/* Kanban column when not accepting drops */
.kanban-column.drop-invalid {
    border-color: var(--bs-danger);
    background-color: rgba(var(--bs-danger-rgb), 0.05);
    box-shadow: 0 0 0 3px rgba(var(--bs-danger-rgb), 0.1);
}

/* Kanban card styling */
.kanban-card {
    cursor: grab;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-left: 4px solid transparent;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Kanban card when being dragged */
.kanban-card.dragging {
    cursor: grabbing;
    opacity: 0.7;
    transform: rotate(2deg) scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border-left-color: var(--bs-primary);
    z-index: 1000;
    position: relative;
}

/* Kanban card when hovered (not dragging) */
.kanban-card:hover:not(.dragging) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-left-color: var(--bs-info);
}

/* Kanban card placeholder for drag operations */
.kanban-card-placeholder {
    height: 120px;
    border: 2px dashed var(--bs-secondary);
    border-radius: 6px;
    background-color: rgba(var(--bs-secondary-rgb), 0.05);
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

/* Kanban card placeholder when active */
.kanban-card-placeholder.active {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    animation: pulse-placeholder 1.5s infinite;
}

/* Pulse animation for placeholder */
@keyframes pulse-placeholder {
    0% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.5;
    }
}

/* Drag handle styling */
.drag-handle {
    cursor: grab;
    color: var(--bs-secondary);
    transition: color 0.2s ease;
    padding: 0.25rem;
    border-radius: 4px;
}

.drag-handle:hover {
    color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.drag-handle:active {
    cursor: grabbing;
}

/* Smooth transitions for all drag and drop states */
.kanban-card,
.kanban-column,
.kanban-card-placeholder,
.drag-handle {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Visual feedback for successful drop */
.drop-success {
    animation: drop-success-feedback 0.5s ease;
}

@keyframes drop-success-feedback {
    0% {
        background-color: rgba(var(--bs-success-rgb), 0.3);
    }
    100% {
        background-color: transparent;
    }
}

/* Visual feedback for failed drop */
.drop-failed {
    animation: drop-failed-feedback 0.5s ease;
}

@keyframes drop-failed-feedback {
    0% {
        background-color: rgba(var(--bs-danger-rgb), 0.3);
    }
    100% {
        background-color: transparent;
    }
}

/* Empty column state */
.kanban-column-empty {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-secondary);
    font-style: italic;
    border: 2px dashed var(--bs-light);
    border-radius: 6px;
    background-color: rgba(var(--bs-light-rgb), 0.3);
}

/* Responsive adjustments for kanban board */
@media (max-width: 768px) {
    .kanban-column {
        margin-bottom: 1.5rem;
    }
    
    .kanban-card {
        margin-bottom: 0.5rem;
    }
}