/* assets/css/premium-ui.css */
:root {
    --premium-accent: #0061ff;
    --premium-bg: #f8fafc;
    --premium-border: rgba(226, 232, 240, 0.8);
    --premium-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
    --text-main: #1e293b;
    --glass-bg: rgba(255, 255, 255, 0.8);
}

/* Premium Vertical Sidebar — KeyOS Gold Standard v3 */
.premium-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 60px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--premium-border);
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 20px;
    padding-top: 18px;
    box-shadow: 1px 0 10px rgba(0, 0, 0, 0.01);
}

.premium-sidebar:hover {
    width: 220px;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.04);
}

.sidebar-logo {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    margin-bottom: 0px;
    text-decoration: none;
    gap: 10px;
}

/* BRAND SYNC - Compact & Clean v6.2 */
.keyos-brand-sync {
    display: flex;
    align-items: center;
    text-decoration: none;
    height: 100%;
    /* Let parent control height */
    min-height: 56px;
}

.keyos-brand-img {
    height: 30px !important;
    width: auto !important;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.keyos-brand-text {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #1e293b;
    /* Slate 800 */
    letter-spacing: -0.2px;
    transition: opacity 0.2s, transform 0.3s;
    white-space: nowrap;
}

/* Sidebar Specific States */
.sidebar-logo .keyos-brand-text {
    opacity: 0;
    transform: translateX(-10px);
}

.premium-sidebar:hover .sidebar-logo .keyos-brand-text {
    opacity: 1;
    transform: translateX(0);
}

.sidebar-logo:hover .keyos-brand-img {
    transform: scale(1.05);
}

.sidebar-nav {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: #94a3b8;
    /* Slate 400 - Standard Monochrome */
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    white-space: nowrap;
}

.sidebar-item i {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.sidebar-label {
    margin-left: 10px;
    font-weight: 500;
    font-size: 0.8rem;
    color: #64748b;
    /* Slate 500 */
    opacity: 0;
    transition: all 0.25s ease;
    transform: translateX(-10px);
}

.premium-sidebar:hover .sidebar-label {
    opacity: 1;
    transform: translateX(0);
}

.sidebar-item:hover {
    color: var(--premium-accent);
    background: rgba(13, 110, 253, 0.03);
}

.sidebar-item.active {
    color: var(--premium-accent);
    background: rgba(13, 110, 253, 0.05);
}

.sidebar-item.active .sidebar-label {
    color: var(--text-main);
    font-weight: 700;
}

/* Sidebar Icon Wrapper & Desaturation */
.sidebar-icon-wrapper {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: transparent;
}

.sidebar-icon-wrapper i {
    font-size: 1.35rem !important;
    filter: grayscale(1);
    opacity: 0.6;
    transition: all 0.3s ease;
    width: auto !important;
    height: auto !important;
}

/* Hover & Active States: Restore Color & Animation */
.sidebar-item:hover .sidebar-icon-wrapper i,
.sidebar-item.active .sidebar-icon-wrapper i {
    filter: grayscale(0) !important;
    opacity: 1 !important;
    transform: scale(1.1);
}

.sidebar-item:hover .sidebar-icon-wrapper,
.sidebar-item.active .sidebar-icon-wrapper {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
}

/* Module Specific Designs (Matching Home.php icon-boxes) */
.sidebar-icon-anagrafica.sidebar-icon-wrapper {
    background: transparent;
}

.sidebar-item:hover .sidebar-icon-anagrafica,
.sidebar-item.active .sidebar-icon-anagrafica {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%) !important;
}

.sidebar-item:hover .sidebar-icon-anagrafica i,
.sidebar-item.active .sidebar-icon-anagrafica i {
    color: #0284c7 !important;
}

.sidebar-icon-ricondizionati.sidebar-icon-wrapper {
    background: transparent;
}

.sidebar-item:hover .sidebar-icon-ricondizionati,
.sidebar-item.active .sidebar-icon-ricondizionati {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%) !important;
}

.sidebar-item:hover .sidebar-icon-ricondizionati i,
.sidebar-item.active .sidebar-icon-ricondizionati i {
    color: #ea580c !important;
}

.sidebar-icon-whatsapp.sidebar-icon-wrapper {
    background: transparent;
}

.sidebar-item:hover .sidebar-icon-whatsapp,
.sidebar-item.active .sidebar-icon-whatsapp {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
}

.sidebar-item:hover .sidebar-icon-whatsapp i,
.sidebar-item.active .sidebar-icon-whatsapp i {
    color: #16a34a !important;
}

.sidebar-icon-ordini.sidebar-icon-wrapper {
    background: transparent;
}

.sidebar-item:hover .sidebar-icon-ordini,
.sidebar-item.active .sidebar-icon-ordini {
    background: linear-gradient(135deg, #fef9c3 0%, #fde047 100%) !important;
}

.sidebar-item:hover .sidebar-icon-ordini i,
.sidebar-item.active .sidebar-icon-ordini i {
    color: #ca8a04 !important;
}

.sidebar-icon-service.sidebar-icon-wrapper {
    background: transparent;
}

.sidebar-item:hover .sidebar-icon-service,
.sidebar-item.active .sidebar-icon-service {
    background: linear-gradient(135deg, #f3e8ff 0%, #d8b4fe 100%) !important;
}

.sidebar-item:hover .sidebar-icon-service i,
.sidebar-item.active .sidebar-icon-service i {
    color: #9333ea !important;
}

.sidebar-icon-settings.sidebar-icon-wrapper {
    background: transparent;
}

.sidebar-item:hover .sidebar-icon-settings,
.sidebar-item.active .sidebar-icon-settings {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%) !important;
}

.sidebar-item:hover .sidebar-icon-settings i,
.sidebar-item.active .sidebar-icon-settings i {
    color: #64748b !important;
    transform: rotate(30deg) scale(1.1);
}

.sidebar-icon-logout.sidebar-icon-wrapper {
    background: transparent;
}

.sidebar-item:hover .sidebar-icon-logout {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
}

.sidebar-item:hover .sidebar-icon-logout i {
    color: #dc2626 !important;
}

/* Badge Refinement */
.sidebar-badge-premium {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 999px;
    border: 1.5px solid white;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
    z-index: 5;
    transform: translate(30%, -30%);
    filter: none !important;
    /* Never grayscale badges */
    opacity: 1 !important;
}

/* Active Indicator — Right-anchored left pill */
.sidebar-item::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--premium-accent);
    border-radius: 0 4px 4px 0;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-item.active::after {
    height: 24px;
}

.sidebar-bottom {
    border-top: 1px solid var(--premium-border);
    padding-top: 8px;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Layout Adjustments */
body.has-premium-sidebar {
    padding-left: 60px;
    transition: padding-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

body.has-premium-sidebar .navbar-glass.fixed-top {
    left: 60px;
    width: calc(100% - 60px);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid var(--premium-border);
}

/* Ensure navbar transitions don't reflow the brand */
.navbar-glass.fixed-top .container-fluid {
    padding-left: 1.10rem;
    height: 60px;
    /* Force consistent height */
    display: flex;
    align-items: center;
}

@media (max-width: 991px) {
    .premium-sidebar {
        display: none !important;
    }

    body.has-premium-sidebar {
        padding-left: 0 !important;
    }

    body.has-premium-sidebar .navbar-glass.fixed-top {
        left: 0;
        width: 100%;
    }
}

/* Deprecated - use keyos-brand-text */
.logo-text-premium {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
    letter-spacing: -0.3px;
}

/* Base Body Style */
body.premium-ui {
    background-color: var(--premium-bg);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Global Border Radius Overrides for KeyOS */
.btn:not(.rounded-circle):not(.btn-action-circle),
.form-control,
.form-select,
.input-group-text,
.page-link {
    border-radius: 12px !important;
}

.card {
    border-radius: 16px !important;
}

.modal-content {
    border-radius: 16px !important;
}

#fallbackMessage {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    padding: 10px;
    border-radius: 12px;
}


.text-muted {
    color: #64748b !important;
    /* Slightly more vibrant than default muted for better readability */
}

.modal-content .text-muted {
    color: #94a3b8 !important;
    /* Lighter on dark backgrounds */
}

/* Sticky Header Components */
.sticky-header {
    position: sticky;
    top: 75px;
    z-index: 1020;
    background: transparent;
    padding: 0.5rem 0;
}

.header-content-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--premium-border);
    border-radius: 28px;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Search Pills */
.search-pill {
    background: white;
    border-radius: 50px;
    border: 1px solid var(--premium-border);
    padding: 0.35rem 0.75rem 0.35rem 1.25rem;
    /* Tightened right side for inline filters */
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    /* Removed overflow: hidden to allow dropdowns to show */
    overflow: visible;
}

.search-pill:focus-within,
.search-pill.has-expanded-filter {
    border-color: var(--premium-accent) !important;
    box-shadow: 0 4px 20px rgba(13, 110, 253, 0.08);
    width: 100% !important;
    max-width: 850px !important;
    /* Grow on interaction */
}

.search-pill input {
    border: none;
    outline: none;
    background: transparent;
    font-weight: 500;
}

/* Sorting UI */
.sortable {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
    white-space: nowrap;
}

.sortable:hover {
    color: #0d6efd !important;
    background: rgba(13, 110, 253, 0.05);
}

.sortable i {
    font-size: 0.85rem !important;
    transition: all 0.2s ease;
}

.sortable:hover i {
    transform: translateY(-1px);
    opacity: 1 !important;
}


/* KPI Cards */
.kpi-card-mini {
    background: white;
    border-radius: 20px;
    border: 1px solid var(--premium-border);
    padding: 1.25rem;
    height: 100%;
    transition: all 0.3s ease;
}

.kpi-card-mini:hover {
    transform: translateY(-3px);
    box-shadow: var(--premium-shadow);
}

/* Glass Containers */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    border: 1px solid var(--premium-border);
    box-shadow: var(--premium-shadow);
    padding: 0.75rem;
}

/* Action Buttons (Rule 13/31 Refinement) */
.btn-action-premium {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: white;
    border: 1px solid var(--premium-border);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-muted);
}

.btn-action-premium i {
    font-size: 0.9rem;
}

.btn-action-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.1);
    background: white;
}

.btn-action-premium:active {
    transform: scale(0.95);
}


/* Rule 32: Premium Input with Icon/Preview — aligned to Premium Glass */
/* FIX: evita doppio bordo/focus ring sull'input interno (Bootstrap / premium-input) */
.premium-input-icon-group input,
.premium-input-icon-group input:focus,
.premium-input-icon-group input:focus-visible,
.premium-input-icon-group .premium-input,
.premium-input-icon-group .premium-input:focus,
.premium-input-icon-group .form-control,
.premium-input-icon-group .form-control:focus {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* FIX: impedisce radius/bordi interni che “disegnano” una seconda pillola */
.premium-input-icon-group input,
.premium-input-icon-group .premium-input,
.premium-input-icon-group .form-control {
    border-radius: 0 !important;
}

.premium-input-icon-group {
    background: rgba(255, 255, 255, 0.70);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 32px;

    display: flex;
    align-items: center;

    padding: 0.10rem 0.95rem;
    /* più “pill” e meno “box” */
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.premium-input-icon-group:focus-within {
    background: rgba(255, 255, 255, 0.92) !important;
    border-color: rgba(13, 110, 253, 0.45) !important;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.10) !important;
}

.premium-input-icon-group i {
    color: #64748b;
    font-size: 1.05rem;
    margin-right: 0.6rem;
    transition: color .2s ease;
}

.premium-input-icon-group:focus-within i {
    color: #0d6efd;
}

/* Input coerente: niente bold, niente “capsula interna”, padding controllato */
.premium-input-icon-group input {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;

    background: transparent !important;
    padding: 0.70rem 0 !important;

    flex: 1 1 auto;
    font-weight: 500;
    /* Rule 21: textarea/input non bold */
}

/* Validation: stato invalid sul wrapper (consigliato) */
.premium-input-icon-group.is-invalid {
    border-color: rgba(220, 53, 69, 0.45) !important;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.10) !important;
}

.premium-input-icon-group.is-invalid i {
    color: #dc3545;
}


/* Rule 33: Async Action Loader (Premium AI Spinner - TOP CENTER) */
.premium-process-loader {
    position: fixed;
    top: 85px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    padding: 0.75rem 1.8rem;
    border-radius: 100px;
    /* Added subtle blue border and glow for more punch */
    border: 1px solid rgba(13, 110, 253, 0.3);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.1),
        0 10px 20px rgba(13, 110, 253, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 9999;
    animation: slideInDownPill 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.premium-process-loader .spinner-ring {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(13, 110, 253, 0.1);
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes slideInDownPill {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes slideOutUpPill {
    from {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    to {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
}

/* Rule 31 Refinement: Interactive Expanding Filters */
.search-pill-filters-interactive {
    display: flex;
    /* direction: RTL;  Removing row-reverse, let's use standard for simpler VR logic */
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.filter-expandable {
    display: flex;
    align-items: center;
    overflow: hidden;
    width: 38px;
    /* Icon-only state */
    min-width: 38px;
    height: 38px;
    background: transparent;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    position: relative;
    border-radius: 30px;
    padding: 0 10px;
    border: 1px solid transparent;
}

.filter-expandable:hover {
    background: rgba(0, 0, 0, 0.03);
}

.filter-expandable.is-expanded {
    width: auto;
    /*min-width: 140px;*/
    max-width: 350px;
    background: rgba(13, 110, 253, 0.05);
    border-color: rgba(13, 110, 253, 0.1);
    overflow: visible;
    padding-right: 15px;
}

.filter-expandable .filter-icon {
    font-size: 1.1rem;
    color: #64748b;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    pointer-events: none;
}

.filter-expandable.is-expanded .filter-icon {
    display: none;
    /* Hide static icon to avoid duplication with dynamic icon */
}

.filter-expandable .premium-select-wrapper,
.filter-expandable .filter-content-compact {
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    transform: translateX(10px);
    display: none;
}

.filter-expandable.is-expanded .premium-select-wrapper,
.filter-expandable.is-expanded .filter-content-compact {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
    display: flex;
    align-items: center;
}

.filter-expandable .premium-select-trigger {
    background: transparent !important;
    border: none !important;
    padding: 0 0 0 4px !important;
    height: auto !important;
    min-height: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    display: flex !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 8px;
}

.filter-expandable .premium-select-trigger span {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
}

.search-pill .vr {
    flex-shrink: 0;
    height: 18px;
    align-self: center;
    margin: 0 8px;
}

/* Rule 31: Filter Item content spacing */
.filter-content-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}


/* Premium Tables */
.table-responsive-premium {
    overflow-x: auto;
    padding: 5px 24px;
    margin: 0 -24px;
}

.table-premium {
    border-collapse: separate;
    border-spacing: 3px 10px !important;
}

.table-premium tbody tr {
    background: white;
    border-radius: 12px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.table-premium tbody tr:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    background-color: #fbfcfe;
    border-color: var(--premium-accent);
}

/* Rounded corners for first/last cells to match card look */
.table-premium tr td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.table-premium tr td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Interactive Elements */
.btn-action-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: #f1f5f9;
    text-decoration: none;
    color: inherit;
    font-size: 0.95rem;
}

.btn-action-circle:hover {
    transform: scale(1.1);
    background: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.hover-elevate {
    transition: all 0.2s ease;
}

.alert-warning {
    background-color: #f39c12 !important;
}

.hover-elevate:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background-color: #fff !important;
}

/* Maintenance Panels */
.maintenance-panel-premium {
    background: #fdf2f2;
    border: 1px dashed #f87171;
    border-radius: 16px;
    padding: 1.5rem;
}

/* Utilities */
.cursor-pointer {
    cursor: pointer;
}

/* Navbar Tasks Dropdown Premium Styles */
#tasksDropdownBody {
    overflow-x: hidden !important;
}

.task-nav-row {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px !important;
    margin: 4px 10px;
    background: transparent;
    border: 1px solid transparent !important;
    padding: 12px 14px !important;
    color: inherit;
    display: block;
}

.task-nav-row:hover {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.03) !important;
    transform: translateX(2px);
}

.task-check-circle {
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    background: white;
    transition: all 0.2s ease;
}

.task-nav-row:hover .task-check-circle {
    border-color: var(--premium-accent);
}

.urgent-row {
    background: rgba(220, 53, 69, 0.02);
    border: 1px solid rgba(220, 53, 69, 0.08) !important;
}

.urgent-row:hover {
    background: rgba(220, 53, 69, 0.04);
    border-color: rgba(220, 53, 69, 0.15) !important;
}

.urgent-row .task-check-circle {
    border-color: rgba(220, 53, 69, 0.2);
}

.bg-danger-soft {
    background: rgba(220, 53, 69, 0.08);
}

.bg-warning-soft {
    background: rgba(251, 140, 0, 0.08);
}

#taskTab .nav-link {
    color: #64748b;
    padding: 6px 12px;
    transition: all 0.2s ease;
}

#taskTab .nav-link.active {
    background: white !important;
    color: var(--premium-accent) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.hover-primary:hover {
    color: var(--premium-accent) !important;
}

#taskTab .nav-link {
    color: #64748b;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

#taskTab .nav-link.active {
    background: white !important;
    color: var(--premium-accent) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.hover-primary:hover {
    color: var(--premium-accent) !important;
}

.fs-xs {
    font-size: 0.75rem;
}

.xs-text {
    font-size: 0.65rem;
}

.rounded-4 {
    border-radius: 1rem !important;
}

/* Pagination System - Premium Minimalist Restyle */
.pagination-premium {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 2.5rem 0 1rem;
    list-style: none;
}

.pagination-premium .page-link {
    border: 1px solid var(--premium-border);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #64748b;
    border-radius: 16px !important;
    padding: 0;
    width: 40px;
    height: 40px;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    text-decoration: none;
}

.pagination-premium .page-item.active .page-link {
    background: white;
    border-color: var(--premium-accent);
    color: var(--premium-accent);
    box-shadow: 0 10px 25px -5px rgba(0, 97, 255, 0.2);
    transform: translateY(-5px) scale(1.1);
}

.pagination-premium .page-link:hover:not(.active) {
    background: white;
    color: var(--premium-accent);
    transform: translateY(-3px);
    box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.1);
    border-color: var(--premium-border);
}

.pagination-premium .page-item.disabled .page-link {
    opacity: 0.3;
    background: transparent;
    pointer-events: none;
    border-color: rgba(0, 0, 0, 0.05);
}

.pagination-premium .page-item:first-child .page-link,
.pagination-premium .page-item:last-child .page-link {
    background: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
}

/* Premium Modal System - Refined Aesthetic */
.modal-premium .modal-content {
    border: none;
    border-radius: 16px;
    /* overflow: visible to allow dropdowns to overflow. 
       We rely on explicit border-radius on header/footer now. */
    overflow: visible;
    /* Layered shadow for high-end depth */
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 20px 50px -12px rgba(0, 0, 0, 0.15),
        0 30px 60px -15px rgba(0, 0, 0, 0.1);
    background: #ffffff;
}

/* Premium Modal Animation Enhancement */
.modal-premium.fade .modal-dialog {
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    opacity: 0;
}

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

.modal-premium-header {
    padding: 1.25rem 1.75rem;
    color: white;
    position: relative;
    border: none;
    overflow: hidden;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    display: flex;
    /* Force flex here too */
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap !important;
}

.modal-premium-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3Cfilter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
}

.modal-premium-header .modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-premium-header .modal-subtitle {
    font-size: 0.95rem;
    opacity: 0.85;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.modal-premium-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0;
    border-radius: 10px;
    transition: all 0.2s ease;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-size: 14px;
}


.modal-premium-header .btn-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
}

/* Modal Stack Blur Effect */
.modal.modal-blur {
    filter: brightness(0.6) blur(2px);
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Header Variations - Mesh Gradients */
.header-orange {
    background: #f59e0b;
    background-image:
        radial-gradient(at 0% 0%, hsla(35, 92%, 51%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(43, 96%, 58%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(38, 92%, 50%, 1) 0, transparent 50%);
}

.header-green {
    background: #10b981;
    background-image:
        radial-gradient(at 0% 0%, hsla(161, 84%, 39%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(158, 82%, 45%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(162, 88%, 42%, 1) 0, transparent 50%);
}

.header-blue {
    background: #3b82f6;
    background-image:
        radial-gradient(at 0% 0%, hsla(217, 91%, 60%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(224, 76%, 48%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(213, 94%, 68%, 1) 0, transparent 50%);
}

.header-red {
    background: #ef4444;
    background-image:
        radial-gradient(at 0% 0%, hsla(0, 84%, 60%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(0, 72%, 51%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(0, 88%, 65%, 1) 0, transparent 50%);
}

.modal-premium-body {
    padding: 1.25rem;
    background: #ffffff;
    overflow: visible;
}

.modal-section-glass {
    background: #f8fafc;
    border-radius: 20px;
    padding: 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    overflow: visible;
}

.modal-premium-footer {
    padding: 0rem 1rem 1rem;
    border: none;
    background: #ffffff;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Premium Form Elements */
.premium-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: capitalize;
    color: #475569;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.05em;
}

.premium-label i {
    font-size: 1.1rem;
    color: var(--premium-accent);
    opacity: 0.8;
}

.premium-label .required {
    color: #ef4444;
    margin-left: 2px;
}

.premium-input {
    border: 2px solid #f1f5f9;
    border-radius: 18px;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    width: 100%;
    color: #1e293b;
}

.premium-input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.premium-input:hover {
    background: #ffffff;
    border-color: #e2e8f0;
}

.premium-input:focus {
    background: #ffffff;
    border-color: var(--premium-accent);
    box-shadow: 0 0 0 5px rgba(0, 97, 255, 0.1);
    outline: none;
}

/* Modal Buttons */
.btn-premium-cancel {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.7rem 1.5rem;
    font-weight: 700;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-premium-cancel:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateY(-1px);
}

.btn-premium-save {
    background: #10b981;
    color: white;
    border: none;
    border-radius: 14px;
    padding: 0.7rem 2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 1rem;
}

.btn-premium-save:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 35px -5px rgba(16, 185, 129, 0.5);
    background: #059669;
    color: white;
}

.btn-premium-save:active {
    transform: translateY(-2px);
}

.btn-premium-danger {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 14px;
    padding: 0.7rem 2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.4);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 1rem;
}

.btn-premium-danger:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 35px -5px rgba(239, 68, 68, 0.5);
    background: #dc2626;
    color: white;
}

.btn-premium-danger:active {
    transform: translateY(-2px);
}

/* Additional Premium Elements */
.btn-dark-premium {
    background: #1e293b;
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.btn-dark-premium:hover {
    background: #0f172a;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.btn-premium-tool {
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-premium-tool:hover {
    transform: translateY(-2px);
}

.icon-box-kpi {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Inline Filter inside Search Pill */
.filter-select-inline {
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    padding-right: 1.5rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%230061ff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: calc(100% - 2px) center;
    /* Moved slightly left to stay inside pill curve */
    background-size: 11px;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.2s;
}

.filter-select-inline:hover {
    color: var(--premium-accent);
}

.filter-select-inline:focus {
    outline: none;
}

.search-pill-container {
    max-width: 740px;
}

/* Premium Switch Component */
.premium-switch-group {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 20px;
    padding: 1.1rem 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
}

.premium-switch-group:hover {
    border-color: var(--premium-accent);
    background: #fdfdfd;
}

.premium-switch-group .form-check {
    padding-left: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    justify-content: space-between;
}

.premium-switch-group .form-check-input {
    width: 3.2em !important;
    height: 1.7em !important;
    background-color: #cbd5e1;
    border-color: transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    box-shadow: none !important;
    margin-top: 0;
    margin-left: 0;
    order: 2;
    /* Switch on the right by default if needed, or just let d-flex handle it */
}

.premium-switch-group .form-check-input:checked {
    background-color: #10b981;
    border-color: #10b981;
}

.premium-switch-group .form-check-label {
    cursor: pointer;
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95rem;
    margin-bottom: 0;
    order: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.premium-switch-group .switch-description {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    display: block;
}

/* Premium ID Badge */
.id-badge-premium {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 1em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    background-color: #f8fafc !important;
    border: 1px solid var(--premium-border) !important;
    font-family: monospace !important;
    text-decoration: none !important;
}

.text-capitalize-premium {
    text-transform: capitalize !important;
}

/* Fast Nav App Switcher Styles */
.fast-nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 0.5rem;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    height: 100%;
}

.fast-nav-card:hover {
    background: white;
    border-color: var(--premium-accent);
    transform: translateY(-5px);
    box-shadow: 0 12px 20px -10px rgba(0, 97, 255, 0.2);
}

.fast-nav-card .icon-box-nav {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.fast-nav-card:hover .icon-box-nav {
    transform: scale(1.1);
}

.fast-nav-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Hero Search Pill */
.hero-search-pill {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 80px;
    padding: 1rem 2rem;
    width: 100%;
    max-width: 700px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.05);
}

.hero-search-pill:hover {
    transform: translateY(-3px);
    background: white;
    box-shadow: 0 30px 50px -15px rgba(0, 0, 0, 0.1);
    border-color: var(--premium-accent);
}

.hero-search-pill i {
    font-size: 1.5rem;
    color: var(--premium-accent);
}

.hero-search-pill span {
    font-size: 1.1rem;
    font-weight: 500;
    color: #94a3b8;
}

.hero-search-pill .badge {
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
}

/* --- RECOVERY: Module Cards (Global) --- */
.module-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--premium-border);
    border-radius: 24px;
    padding: 2.5rem 1.5rem;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--premium-shadow);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.9);
}

.icon-container {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
    transition: transform 0.3s ease;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.05);
}

.module-card:hover .icon-container {
    transform: scale(1.1) rotate(-5deg);
}

.card-title {
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.badge-float {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #ef4444;
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.35em 0.8em;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    border: 2px solid white;
}

.card-actions {
    margin-top: auto;
    display: flex;
    gap: 0.75rem;
    width: 100%;
    justify-content: center;
    opacity: 0.8;
}

.module-card:hover .card-actions {
    opacity: 1;
}

.btn-new {
    background: #f1f5f9;
    color: #334155;
    border: none;
    border-radius: 12px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-new:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.btn-search-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: #64748b;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--premium-border);
}

.btn-search-icon:hover {
    color: var(--premium-accent);
}

/* Background Depth Blobs */
.bg-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.5;
    pointer-events: none;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: #e0f2fe;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: #f0f9ff;
}

.blob-3 {
    top: 40%;
    left: 40%;
    width: 400px;
    height: 400px;
    background: #e0e7ff;
    opacity: 0.3;
}

/* Hero Refined Aesthetics */
/* --- HOME SPECIFIC: Hero Section --- */
.home-hero {
    position: relative;
    padding: 2rem 0 0.5rem;
    text-align: center;
    border-radius: 40px;
    margin-bottom: 2.5rem;
    overflow: hidden;
    /* Ultra-Premium Mesh Gradient */
    background: #4f46e5;
    background-image:
        radial-gradient(at 0% 0%, hsla(243, 75%, 59%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(263, 70%, 50%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(213, 94%, 68%, 1) 0, transparent 50%),
        radial-gradient(at 0% 100%, hsla(243, 75%, 59%, 1) 0, transparent 50%),
        radial-gradient(at 100% 100%, hsla(263, 70%, 50%, 1) 0, transparent 50%);
    box-shadow:
        0 25px 50px -12px rgba(79, 70, 229, 0.25),
        inset 0 0 100px rgba(0, 0, 0, 0.1);
    transition: all 0.5s ease;
}

.home-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.1;
    pointer-events: none;
}

.home-hero .hero-title {
    font-size: 3rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 0.5rem;
    letter-spacing: -0.04em;
    text-align: center;
    width: 100%;
    display: block;
}

.home-hero .hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2rem;
    font-weight: 600;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* Module Specific Icon Colors */
.icon-anagrafica {
    background: #e0f2fe;
    color: #0369a1;
}

.icon-devices {
    background: #fef3c7;
    color: #b45309;
}

.icon-whatsapp {
    background: #dcfce7;
    color: #15803d;
}

.icon-orders {
    background: #fef2f2;
    color: #b91c1c;
}

.icon-lab {
    background: #f3e8ff;
    color: #7e22ce;
}

/* --- ULTRA-PREMIUM: Module Cards --- */
.module-card-premium {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    /* Reflection effect */
    border-radius: 32px;
    padding: 2.5rem 2rem;
    height: 100%;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow:
        0 10px 30px -10px rgba(0, 0, 0, 0.05),
        inset 0 0 20px rgba(255, 255, 255, 0.2);
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.module-card-premium:hover {
    transform: translateY(-12px) scale(1.03);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.module-card-premium .icon-box {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.1);
}

.module-card-premium:hover .icon-box {
    transform: scale(1.15) rotate(-4deg);
}

/* Admin Bar Premium */
.admin-bar-premium {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(25px) saturate(150%);
    border-radius: 24px;
    padding: 1.25rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
    margin-top: 4rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.6);
}

.admin-tool-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 1.25rem;
    border-radius: 14px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-tool-item:hover {
    background: white;
    color: #6366f1;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Fast Nav Styles */
.fast-nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 0.5rem;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    /* CRITICAL for absolute badges */
    height: 100%;
}

.fast-nav-card:hover {
    background: white;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border-color: rgba(99, 102, 241, 0.2);
}

.icon-box-nav {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.fast-nav-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    text-transform: capitalize;
}

.fast-nav-badge {
    position: absolute;
    top: 8px;
    right: 12px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 999px;
    border: 2px solid white;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
    z-index: 10;
}

/* PROTOCOL CONFORMITY: Section 2. Standard Estetici */
.text-capitalize-premium {
    text-transform: capitalize !important;
}

.id-badge-premium {
    font-family: 'JetBrains Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    padding: 4px 8px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 6px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
}

.table-responsive-premium {
    border-radius: 20px;
    padding: 4px;
    /* for shadow allowance */
}

/* Hero Badge Refinement */
.badge-float {
    position: absolute;
    top: -12px;
    right: -12px;
    background: #ef4444;
    color: white;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 6px 10px;
    border-radius: 999px;
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4);
    border: 3px solid white;
    z-index: 5;
    animation: badge-pop 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes badge-pop {
    0% {
        transform: scale(0);
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* --- ULTRA-PREMIUM: Spotlight Modal --- */
#spotlightModal .modal-content {
    background: rgba(15, 23, 42, 0.8) !important;
    backdrop-filter: blur(40px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 36px;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.7);
}

#spotlightInput {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    font-weight: 500;
}

#spotlightInput:focus {
    background: rgba(255, 255, 255, 0.07) !important;
    border-color: rgba(99, 102, 241, 0.5) !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15) !important;
    outline: none;
}

/* Spotlight Result Card */
.spotlight-result-card {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none !important;
    color: white !important;
}

.spotlight-result-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(8px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

.spotlight-avatar {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-right: 1.25rem;
    transition: transform 0.3s ease;
}

.spotlight-result-card:hover .spotlight-avatar {
    transform: scale(1.1) rotate(-5deg);
}

.result-main {
    flex: 1;
}

.result-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    letter-spacing: -0.01em;
}

.result-meta {
    font-size: 0.85rem;
    color: #cbd5e1;
    /* Maintain good contrast */
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.95;
    /* Increased from 0.85 */
}

.result-meta .opacity-75 {
    opacity: 1 !important;
    /* Force legibility */
}

.result-meta .text-muted {
    color: #94a3b8 !important;
    /* Ensure muted parts are still visible */
}

.result-meta .fw-bold {
    color: white !important;
    /* Ensure status text is vibrant */
}

/* Keyboard Selection Highlighting */
.spotlight-result-card.selected {
    background: rgba(99, 102, 241, 0.2) !important;
    border-color: rgba(99, 102, 241, 0.6) !important;
    transform: translateX(12px) scale(1.01);
    box-shadow: 0 15px 40px -10px rgba(0, 0, 0, 0.4);
    outline: none;
}

.spotlight-result-card.selected .ms-auto {
    opacity: 1 !important;
    transform: translateX(4px);
    transition: all 0.3s ease;
}

/* Specific Badge Styles (Protocol Aligned) */
.sl-badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sl-badge-primary {
    background: rgba(0, 97, 255, 0.15);
    color: #60a5fa;
}

.sl-badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.sl-badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

/* Empty State / Initial View Styles */
.quick-action-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: #94a3b8;
}

.spotlight-result-card:hover .quick-action-icon,
.spotlight-result-card.selected .quick-action-icon {
    background: rgba(99, 102, 241, 0.3);
    color: white;
}

/* Module Specific Coloring for Spotlight */
.sl-anagrafica {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
}

.sl-ricondizionati {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.sl-ordini {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.sl-whatsapp {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.sl-ai {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.sl-default {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.section-divider {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(148, 163, 184, 0.6);
    margin: 1.5rem 0 1rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
}

.spotlight-result-card:hover .result-meta,
.spotlight-result-card.selected .result-meta {
    color: #f1f5f9;
    opacity: 1;
}

/* --- Command Guide Overlay --- */
.command-guide-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    z-index: 100;
    border-radius: 36px;
    display: none;
    flex-direction: column;
    padding: 3rem;
    animation: fadeIn 0.3s ease;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.guide-item h6 {
    color: #6366f1;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.guide-key {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-family: monospace;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* AI Results Pulse */
.sl-ai-result {
    border-color: rgba(99, 102, 241, 0.4) !important;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%) !important;
    position: relative;
    overflow: hidden;
}

.sl-ai-result::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    animation: ai-sweep 3s infinite;
}

@keyframes ai-sweep {
    0% {
        left: -100%;
    }

    50% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

.ai-badge {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
}

/* --- EXPANDABLE SEARCH (Header) --- */
.search-expandable-container {
    padding: 6px;
    border-radius: 50px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 38px;
    height: 38px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

.search-expandable-container:hover {
    width: 250px;
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--premium-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-expandable-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    color: var(--text-muted);
    transition: color 0.3s;
}

.search-expandable-container:hover .search-expandable-btn {
    color: var(--text-main);
}

.search-expandable-btn i {
    font-size: 1rem;
    flex-shrink: 0;
    margin-left: 10px;
}

.search-text {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-expandable-container:hover .search-text {
    opacity: 1;
    transform: translateX(0);
}

.search-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    margin-left: auto;
    margin-right: 5px;
    opacity: 0;
    transition: opacity 0.3s delay 0.1s;
}

.search-expandable-container:hover .search-badge {
    opacity: 1;
}


/* Advanced Autocomplete Redesign */
.autocomplete-results-container {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--premium-border);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    overflow-y: auto;
    margin-top: 8px;
    z-index: 1100;
}

.autocomplete-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    text-transform: none !important;
}

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

.autocomplete-item:hover,
.autocomplete-item.active {
    background: rgba(0, 97, 255, 0.04);
    color: var(--premium-accent);
    padding-left: 1.75rem;
}

/* Rule 36: Model Code Pill (Global Utility) */
.model-code-pill {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    font-weight: 700;
    transition: all 0.2s;
    display: inline-block;
    letter-spacing: 0.02em;
}

.autocomplete-item:hover .model-code-pill,
.autocomplete-item.active .model-code-pill,
.premium-select-item:hover .model-code-pill {
    background: var(--premium-accent);
    color: white;
}

/* Perfect Sync Ghost Text */
.ghost-text-container {
    pointer-events: none;
    white-space: pre;
    font-family: inherit;
    font-size: inherit;
    font-weight: 500;
    line-height: inherit;
    letter-spacing: inherit;
    color: #94a3b8;
    opacity: 0.6;
}

/* Premium Scrollbar for Autocomplete */
.autocomplete-results-container::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-results-container::-webkit-scrollbar-track {
    background: transparent;
}

.autocomplete-results-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.autocomplete-results-container:hover::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

/* AI Control Center Refined */
.ai-toolbox-container {
    z-index: 1000;
    pointer-events: auto;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ai-toolbox-items {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12), 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 6px !important;
    border-radius: 50px !important;
}

.btn-toolbox {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #475569;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    position: relative;
    outline: none !important;
}

.btn-toolbox:hover {
    background: rgba(0, 97, 255, 0.1);
    color: var(--primary-color, #0061ff);
    transform: translateY(-2px);
}

.btn-toolbox i {
    pointer-events: none;
}

.btn-toolbox::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: #0f172a;
    color: white;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-bottom: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-toolbox:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* --- KeyOS Premium Hint System --- */
.keyos-hint-container {
    position: fixed;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
    max-width: 350px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    text-align: left;
    white-space: normal;
    word-break: break-word;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- PHASE 3: Refined Timeline (Screen 2) --- */
.timeline-refined {
    position: relative;
    padding-left: 2.25rem;
}

.timeline-refined::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 5px;
    bottom: 80px;
    width: 2px;
    background: #f1f5f9;
    border-radius: 2px;
}

.timeline-item-refined {
    position: relative;
    margin-bottom: 0.75rem;
}

.timeline-marker-refined {
    position: absolute;
    left: -32px;
    top: 2px;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1.5px solid #e2e8f0;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.timeline-item-refined:hover .timeline-marker-refined {
    transform: scale(1.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.timeline-bubble-refined {
    background: #fcfdfe;
    padding: 0.5rem 0.85rem;
    border-radius: 14px;
    border: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.timeline-item-refined:hover .timeline-bubble-refined {
    border-color: #e2e8f0;
    box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.05);
}

.timeline-header-refined {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.timeline-author-refined {
    font-weight: 700;
    color: #475569;
    font-size: 0.85rem;
}

.timeline-time-refined {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Status specific markers */
.marker-status-changed {
    border-color: #3b82f6 !important;
    color: #3b82f6;
}

.marker-created {
    border-color: #6366f1 !important;
    color: #6366f1;
}

.marker-comment {
    border-color: #f59e0b !important;
    color: #f59e0b;
}

.marker-client-update {
    border-color: #10b981 !important;
    color: #10b981;
}

.marker-due-changed {
    border-color: #ec4899 !important;
    color: #ec4899;
}

/* --- PHASE 3: Inline Editing Refinement --- */
.premium-glass-input {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid #6366f1;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    width: 100%;
    color: #1e293b;
    font-family: inherit;
    font-size: inherit;
    font-weight: 500;
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.2);
    outline: none !important;
    transition: all 0.2s ease;
}

.premium-glass-input:focus {
    background: #fff;
    box-shadow: 0 15px 40px -10px rgba(99, 102, 241, 0.3);
}

.fs-xs {
    font-size: 0.75rem;
}

.ls-1 {
    letter-spacing: 0.05em;
}

.clickable-hover:hover {
    background: rgba(99, 102, 241, 0.03) !important;
    cursor: pointer;
}

.keyos-hint-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.keyos-hint-arrow {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(15, 23, 42, 0.95);
}

/* --- KeyOS Premium Select System --- */
.premium-select-wrapper {
    position: relative;
    display: block;
    width: 100%;
    margin-bottom: 0;
}

.premium-select-trigger {
    display: block;
    padding: 0.65rem 1.15rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 44px;
    font-weight: 500;
    color: #1e293b;
    user-select: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.premium-select-trigger .selected-content {
    flex: 1;
    overflow: hidden;
}

.premium-select-trigger i.bi-circle-fill {
    font-size: 0.75rem;
}

.premium-select-trigger:hover {
    background: white;
    border-color: rgba(0, 123, 255, 0.3);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.premium-select-wrapper.active .premium-select-trigger {
    border-color: #0d6efd;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1), 0 5px 15px rgba(0, 0, 0, 0.05);
    background: white;
}

.premium-select-trigger span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}

.premium-select-trigger i {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    opacity: 0.6;
    color: #64748b;
}

.premium-select-wrapper.active .premium-select-trigger i {
    transform: rotate(180deg);
    opacity: 1;
    color: #0d6efd;
}

.premium-select-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 1200;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--premium-border);
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    animation: premiumSelectFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

@keyframes premiumSelectFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Variant for inline filters in search pills */
.filter-select-inline+.premium-select-wrapper {
    display: inline-block;
    width: auto;
    min-width: auto;
    flex-shrink: 0;
}

.filter-select-inline+.premium-select-wrapper .premium-select-trigger {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    padding: 0 0.75rem;
    min-height: auto;
    font-size: 0.9rem;
    font-weight: 500;
    color: #475569;
    box-shadow: none;
}

.filter-select-inline+.premium-select-wrapper .premium-select-trigger:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 50px;
    transform: none;
}

.filter-select-inline+.premium-select-wrapper .premium-select-dropdown {
    width: 240px;
    left: auto;
    right: -10px;
    border-radius: 20px;
}

.premium-select-wrapper .autocomplete-item {
    padding: 0.85rem 1.5rem;
    font-size: 0.9rem;
}

/* Rule M9: Premium Input Group Standard (Gold) */
.premium-input-group {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    overflow: hidden;
}

.premium-input-group:focus-within {
    border-color: var(--premium-accent) !important;
    box-shadow: 0 0 0 4px rgba(0, 97, 255, 0.1) !important;
}

.premium-input-addon {
    width: 42px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    background: #f8fafc;
}

.premium-input-group:focus-within .premium-input-addon {
    color: var(--premium-accent);
}

.premium-input-group .premium-input {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.premium-input-group.is-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1) !important;
}

.premium-input-group.is-invalid .premium-input-addon {
    color: #ef4444;
}

/* Rule: Pagination & Row Animation */
tr.paginated-visible {
    animation: fadeInRow 0.5s ease forwards;
}

@keyframes fadeInRow {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Rule 65: Empty State Card */
.empty-state-card {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #ffffff;
    border-radius: 16px;
    border: 1px dashed #e2e8f0;
    color: #64748b;
}

.empty-state-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    color: #cbd5e1;
}

/* Vertical Priority Selector - Premium Task Modal */
.vertical-priority-selector {
    width: 52px;
}

.btn-prio {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    border: 2px solid #f1f5f9;
    background: #f8fafc;
    color: #94a3b8;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-prio:hover {
    background: #ffffff;
    border-color: #e2e8f0;
    transform: scale(1.05);
}

.btn-check:checked+.btn-prio {
    background: #ffffff;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

/* Specific colors for checked state */
#prio_urgent:checked+.btn-prio {
    border-color: #3b82f6;
    color: #3b82f6;
}

#prio_high:checked+.btn-prio {
    border-color: #ef4444;
    color: #ef4444;
}

#prio_medium:checked+.btn-prio {
    border-color: #f59e0b;
    color: #f59e0b;
}

#prio_low:checked+.btn-prio {
    border-color: #10b981;
    color: #10b981;
}

.vertical-priority-selector .btn-check+label {
    cursor: pointer;
}