/* Custom Styles for Gestione Presenze */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Footer sempre in fondo pagina anche con poco contenuto */
body.min-vh-100 {
    min-height: 100vh;
}

/* Footer centrato su smartphone/tablet (classe impostata da base.html, badge non visibile) */
body.client-device-mobile footer.app-footer {
    text-align: center;
    padding-top: 0.85rem !important;
    padding-bottom: 0.85rem !important;
}

body.client-device-mobile footer.app-footer .app-footer-row > [class*="col-"] {
    text-align: center !important;
    margin-bottom: 0.4rem;
}

body.client-device-mobile footer.app-footer .app-footer-row > [class*="col-"]:last-child {
    margin-bottom: 0;
}

/* Navbar Customization */
.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
}

/* Navbar: voci compatte e utilità (campanella/utente) separate dal menu principale */
@media (min-width: 1200px) {
    .st-top-navbar > .container-fluid {
        flex-wrap: nowrap;
        align-items: center;
    }

    .st-top-navbar .st-navbar-main {
        flex-wrap: wrap;
        row-gap: 0.1rem;
    }

    .st-top-navbar .st-navbar-main .nav-link {
        padding-left: 0.45rem;
        padding-right: 0.45rem;
        font-size: 0.875rem;
        white-space: nowrap;
    }

    .st-top-navbar .navbar-brand {
        font-size: 1.15rem;
        margin-right: 0.5rem;
        max-width: 12rem;
    }

    .st-top-navbar .st-navbar-utilities {
        margin-left: 0.5rem;
    }

    .st-top-navbar .st-nav-user-label {
        max-width: 9rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
        vertical-align: bottom;
    }
}

/* Campanella notifiche header */
.header-notifiche-badge {
    font-size: 0.65rem;
    min-width: 1.1rem;
    line-height: 1.1rem;
    padding: 0.15rem 0.35rem;
}

.header-notifiche-menu {
    min-width: 22rem;
    max-width: 26rem;
}

.header-notifica-item {
    white-space: normal;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

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

.header-notifica-icon {
    width: 1.5rem;
    text-align: center;
    color: var(--primary-color);
    flex-shrink: 0;
}

.header-notifiche-scroll {
    max-height: 360px;
    overflow-y: auto;
}

/* Card Enhancements */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

/* Button Enhancements */
.btn {
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
}

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

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* Table Enhancements */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background-color: #f8f9fa;
    border-top: none;
    font-weight: 600;
    color: #495057;
}

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

/* Avatar Styles */
.avatar-sm {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
}

.avatar-md {
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
}

.avatar-lg {
    width: 4rem;
    height: 4rem;
    font-size: 1.5rem;
}

/* Badge Enhancements */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
}

/* Form Enhancements */
.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid {
    border-color: var(--success-color);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Alert Enhancements */
.alert {
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
}

/* Pagination Enhancements */
.pagination .page-link {
    border: none;
    color: var(--primary-color);
    margin: 0 0.125rem;
    border-radius: 0.375rem;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* Dashboard Cards */
.border-left-primary {
    border-left: 0.25rem solid var(--primary-color) !important;
}

.border-left-success {
    border-left: 0.25rem solid var(--success-color) !important;
}

.border-left-info {
    border-left: 0.25rem solid var(--info-color) !important;
}

.border-left-warning {
    border-left: 0.25rem solid var(--warning-color) !important;
}

/* Text Utilities */
.text-xs {
    font-size: 0.75rem;
}

.text-gray-300 {
    color: #dddfeb !important;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Pulsanti Azioni nelle tabelle — aspetto uniforme (icona + tooltip) */
.st-azioni-riga {
    flex-wrap: nowrap;
    white-space: nowrap;
}

.st-azioni-riga .btn {
    min-width: 2.125rem;
    padding: 0.25rem 0.5rem;
    line-height: 1.25;
}

.st-azioni-riga .btn i {
    margin: 0 !important;
    pointer-events: none;
    font-size: 0.9rem;
}

table td .st-azioni-riga .btn > span:not(.visually-hidden):not(.sr-only),
table td .btn-sm:has(> i.fas, > i.far, > i.fab) > span:not(.visually-hidden):not(.sr-only):not(.badge) {
    display: none;
}

table td .st-azioni-riga .btn,
table td .btn-sm:has(> i.fas, > i.far, > i.fab) {
    min-width: 2.125rem;
    padding: 0.25rem 0.5rem;
    line-height: 1.25;
}

table td .btn-sm:has(> i.fas, > i.far, > i.fab) > i {
    margin: 0 !important;
    pointer-events: none;
    font-size: 0.9rem;
}

table td:has(.st-azioni-riga),
table td:has(.btn-sm > i.fas) {
    white-space: nowrap;
}

/* Tooltip Enhancements */
.tooltip {
    font-size: 0.875rem;
}

/* Modal Enhancements */
.modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

/* Dropdown Enhancements */
.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
}

.dropdown-item:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

/* DataTable Customization */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_info {
    padding-top: 1rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border: none;
    margin: 0 0.125rem;
    border-radius: 0.375rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}

/* Liste presenze: nome e cognome su righe separate allineate */
.dipendente-nome-cell {
    min-width: 9rem;
    line-height: 1.25;
}

.dipendente-riga-nome,
.dipendente-riga-cognome {
    display: block;
}

.dipendente-riga-cognome {
    color: #495057;
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .card-header,
    .pagination {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .table {
        border: 1px solid #000 !important;
    }
    
    .table th,
    .table td {
        border: 1px solid #000 !important;
    }
}

/* Widget «Serve aiuto?» — barra header (prima delle notifiche) */
.st-help-wrap {
    position: relative;
    margin-right: 0.35rem;
}

.st-help-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.32rem 0.7rem 0.32rem 0.48rem;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.st-help-trigger:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.55);
    color: #fff;
}

.st-help-trigger:active {
    transform: scale(0.98);
}

.st-help-trigger:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}

.st-help-trigger__ico {
    flex: 0 0 auto;
    width: 1.38rem;
    height: 1.38rem;
    color: #fff;
}

.st-help-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    z-index: 1055;
    width: min(18rem, calc(100vw - 2rem));
    background: #fff;
    border: 1px solid #e1e7ed;
    border-radius: 12px;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.14);
    overflow: hidden;
}

.st-help-panel[hidden] {
    display: none !important;
}

.st-help-panel__head {
    padding: 0.55rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #5a6570;
    background: #f8fafc;
    border-bottom: 1px solid #eef1f4;
}

.st-help-panel__body {
    padding: 0.35rem 0;
}

.st-help-panel__link {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.85rem;
    color: #212529;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}

.st-help-panel__link:hover {
    background: #f1f5f9;
    color: #0d47a1;
} 