/* Weggpanel Modern UI Custom Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --wp-font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --wp-bg-body: #f4f7fb;
    --wp-card-radius: 12px;
    --wp-box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04), 0 0 1px rgba(0, 0, 0, 0.08);
    --wp-box-shadow-hover: 0 8px 24px rgba(14, 30, 37, 0.12);

    --wp-primary: #3b7ddd;
    --wp-primary-light: #eef5ff;
    --wp-success: #1cbb8c;
    --wp-success-light: #e8f8f3;
    --wp-warning: #fcb92c;
    --wp-warning-light: #fef8eb;
    --wp-danger: #dc3545;
    --wp-danger-light: #fde8e9;
    --wp-info: #0dcaf0;
    --wp-info-light: #e6f9fc;
    --wp-dark: #212529;
    --wp-secondary: #6c757d;
}

body {
    font-family: var(--wp-font-family);
    background-color: var(--wp-bg-body);
    color: #495057;
    -webkit-font-smoothing: antialiased;
}

/* --- CARDS & CONTAINERS --- */
.card {
    border: none;
    border-radius: var(--wp-card-radius);
    box-shadow: var(--wp-box-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
}

.card-stat {
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.card-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--wp-box-shadow-hover);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem 1.5rem;
}

.card-header .card-title {
    font-weight: 600;
    color: #2b3340;
    font-size: 1.05rem;
}

.card-body {
    padding: 1.5rem;
}

/* --- STAT ICON CIRCLES --- */
.stat-icon-shape {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-icon-primary {
    background-color: var(--wp-primary-light);
    color: var(--wp-primary);
}

.stat-icon-success {
    background-color: var(--wp-success-light);
    color: var(--wp-success);
}

.stat-icon-warning {
    background-color: var(--wp-warning-light);
    color: var(--wp-warning);
}

.stat-icon-danger {
    background-color: var(--wp-danger-light);
    color: var(--wp-danger);
}

.stat-icon-info {
    background-color: var(--wp-info-light);
    color: var(--wp-info);
}

.stat-icon-secondary {
    background-color: #f1f3f5;
    color: var(--wp-secondary);
}

/* --- TOP NAVBAR --- */
.navbar-bg {
    background: #ffffff !important;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.navbar .sidebar-toggle {
    cursor: pointer;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.navbar .sidebar-toggle:hover {
    background-color: #f8f9fa;
}

.nav-link-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    transition: all 0.2s ease;
}

.nav-link-icon:hover {
    background-color: #f1f5f9;
    color: var(--wp-primary);
}

/* --- SIDEBAR CUSTOMIZATION --- */
.sidebar {
    background: #1e293b;
}

.sidebar-brand {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    display: block;
}

.sidebar-header {
    color: #64748b;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-uppercase: uppercase;
    padding: 1.25rem 1.5rem 0.5rem 1.5rem;
    font-weight: 700;
}

.sidebar-item {
    margin: 2px 12px;
}

.sidebar-link {
    border-radius: 8px;
    padding: 0.65rem 1rem;
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.sidebar-link i,
.sidebar-link svg {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    color: #64748b;
    transition: color 0.2s ease;
}

.sidebar-link:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-link:hover i {
    color: #38bdf8;
}

.sidebar-item.active .sidebar-link {
    color: #ffffff;
    background: var(--wp-primary);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(59, 125, 221, 0.35);
}

.sidebar-item.active .sidebar-link i {
    color: #ffffff;
}

/* --- BUTTONS & BADGES --- */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.1rem;
    transition: all 0.2s ease;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.825rem;
}

.btn-primary {
    background-color: var(--wp-primary);
    border-color: var(--wp-primary);
    box-shadow: 0 2px 6px rgba(59, 125, 221, 0.25);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #2b6cb0;
    border-color: #2b6cb0;
    box-shadow: 0 4px 12px rgba(59, 125, 221, 0.35);
}

.badge {
    padding: 0.4em 0.75em;
    font-weight: 600;
    border-radius: 6px;
    font-size: 0.75rem;
}

.badge-soft-primary {
    background-color: var(--wp-primary-light);
    color: var(--wp-primary);
}

.badge-soft-success {
    background-color: var(--wp-success-light);
    color: var(--wp-success);
}

.badge-soft-warning {
    background-color: var(--wp-warning-light);
    color: #b7791f;
}

.badge-soft-danger {
    background-color: var(--wp-danger-light);
    color: var(--wp-danger);
}

/* --- FORM CONTROLS --- */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--wp-primary);
    box-shadow: 0 0 0 3px rgba(59, 125, 221, 0.15);
}

.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #334155;
    margin-bottom: 0.4rem;
}

/* --- BACK BUTTON & ALERTS --- */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.btn-back:hover {
    color: var(--wp-primary);
    background-color: var(--wp-primary-light);
    border-color: #bfdbfe;
}

.alert {
    border: none;
    border-radius: var(--wp-card-radius);
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* --- CUSTOM UTILITIES --- */
.page-header {
    margin-bottom: 1.75rem;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.avatar-sm {
    width: 38px;
    height: 38px;
    object-fit: cover;
}

.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-state-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem auto;
}

/* --- ATTENDANCE ROW STYLES --- */
tr.row-holiday {
    background-color: #fff8e6 !important;
    border-left: 4px solid #f59e0b !important;
}

tr.row-holiday td {
    background-color: #fff8e6 !important;
}

tr.row-weekend {
    background-color: #f8fafc !important;
}

tr.row-weekend td {
    background-color: #f8fafc !important;
    color: #64748b;
}

/* --- LOGIN PAGE STYLES --- */
.login-bg {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    position: relative;
}

.login-bg::before {
    content: '';
    position: absolute;
    top: 0%;
    right: 0%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(59, 125, 221, 0.15);
    filter: blur(80px);
    pointer-events: none;
}

.login-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    background: #b3ccea;
    overflow: hidden;
    width: 100%;
    max-width: 440px;
}

.login-input-group .input-group-text {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #64748b;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    padding-left: 1rem;
    padding-right: 1rem;
}

.login-input-group .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 991.98px) {
    .content {
        padding: 1.25rem 0.75rem !important;
    }

    .navbar-bg {
        padding: 0.5rem 1rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .stat-icon-shape {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
}

@media (max-width: 767.98px) {
    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 1rem;
    }

    .dropdown-menu {
        max-width: calc(100vw - 1.5rem) !important;
    }

    .table-responsive {
        border-radius: 8px;
        -webkit-overflow-scrolling: touch;
    }

    /* Stacking per header azioni su mobile */
    .page-header-actions {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .page-header-actions>div,
    .page-header-actions>a,
    .page-header-actions>button {
        width: 100%;
        text-align: center;
    }

    /* DataTables mobile adjustments */
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center !important;
        float: none !important;
        margin-bottom: 0.5rem;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 0.3em 0.6em !important;
    }
}