/* Full Page Takeover - Fixed Position */
.nuvix-assignment-login-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    z-index: 9999;
    overflow-y: auto;
}

.nuvix-assignment-login {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(145deg, #1e293b, #273548);
    border-radius: 20px;
    padding: clamp(25px, 6vw, 45px);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    box-sizing: border-box;
}

.nuvix-assignment-login h2 {
    color: #fff;
    margin: 0 0 clamp(20px, 5vw, 35px) 0;
    text-align: center;
    font-weight: 300;
    font-size: clamp(1.4rem, 5vw, 1.8rem);
}

.nuvix-assignment-login .form-group {
    margin-bottom: clamp(15px, 4vw, 22px);
}

.nuvix-assignment-login label {
    display: block;
    color: #94a3b8;
    margin-bottom: 8px;
    font-size: clamp(13px, 3.5vw, 15px);
    font-weight: 500;
}

.nuvix-assignment-login input {
    width: 100%;
    padding: clamp(12px, 3vw, 16px);
    background: #374151;
    border: 2px solid #4b5563;
    border-radius: 10px;
    color: #fff;
    font-size: clamp(15px, 4vw, 17px);
    box-sizing: border-box;
    transition: all 0.3s;
}

.nuvix-assignment-login input:focus {
    outline: none;
    border-color: #1E9BD7;
    background: #3d4a5c;
    box-shadow: 0 0 0 4px rgba(30, 155, 215, 0.15);
}

.nuvix-assignment-login input::placeholder {
    color: #6b7280;
}

.nuvix-assignment-login button {
    width: 100%;
    padding: clamp(14px, 4vw, 18px);
    background: linear-gradient(135deg, #1E9BD7, #8BC53F);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: clamp(15px, 4vw, 17px);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 10px;
}

.nuvix-assignment-login button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(30, 155, 215, 0.4);
}

.nuvix-assignment-login button:active {
    transform: translateY(-1px);
}

.nuvix-assignment-error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 2px solid #fecaca;
    padding: clamp(12px, 3vw, 16px);
    border-radius: 10px;
    color: #dc2626;
    margin-bottom: clamp(15px, 4vw, 22px);
    text-align: center;
    font-weight: 500;
}


/* Full Page Reset & Takeover - Fixed Position Approach */
.nuvix-assignment-dashboard {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: clamp(15px, 4vw, 30px);
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 9999;
    overflow-y: auto;
    overflow-x: hidden;
}

.nuvix-assignment-dashboard * {
    box-sizing: border-box;
}

.nuvix-assignment-container {
    max-width: 1400px;
    margin: 0 auto;
    background: linear-gradient(145deg, #343a40, #2d3238);
    border-radius: clamp(12px, 3vw, 20px);
    padding: clamp(15px, 4vw, 35px);
    color: #fff;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
}

.nuvix-assignment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(20px, 5vw, 35px);
    flex-wrap: wrap;
    gap: clamp(15px, 3vw, 20px);
}

.nuvix-assignment-header h2 {
    font-size: clamp(1.4rem, 5vw, 2rem);
    font-weight: 300;
    margin: 0;
    color: #fff;
    background: linear-gradient(135deg, #1E9BD7, #8BC53F);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nuvix-assignment-user-info {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2vw, 15px);
    background: #374151;
    padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 20px);
    border-radius: 10px;
    flex-wrap: wrap;
}

.nuvix-assignment-user-info span {
    color: #94a3b8;
    font-size: clamp(12px, 3vw, 14px);
}

.nuvix-assignment-user-info strong {
    color: #1E9BD7;
}

.nuvix-logout-btn {
    background: #ef4444;
    color: white;
    padding: clamp(6px, 2vw, 10px) clamp(12px, 3vw, 18px);
    border-radius: 8px;
    text-decoration: none;
    font-size: clamp(12px, 3vw, 14px);
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.nuvix-logout-btn:hover {
    background: #dc2626;
    color: white;
    transform: translateY(-2px);
}

/* Stats Cards */
.nuvix-assignment-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: clamp(12px, 3vw, 20px);
    margin-bottom: clamp(20px, 5vw, 35px);
}

.nuvix-assignment-stat {
    background: linear-gradient(145deg, #374151, #3d4654);
    padding: clamp(15px, 4vw, 25px);
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.nuvix-assignment-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.nuvix-assignment-stat h3 {
    margin: 0 0 clamp(8px, 2vw, 12px) 0;
    color: #94a3b8;
    font-size: clamp(11px, 2.5vw, 14px);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nuvix-assignment-stat .number {
    font-size: clamp(28px, 8vw, 42px);
    font-weight: 700;
    background: linear-gradient(135deg, #1E9BD7, #8BC53F);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Tabs */
.nuvix-assignment-tabs {
    display: flex;
    gap: clamp(8px, 2vw, 12px);
    margin-bottom: clamp(15px, 4vw, 25px);
    border-bottom: 2px solid #4b5563;
    padding-bottom: clamp(10px, 2vw, 15px);
    flex-wrap: wrap;
}

.nuvix-assignment-tab {
    padding: clamp(10px, 2.5vw, 14px) clamp(15px, 4vw, 24px);
    background: transparent;
    border: 2px solid transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: clamp(13px, 3.5vw, 15px);
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s;
    white-space: nowrap;
}

.nuvix-assignment-tab:hover {
    background: #374151;
    color: #fff;
}

.nuvix-assignment-tab.active {
    background: linear-gradient(135deg, #1E9BD7, #1580B6);
    color: #fff;
    border-color: transparent;
}

.nuvix-assignment-panel {
    display: none;
}

.nuvix-assignment-panel.active {
    display: block;
}

/* Table Styles */
.nuvix-assignment-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -15px;
    padding: 0 15px;
}

.nuvix-assignment-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
}

.nuvix-assignment-table th,
.nuvix-assignment-table td {
    padding: clamp(12px, 3vw, 18px) clamp(10px, 2vw, 15px);
    text-align: left;
    border-bottom: 1px solid #4b5563;
}

.nuvix-assignment-table th {
    background: linear-gradient(145deg, #2d3238, #262b30);
    color: #94a3b8;
    font-weight: 600;
    font-size: clamp(11px, 2.5vw, 13px);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.nuvix-assignment-table tbody tr {
    transition: all 0.2s;
}

.nuvix-assignment-table tbody tr:hover {
    background: rgba(30, 155, 215, 0.1);
}

.nuvix-assignment-table td {
    color: #e5e7eb;
    font-size: clamp(13px, 3vw, 14px);
}

/* Bulk Actions Bar */
.nuvix-bulk-actions {
    background: linear-gradient(135deg, #1E9BD7, #1580B6);
    padding: clamp(15px, 3vw, 20px) clamp(20px, 4vw, 30px);
    border-radius: 12px;
    margin-bottom: clamp(15px, 4vw, 25px);
    display: flex;
    align-items: center;
    gap: clamp(15px, 3vw, 25px);
    flex-wrap: wrap;
    box-shadow: 0 10px 30px rgba(30, 155, 215, 0.3);
    animation: slideDown 0.3s ease;
}

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

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

.nuvix-bulk-actions-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nuvix-bulk-actions-left span:first-child {
    font-size: 24px;
}

.nuvix-bulk-actions-left .nuvix-selected-count {
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
}

.nuvix-bulk-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-left: auto;
}

.nuvix-bulk-actions .nuvix-ref-select {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    min-width: 200px;
    max-width: 280px;
    padding: 10px 40px 10px 14px;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
    border-radius: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.nuvix-bulk-actions .nuvix-ref-select option {
    background: #1a5276;
    color: #fff;
    padding: 10px;
}

.nuvix-bulk-actions .nuvix-assign-btn {
    background: #fff;
    color: #1E9BD7;
    font-weight: 700;
    padding: 12px 20px;
    white-space: nowrap;
}

.nuvix-bulk-actions .nuvix-clear-btn {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
}

.nuvix-bulk-actions .nuvix-clear-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

/* Checkbox Styling */
.nuvix-lead-checkbox,
.nuvix-lead-checkbox-mobile {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #1E9BD7;
}

.nuvix-lead-row.selected {
    background: rgba(30, 155, 215, 0.15) !important;
}

/* Form Elements */
.nuvix-ref-select {
    background: #374151;
    border: 2px solid #4b5563;
    border-radius: 8px;
    padding: 10px 40px 10px 14px;
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
    min-width: 160px;
    width: 100%;
    max-width: 220px;
    cursor: pointer;
    transition: all 0.3s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    height: auto;
    vertical-align: middle;
}

.nuvix-ref-select:focus {
    outline: none;
    border-color: #1E9BD7;
    box-shadow: 0 0 0 3px rgba(30, 155, 215, 0.2);
}

.nuvix-assign-btn {
    background: linear-gradient(135deg, #1E9BD7, #8BC53F);
    border: none;
    color: #fff;
    padding: clamp(10px, 2.5vw, 14px) clamp(16px, 4vw, 24px);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: clamp(12px, 3vw, 14px);
    transition: all 0.3s;
    white-space: nowrap;
}

.nuvix-assign-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 155, 215, 0.4);
}

.nuvix-assign-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* No Leads Message */
.nuvix-no-leads {
    text-align: center;
    padding: clamp(40px, 10vw, 80px) clamp(20px, 5vw, 40px);
    color: #94a3b8;
}

.nuvix-no-leads .emoji {
    font-size: clamp(3rem, 15vw, 5rem);
    margin-bottom: clamp(15px, 4vw, 25px);
    opacity: 0.6;
}

.nuvix-no-leads h3 {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    margin: 0 0 10px 0;
    color: #fff;
}

.nuvix-no-leads p {
    font-size: clamp(13px, 3vw, 15px);
    margin: 0;
}

/* Badges */
.nuvix-history-badge {
    display: inline-block;
    padding: clamp(4px, 1vw, 6px) clamp(10px, 2vw, 14px);
    border-radius: 20px;
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.nuvix-history-badge.assigned {
    background: rgba(139, 197, 63, 0.2);
    color: #8BC53F;
}

.nuvix-lead-email {
    color: #1E9BD7;
    word-break: break-all;
}

.nuvix-lead-phone {
    color: #8BC53F;
    white-space: nowrap;
}

.nuvix-lead-name {
    font-weight: 600;
    color: #fff;
}

/* Mobile Card View */
.nuvix-mobile-cards {
    display: none;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
    .nuvix-assignment-table-wrapper {
        display: none;
    }

    .nuvix-mobile-cards {
        display: block;
    }

    .nuvix-mobile-card {
        background: linear-gradient(145deg, #374151, #3d4654);
        border-radius: 12px;
        padding: clamp(15px, 4vw, 20px);
        margin-bottom: clamp(12px, 3vw, 16px);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nuvix-mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 12px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .nuvix-mobile-card-name {
        font-size: clamp(16px, 4vw, 18px);
        font-weight: 700;
        color: #fff;
    }

    .nuvix-mobile-card-date {
        font-size: clamp(11px, 2.5vw, 12px);
        color: #6b7280;
    }

    .nuvix-mobile-card-info {
        display: grid;
        gap: 8px;
        margin-bottom: 15px;
    }

    .nuvix-mobile-card-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nuvix-mobile-card-row:last-child {
        border-bottom: none;
    }

    .nuvix-mobile-card-label {
        font-size: clamp(11px, 2.5vw, 12px);
        color: #6b7280;
        text-transform: uppercase;
        font-weight: 600;
    }

    .nuvix-mobile-card-value {
        font-size: clamp(13px, 3vw, 14px);
        color: #e5e7eb;
        text-align: right;
        word-break: break-all;
    }

    .nuvix-mobile-card-actions {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        padding-top: 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nuvix-mobile-card-actions .nuvix-ref-select {
        flex: 1;
        min-width: 120px;
        max-width: none;
    }

    .nuvix-mobile-card-actions .nuvix-assign-btn {
        flex: 1;
        min-width: 100px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .nuvix-assignment-dashboard {
        padding: 10px;
        margin: -10px;
        width: calc(100% + 20px);
    }

    .nuvix-assignment-container {
        padding: 15px;
        border-radius: 15px;
    }

    .nuvix-assignment-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .nuvix-assignment-user-info {
        justify-content: center;
    }

    .nuvix-assignment-tabs {
        justify-content: center;
    }

    .nuvix-assignment-stat {
        padding: 15px;
    }
}